2005-03-23 21:47:08

by John Richard Moser

[permalink] [raw]
Subject: vfat broken in 2.6.10?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm using Ubuntu Linux Hoary

root@icebox:~# uname -a
Linux icebox 2.6.10-5-686 #1 Tue Mar 15 15:16:01 UTC 2005 i686 GNU/Linux


root@icebox:~# fsck.vfat -r /dev/sda1
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
/\uffffSCK0000.REN
Duplicate directory entry.
First Size 0 bytes, date 19:03:36 Mar 04 1980
Second Size 0 bytes, date 19:00:00 Dec 31 1979
1) Drop first
2) Drop second
3) Rename first
4) Rename second
5) Auto-rename first
6) Auto-rename second
? 5
Renamed to FSCK0000.REN
Perform changes ? (y/n) y
/dev/sda1: 187 files, 167150/246288 clusters
root@icebox:~# fsck.vfat -r /dev/sda1
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
/dev/sda1: 187 files, 167150/246288 clusters

Now the FS is clean.

root@icebox:~# mount /dev/sda1 /media/usbdisk/
root@icebox:~# vim /media/usbdisk/a.txt
root@icebox:~# rm /media/usbdisk/a.txt

Created, deleted a.txt

root@icebox:~# umount /media/usbdisk/
root@icebox:~# fsck.vfat -r /dev/sda1
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
/\uffff.\000a\000.\000t.\000x\000
Bad file name.
1) Drop file
2) Rename file
3) Auto-rename
4) Keep it

Does that say a.txt?

? 1
/\uffffa\000.\000t\000x.\000t\000
Bad file name.
1) Drop file
2) Rename file
3) Auto-rename
4) Keep it
? 1
/\uffff.\000a\000.\000t.\000x\000
Start cluster beyond limit (7798784 > 246289). Truncating file.
/\uffff.\000a\000.\000t.\000x\000
File size is 4294967295 bytes, cluster chain length is 0 bytes.
Truncating file to 0 bytes.
/\uffffa\000.\000t\000x.\000t\000
Start cluster beyond limit (4294901760 > 246289). Truncating file.
/\uffffa\000.\000t\000x.\000t\000
File size is 4294967295 bytes, cluster chain length is 0 bytes.
Truncating file to 0 bytes.
/\uffff.TXT
Contains a free cluster (167160). Assuming EOF.
/\uffff.TXT
File size is 5 bytes, cluster chain length is 0 bytes.
Truncating file to 0 bytes.
Perform changes ? (y/n) y


I didn't pull the disk out at all, or anything. Just umounted and
remounted and made/removed a file. Also. . .


/dev/sda1: 189 files, 167150/246288 clusters
root@icebox:~# fsck.vfat -r /dev/sda1
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
/\uffff.\000a\000.\000t.\000x\000
Bad file name.
1) Drop file
2) Rename file
3) Auto-rename
4) Keep it
? 3
Renamed to FSCK0001.REN
/\uffffa\000.\000t\000x.\000t\000
Bad file name.
1) Drop file
2) Rename file
3) Auto-rename
4) Keep it
? 3
Renamed to FSCK0002.REN
Perform changes ? (y/n) y
/dev/sda1: 191 files, 167150/246288 clusters
root@icebox:~# fsck.vfat -r /dev/sda1
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
/dev/sda1: 191 files, 167150/246288 clusters

It appears dosfsck may not be working quite right. I've taken this into
account, hence the second pass after each fsck. This is either a
dosfsck issue, a usb-storage issue for the PNY compact flash drive, or
an issue with vfat itself.

So either LKML needs to fix the drivers, or Ubuntu needs to upgrade/fix
dosfsck or some patch they've applied to the kernel.

- --
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

Creative brains are a valuable, limited resource. They shouldn't be
wasted on re-inventing the wheel when there are so many fascinating
new problems waiting out there.
-- Eric Steven Raymond
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCQePohDd4aOud5P8RAhxRAJ9ydXWfLZbu0r/B4rY6zhaWScR3rQCfVNMY
lGsqNpIPDIBREqIWGVlQJFo=
=1Nlg
-----END PGP SIGNATURE-----


2005-03-24 00:22:48

by Triffid Hunter

[permalink] [raw]
Subject: Re: vfat broken in 2.6.10?

i've seen the same problems with a fat32 partition image after an unclean shutdown. reading certain files would cause the filesystem to spontaneously become read-only with error messages similar to the ones you list below.

my solution was to copy all the files off, rename the offending directory, and copy the relevant files back. unfortunately i can't remove the "dead" folder, as attempting to remove it sets the filesystem read-only :(

