2013-05-06 18:36:40

by Tony Luck

[permalink] [raw]
Subject: VFAT complains that my file system may be corrupted

Built Linus' tree this morning (HEAD =
d7ab7302f970a254997687a1cdede421a5635c68) and got this message:

FAT-fs (sda1): Volume was not properly unmounted. Some data may be
corrupt. Please run fsck.

when booting my ia64 machine. The message may well be legitimate
because I did crash the machine, so the filessytem was not unmounted
cleanly.

BUT ... If I unmount and run fsck as it suggests, then I see:

# fsck /boot/efi
fsck from util-linux-ng 2.16
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
65:01/00
1) Copy original to backup
2) Copy backup to original
3) No action

I tried option 3 - fsck made no other changes, but I still see the
message. I tried
option 1 - and I still see the message. So I went for option 2 ... and
guess what,
I still see the message when I mount this filesystem.

Note that with either option 1 or 2 "fsck" says:

Leaving file system unchanged.
/dev/sda1: 20 files, 19865/255496 clusters

This is the first time I've ever seen this message ... but I haven't
had this system crash for some time, so not really sure when this may
have started.

-Tony


2013-05-06 18:44:12

by Oleksij Rempel

[permalink] [raw]
Subject: Re: VFAT complains that my file system may be corrupted

Am 06.05.2013 20:36, schrieb Tony Luck:
> Built Linus' tree this morning (HEAD =
> d7ab7302f970a254997687a1cdede421a5635c68) and got this message:
>
> FAT-fs (sda1): Volume was not properly unmounted. Some data may be
> corrupt. Please run fsck.
>
> when booting my ia64 machine. The message may well be legitimate
> because I did crash the machine, so the filessytem was not unmounted
> cleanly.
>
> BUT ... If I unmount and run fsck as it suggests, then I see:
>
> # fsck /boot/efi
> fsck from util-linux-ng 2.16
> dosfsck 2.11, 12 Mar 2005, FAT32, LFN
> There are differences between boot sector and its backup.
> Differences: (offset:original/backup)
> 65:01/00
> 1) Copy original to backup
> 2) Copy backup to original
> 3) No action
>
> I tried option 3 - fsck made no other changes, but I still see the
> message. I tried
> option 1 - and I still see the message. So I went for option 2 ... and
> guess what,
> I still see the message when I mount this filesystem.
>
> Note that with either option 1 or 2 "fsck" says:
>
> Leaving file system unchanged.
> /dev/sda1: 20 files, 19865/255496 clusters
>
> This is the first time I've ever seen this message ... but I haven't
> had this system crash for some time, so not really sure when this may
> have started.

Hi Tony,
i provided patches for dosfstools for some time now, you need at least
v3.0.14. If your system do not provide it you will need to grub it here:
http://daniel-baumann.ch/gitweb/?p=software/dosfstools.git


--
Regards,
Oleksij

2013-05-06 18:51:56

by Tony Luck

[permalink] [raw]
Subject: Re: VFAT complains that my file system may be corrupted

On Mon, May 6, 2013 at 11:44 AM, Oleksij Rempel
<[email protected]> wrote:
> i provided patches for dosfstools for some time now, you need at least
> v3.0.14. If your system do not provide it you will need to grub it here:
> http://daniel-baumann.ch/gitweb/?p=software/dosfstools.git

I may have too old a toolchain to build those :-(

src/boot.c:560: warning: implicit declaration of function ?cpu_to_le16?
src/boot.c:562: warning: implicit declaration of function ?cpu_to_le32?

and then at link time:

/home/aegl/dosfstools/src/boot.c:560: undefined reference to `cpu_to_le16'
/home/aegl/dosfstools/src/boot.c:561: undefined reference to `cpu_to_le16'
/home/aegl/dosfstools/src/boot.c:562: undefined reference to `cpu_to_le32'

I guess I can fake them easily (ia64 runs little endian on Linux).

-Tony

2013-05-06 19:02:48

by Tony Luck

[permalink] [raw]
Subject: Re: VFAT complains that my file system may be corrupted

On Mon, May 6, 2013 at 11:51 AM, Tony Luck <[email protected]> wrote:
> I guess I can fake them easily (ia64 runs little endian on Linux).

Duh. Especially as the only use is line 560-562 in src/boot.c:

de.starthi = CT_LE_W(0);
de.start = CT_LE_W(0);
de.size = CT_LE_L(0);

Gotta make sure to use a little endian 0 rather than risk a big-endian one. WTF?

Anyhow ... thanks for the pointer. That fixed my filesystem for me.

-Tony