John Richard Moser wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm using Ubuntu Linux Hoary
>
> root@icebox:~# uname -a
> Linux icebox 2.6.10-5-686 #1 Tue Mar 15 15:16:01 UTC 2005 i686 GNU/Linux
>
>
> root@icebox:~# fsck.vfat -r /dev/sda1
> dosfsck 2.10, 22 Sep 2003, FAT32, LFN
> /\uffffSCK0000.REN
> Duplicate directory entry.
> First Size 0 bytes, date 19:03:36 Mar 04 1980
> Second Size 0 bytes, date 19:00:00 Dec 31 1979
> 1) Drop first
> 2) Drop second
> 3) Rename first
> 4) Rename second
> 5) Auto-rename first
> 6) Auto-rename second
> ? 5
> Renamed to FSCK0000.REN
> Perform changes ? (y/n) y
> /dev/sda1: 187 files, 167150/246288 clusters
> root@icebox:~# fsck.vfat -r /dev/sda1
> dosfsck 2.10, 22 Sep 2003, FAT32, LFN
> /dev/sda1: 187 files, 167150/246288 clusters
>
> Now the FS is clean.
>
> root@icebox:~# mount /dev/sda1 /media/usbdisk/
> root@icebox:~# vim /media/usbdisk/a.txt
> root@icebox:~# rm /media/usbdisk/a.txt
>
> Created, deleted a.txt
>
> root@icebox:~# umount /media/usbdisk/
> root@icebox:~# fsck.vfat -r /dev/sda1
> dosfsck 2.10, 22 Sep 2003, FAT32, LFN
> /\uffff.\000a\000.\000t.\000x\000
> Bad file name.
> 1) Drop file
> 2) Rename file
> 3) Auto-rename
> 4) Keep it
>
> Does that say a.txt?
>
> ? 1
> /\uffffa\000.\000t\000x.\000t\000
> Bad file name.
> 1) Drop file
> 2) Rename file
> 3) Auto-rename
> 4) Keep it
> ? 1
> /\uffff.\000a\000.\000t.\000x\000
> Start cluster beyond limit (7798784 > 246289). Truncating file.
> /\uffff.\000a\000.\000t.\000x\000
> File size is 4294967295 bytes, cluster chain length is 0 bytes.
> Truncating file to 0 bytes.
> /\uffffa\000.\000t\000x.\000t\000
> Start cluster beyond limit (4294901760 > 246289). Truncating file.
> /\uffffa\000.\000t\000x.\000t\000
> File size is 4294967295 bytes, cluster chain length is 0 bytes.
> Truncating file to 0 bytes.
> /\uffff.TXT
> Contains a free cluster (167160). Assuming EOF.
> /\uffff.TXT
> File size is 5 bytes, cluster chain length is 0 bytes.
> Truncating file to 0 bytes.
> Perform changes ? (y/n) y
>
>
> I didn't pull the disk out at all, or anything. Just umounted and
> remounted and made/removed a file. Also. . .
>
>
> /dev/sda1: 189 files, 167150/246288 clusters
> root@icebox:~# fsck.vfat -r /dev/sda1
> dosfsck 2.10, 22 Sep 2003, FAT32, LFN
> /\uffff.\000a\000.\000t.\000x\000
> Bad file name.
> 1) Drop file
> 2) Rename file
> 3) Auto-rename
> 4) Keep it
> ? 3
> Renamed to FSCK0001.REN
> /\uffffa\000.\000t\000x.\000t\000
> Bad file name.
> 1) Drop file
> 2) Rename file
> 3) Auto-rename
> 4) Keep it
> ? 3
> Renamed to FSCK0002.REN
> Perform changes ? (y/n) y
> /dev/sda1: 191 files, 167150/246288 clusters
> root@icebox:~# fsck.vfat -r /dev/sda1
> dosfsck 2.10, 22 Sep 2003, FAT32, LFN
> /dev/sda1: 191 files, 167150/246288 clusters
>
> It appears dosfsck may not be working quite right. I've taken this into
> account, hence the second pass after each fsck. This is either a
> dosfsck issue, a usb-storage issue for the PNY compact flash drive, or
> an issue with vfat itself.
>
> So either LKML needs to fix the drivers, or Ubuntu needs to upgrade/fix
> dosfsck or some patch they've applied to the kernel.
>
> - --
> All content of all messages exchanged herein are left in the
> Public Domain, unless otherwise explicitly stated.
>
> Creative brains are a valuable, limited resource. They shouldn't be
> wasted on re-inventing the wheel when there are so many fascinating
> new problems waiting out there.
> -- Eric Steven Raymond
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.5 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFCQePohDd4aOud5P8RAhxRAJ9ydXWfLZbu0r/B4rY6zhaWScR3rQCfVNMY
> lGsqNpIPDIBREqIWGVlQJFo=
> =1Nlg
> -----END PGP SIGNATURE-----
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2005-03-24 03:04:06

by John Richard Moser

[permalink] [raw]
Subject: Re: vfat broken in 2.6.10?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Triffid Hunter wrote:
> i've seen the same problems with a fat32 partition image after an
> unclean shutdown. reading certain files would cause the filesystem to
> spontaneously become read-only with error messages similar to the ones
> you list below.

Clean umount, not unclean. Not even removing the device, no shutdown.
I'm not damaging the filesystem except by actually using it.

It's remniscent of using NTFS with "full read-write" under Linux, where
you have lots of damage afterwards even though you didn't do anything
nasty to damage it.

>
> my solution was to copy all the files off, rename the offending
> directory, and copy the relevant files back. unfortunately i can't
> remove the "dead" folder, as attempting to remove it sets the filesystem
> read-only :(
>

- --
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

Creative brains are a valuable, limited resource. They shouldn't be
wasted on re-inventing the wheel when there are so many fascinating
new problems waiting out there.
-- Eric Steven Raymond
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCQi5AhDd4aOud5P8RAiedAJ40CyoAYYdu1jbSnl1j8J7/iXH2dQCbBuND
uZX0j3qIZe3TYQ2NMMelgks=
=XMEH
-----END PGP SIGNATURE-----

2005-03-24 15:25:44

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: vfat broken in 2.6.10?

John Richard Moser <[email protected]> writes:

> It appears dosfsck may not be working quite right. I've taken this into
> account, hence the second pass after each fsck. This is either a
> dosfsck issue, a usb-storage issue for the PNY compact flash drive, or
> an issue with vfat itself.
>
> So either LKML needs to fix the drivers, or Ubuntu needs to upgrade/fix
> dosfsck or some patch they've applied to the kernel.

Can you try http://user.parknet.co.jp/hirofumi/tmp/fatfsprogs.tar.bz2,
or most recently released dosfstools (2.11 or later)?
--
OGAWA Hirofumi <[email protected]>

2005-03-24 17:24:03

by Gene Heskett

[permalink] [raw]
Subject: Re: vfat broken in 2.6.10?

On Thursday 24 March 2005 10:20, OGAWA Hirofumi wrote:
>John Richard Moser <[email protected]> writes:
>> It appears dosfsck may not be working quite right. I've taken
>> this into account, hence the second pass after each fsck. This is
>> either a dosfsck issue, a usb-storage issue for the PNY compact
>> flash drive, or an issue with vfat itself.
>>
>> So either LKML needs to fix the drivers, or Ubuntu needs to
>> upgrade/fix dosfsck or some patch they've applied to the kernel.
>
>Can you try
> http://user.parknet.co.jp/hirofumi/tmp/fatfsprogs.tar.bz2, or most
> recently released dosfstools (2.11 or later)?

Humm, not available via yum according to yum, and mine is
2.8.something.

Has this not made it to the fc2 repo's yet?

--
Cheers, Gene
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.34% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2005 by Maurice Eugene Heskett, all rights reserved.

2005-03-24 18:50:58

by John Richard Moser

[permalink] [raw]
Subject: Re: vfat broken in 2.6.10?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



OGAWA Hirofumi wrote:
> John Richard Moser <[email protected]> writes:
>
>
>>It appears dosfsck may not be working quite right. I've taken this into
>>account, hence the second pass after each fsck. This is either a
>>dosfsck issue, a usb-storage issue for the PNY compact flash drive, or
>>an issue with vfat itself.
>>
>>So either LKML needs to fix the drivers, or Ubuntu needs to upgrade/fix
>>dosfsck or some patch they've applied to the kernel.
>
>
> Can you try http://user.parknet.co.jp/hirofumi/tmp/fatfsprogs.tar.bz2,
> or most recently released dosfstools (2.11 or later)?

I would really, but I haven't mastered creating debian packages yet; on
Gentoo I just wrote ebuilds whenever I wanted to test something, then
uninstalled it if it broke. Maybe someone else can do it. . . .

- --
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

Creative brains are a valuable, limited resource. They shouldn't be
wasted on re-inventing the wheel when there are so many fascinating
new problems waiting out there.
-- Eric Steven Raymond
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCQwwlhDd4aOud5P8RAvDlAJ9EutR6A5BRF8Ej8JaXiDxNJKFbiwCfX56o
S4wcvdgMldvZjmhoRasFPLk=
=VubT
-----END PGP SIGNATURE-----

2005-03-24 19:14:03

by Bodo Eggert

[permalink] [raw]
Subject: Re: vfat broken in 2.6.10?

John Richard Moser <[email protected]> wrote:

> I would really, but I haven't mastered creating debian packages yet; on
> Gentoo I just wrote ebuilds whenever I wanted to test something, then
> uninstalled it if it broke. Maybe someone else can do it. . . .

http://asic-linux.com.mx/~izto/checkinstall/

2005-03-24 19:41:42

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: vfat broken in 2.6.10?

John Richard Moser <[email protected]> writes:

> I would really, but I haven't mastered creating debian packages yet; on
> Gentoo I just wrote ebuilds whenever I wanted to test something, then
> uninstalled it if it broke. Maybe someone else can do it. . . .

dosfstools is simple, so you don't need to install it....

$ mkdir test
$ cd test
$ wget http://user.parknet.co.jp/hirofumi/tmp/fatfsprogs.tar.bz2
$ tar xjf fatfsprogs.tar.bz2
$ cd fatfsprogs/dosfstools-2.10/
$ make
$ ./dosfsck/dosfsck /dev/test_device
[...]
$ cd ../../..
$ rm -rf test
--
OGAWA Hirofumi <[email protected]>