All of lore.kernel.org
 help / color / mirror / Atom feed
* *FAT problem in 2.6.0-test8
@ 2003-10-24 10:32 Vid Strpic
  2003-10-24 18:59 ` Andries Brouwer
  0 siblings, 1 reply; 9+ messages in thread
From: Vid Strpic @ 2003-10-24 10:32 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]

Hi...


Yesterday, I just wanted to download some pics from a Smartmedia card
from my camera.  I put the card into the reader (USB Mass Storage Flash
Card Reader, Manufacturer: EZ, Serial Number: 9876543210ABCDEF, driver
is usb-storage and working well now, I had problems earlier), but the
kernel doesn't recognize FAT filesystem on the card...

Oct 23 17:19:45 moria kernel: VFS: Can't find a valid FAT filesystem on dev sda1.
Oct 23 17:28:20 moria kernel: VFS: Can't find a valid FAT filesystem on dev loop0.

The second line was, I dd-ed the card onto a disk file and tried to
mount that... no luck.

More messages:

Oct 23 17:19:01 moria kernel: FAT: invalid first entry of FAT (0xff8 != 0x0)


Luckily, I have a 2.4 machine around, I tried to mount the resulting
disk image (NFS) on that machine (-o loop ofcourse), and it worked
perfectly... kernel is 2.4.22.

On 2.6 machine, modules loaded were fat and vfat... fstab entry in
question is:

/dev/sda1          /mnt/sm      vfat        user,noauto,owner,rw   1 1


And yes, I tried mounting the filesystem in question as fat _and_
vfat... nothing works.

Not that I need FAT filesystems so very much, but I need them here and
there, and it would be a very NOT nice thing not to have drivers working
:(

Any ideas what's wrong?

-- 
           vms@bofhlet.net, IRC:*@Martin, /bin/zsh. C|N>K
Linux moria 2.6.0-test8 #1 Mon Oct 20 16:19:20 CEST 2003 i686
 12:24:38 up 11:10,  1 user,  load average: 0.74, 0.33, 0.25

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: *FAT problem in 2.6.0-test8
  2003-10-24 10:32 *FAT problem in 2.6.0-test8 Vid Strpic
@ 2003-10-24 18:59 ` Andries Brouwer
  2003-10-25 10:18   ` OGAWA Hirofumi
  0 siblings, 1 reply; 9+ messages in thread
From: Andries Brouwer @ 2003-10-24 18:59 UTC (permalink / raw)
  To: Vid Strpic, linux-kernel

On Fri, Oct 24, 2003 at 12:32:26PM +0200, Vid Strpic wrote:

> Yesterday, I just wanted to download some pics from a Smartmedia card
> from my camera.  I put the card into the reader (USB Mass Storage Flash
> Card Reader, Manufacturer: EZ, Serial Number: 9876543210ABCDEF, driver
> is usb-storage and working well now, I had problems earlier), but the
> kernel doesn't recognize FAT filesystem on the card...
> 
> Oct 23 17:19:01 moria kernel: FAT: invalid first entry of FAT (0xff8 != 0x0)
> 
> Luckily, I have a 2.4 machine around, I tried to mount the resulting
> disk image (NFS) on that machine (-o loop ofcourse), and it worked
> perfectly... kernel is 2.4.22.
> 
> Any ideas what's wrong?

Go to linux/fs/fat, edit inode.c, comment the bit

        if (FAT_FIRST_ENT(sb, media) != first
            && (media != 0xf8 || FAT_FIRST_ENT(sb, 0xfe) != first)) {
                if (!silent) {
                        printk(KERN_ERR "FAT: invalid first entry of FAT "
                               "(0x%x != 0x%x)\n",
                               FAT_FIRST_ENT(sb, media), first);
                }
                goto out_invalid;
        }

out by putting #if 0 ... #endif around it.

How was this card formatted?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: *FAT problem in 2.6.0-test8
  2003-10-24 18:59 ` Andries Brouwer
@ 2003-10-25 10:18   ` OGAWA Hirofumi
  2003-10-25 10:55     ` Vid Strpic
  2003-10-25 11:05     ` Andries Brouwer
  0 siblings, 2 replies; 9+ messages in thread
From: OGAWA Hirofumi @ 2003-10-25 10:18 UTC (permalink / raw)
  To: Vid Strpic; +Cc: Andries Brouwer, linux-kernel

Andries Brouwer <aebr@win.tue.nl> writes:

> On Fri, Oct 24, 2003 at 12:32:26PM +0200, Vid Strpic wrote:
> 
> > Yesterday, I just wanted to download some pics from a Smartmedia card
> > from my camera.  I put the card into the reader (USB Mass Storage Flash
> > Card Reader, Manufacturer: EZ, Serial Number: 9876543210ABCDEF, driver
> > is usb-storage and working well now, I had problems earlier), but the
> > kernel doesn't recognize FAT filesystem on the card...
> > 
> > Oct 23 17:19:01 moria kernel: FAT: invalid first entry of FAT (0xff8 != 0x0)

[...]

> How was this card formatted?

It looks like it doesn't conform to Microsoft's or SmartMedia's
specifications.

Yes. It will be important to know how it was formated. 
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: *FAT problem in 2.6.0-test8
  2003-10-25 10:18   ` OGAWA Hirofumi
@ 2003-10-25 10:55     ` Vid Strpic
  2003-10-25 16:43       ` OGAWA Hirofumi
  2003-10-25 11:05     ` Andries Brouwer
  1 sibling, 1 reply; 9+ messages in thread
From: Vid Strpic @ 2003-10-25 10:55 UTC (permalink / raw)
  To: OGAWA Hirofumi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2167 bytes --]

On Sat, Oct 25, 2003 at 07:18:03PM +0900, OGAWA Hirofumi wrote:
> Andries Brouwer <aebr@win.tue.nl> writes:
> > On Fri, Oct 24, 2003 at 12:32:26PM +0200, Vid Strpic wrote:
> > > Yesterday, I just wanted to download some pics from a Smartmedia
> > > card from my camera.  I put the card into the reader (USB Mass
> > > Storage Flash Card Reader, Manufacturer: EZ, Serial Number:
> > > 9876543210ABCDEF, driver is usb-storage and working well now, I
> > > had problems earlier), but the kernel doesn't recognize FAT
> > > filesystem on the card...
> > > Oct 23 17:19:01 moria kernel: FAT: invalid first entry of FAT
> > > (0xff8 != 0x0)
> > How was this card formatted?
> It looks like it doesn't conform to Microsoft's or SmartMedia's
> specifications.
> Yes. It will be important to know how it was formated. 

Well, I really don't know if it was formatted when I bought it, 2 years
ago.  What puzzles me, is that 2.4 mounts it normally...

This is the hex dump of begginning (problematic no-name 64Mb card):

0000000: e900 002a 6453 777c 4948 4300 0220 0100  ...*dSw|IHC.. ..
0000010: 0200 0100 00f8 0c00 2000 0800 3700 0000  ........ ...7...
0000020: c9f3 0100 0000 0000 0000 0000 0000 0000  ................
0000030: 0000 0000 0000 4641 5431 3220 2020 0000  ......FAT12   ..
0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................

And this is the SanDisk 32Mb card which mounts normally under 2.6:

0000000: e900 0020 2020 2020 2020 2000 0220 0100  ...        .. ..
0000010: 0200 01dd f9f8 0600 1000 0800 2300 0000  ............#...
0000020: 0000 0000 0000 2900 0000 004e 4f20 4e41  ......)....NO NA
0000030: 4d45 2020 2020 4641 5431 3220 2020 0000  ME    FAT12   ..
0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................


Maybe I should try to reformat the card in the reader?  My camera has
'delete all images' but no 'format card' I'm sorry...

-- 
           vms@bofhlet.net, IRC:*@Martin, /bin/zsh. C|N>K
Linux moria 2.6.0-test8 #1 Mon Oct 20 16:19:20 CEST 2003 i686
 12:52:51 up 19:36,  1 user,  load average: 0.14, 0.25, 0.18
Moderna algebra je kad u 4 ujutro vadis korijen iz nepoznate.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: *FAT problem in 2.6.0-test8
  2003-10-25 10:18   ` OGAWA Hirofumi
  2003-10-25 10:55     ` Vid Strpic
@ 2003-10-25 11:05     ` Andries Brouwer
  2003-10-25 18:43       ` OGAWA Hirofumi
  1 sibling, 1 reply; 9+ messages in thread
From: Andries Brouwer @ 2003-10-25 11:05 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: Vid Strpic, linux-kernel

On Sat, Oct 25, 2003 at 07:18:03PM +0900, OGAWA Hirofumi wrote:

> It looks like it doesn't conform to Microsoft's or SmartMedia's
> specifications.
> 
> Yes. It will be important to know how it was formated. 

Yesterday I wondered whether I should propose a patch,
say something like

--- /linux/2.6/linux-2.6.0test6/linux/fs/fat/inode.c    Sat Aug  9 22:16:54 2003
+++ ./inode.c   Sat Oct 25 00:04:18 2003
@@ -931,13 +931,17 @@
                error = first;
                goto out_fail;
        }
-       if (FAT_FIRST_ENT(sb, media) != first
-           && (media != 0xf8 || FAT_FIRST_ENT(sb, 0xfe) != first)) {
-               if (!silent) {
+       if (FAT_FIRST_ENT(sb, media) == first) {
+               /* all is as it should be */
+       } else if (media == 0xf8 && FAT_FIRST_ENT(sb, 0xfe) == first) {
+               /* bad, reported on pc9800 */
+       } else if (first == 0) {
+               /* bad, reported once with a SmartMedia card */
+       } else {
+               if (!silent)
                        printk(KERN_ERR "FAT: invalid first entry of FAT "
                               "(0x%x != 0x%x)\n",
                               FAT_FIRST_ENT(sb, media), first);
-               }
                goto out_invalid;
        }
 
but maybe a single report does not suffice. It would be good to confirm
that certain devices write 0 there. (I would have asked the reporter
to do "dd if=/dev/zero of=/dev/something" and reinsert the card into
the camera, but fiddling with smartmedia cards is a bit dangerous -
not all readers and not all cameras are able to recover from such a
situation, so the card might become unusable without access to other
readers or other cameras.)

Andries

[BTW - Does anyone have more information about this other nonstandard
value, apparently found on pc9800?]


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: *FAT problem in 2.6.0-test8
  2003-10-25 10:55     ` Vid Strpic
@ 2003-10-25 16:43       ` OGAWA Hirofumi
  2003-10-25 17:41         ` Vid Strpic
  0 siblings, 1 reply; 9+ messages in thread
From: OGAWA Hirofumi @ 2003-10-25 16:43 UTC (permalink / raw)
  To: Vid Strpic; +Cc: linux-kernel

Vid Strpic <vms@bofhlet.net> writes:

> > It looks like it doesn't conform to Microsoft's or SmartMedia's
> > specifications.
> > Yes. It will be important to know how it was formated. 
> 
> Well, I really don't know if it was formatted when I bought it, 2 years
> ago.  What puzzles me, is that 2.4 mounts it normally...

Yes, 2.4 doesn't check it field.

> This is the hex dump of begginning (problematic no-name 64Mb card):
> 
> 0000000: e900 002a 6453 777c 4948 4300 0220 0100  ...*dSw|IHC.. ..
> 0000010: 0200 0100 00f8 0c00 2000 0800 3700 0000  ........ ...7...
> 0000020: c9f3 0100 0000 0000 0000 0000 0000 0000  ................
> 0000030: 0000 0000 0000 4641 5431 3220 2020 0000  ......FAT12   ..
> 0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
> 
> And this is the SanDisk 32Mb card which mounts normally under 2.6:
> 
> 0000000: e900 0020 2020 2020 2020 2000 0220 0100  ...        .. ..
> 0000010: 0200 01dd f9f8 0600 1000 0800 2300 0000  ............#...
> 0000020: 0000 0000 0000 2900 0000 004e 4f20 4e41  ......)....NO NA
> 0000030: 4d45 2020 2020 4641 5431 3220 2020 0000  ME    FAT12   ..
> 0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................

On these FAT formats, the target field should be offset 512. 

> Maybe I should try to reformat the card in the reader?  My camera has
> 'delete all images' but no 'format card' I'm sorry...

Um.. Could you please test to reformat? Of course, do it after backup
the your disk image.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: *FAT problem in 2.6.0-test8
  2003-10-25 16:43       ` OGAWA Hirofumi
@ 2003-10-25 17:41         ` Vid Strpic
  2003-10-25 18:32           ` OGAWA Hirofumi
  0 siblings, 1 reply; 9+ messages in thread
From: Vid Strpic @ 2003-10-25 17:41 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2219 bytes --]

On Sun, Oct 26, 2003 at 01:43:43AM +0900, OGAWA Hirofumi wrote:
> Vid Strpic <vms@bofhlet.net> writes:
> > > It looks like it doesn't conform to Microsoft's or SmartMedia's
> > > specifications.
> > > Yes. It will be important to know how it was formated. 
> > Well, I really don't know if it was formatted when I bought it, 2 years
> > ago.  What puzzles me, is that 2.4 mounts it normally...
> Yes, 2.4 doesn't check it field.

Obviously.  I compared the drivers 2.4.22 -> test8, and diff -u is about
1000 lines, a lot.

> > This is the hex dump of begginning (problematic no-name 64Mb card):
> > 0000000: e900 002a 6453 777c 4948 4300 0220 0100  ...*dSw|IHC.. ..
> > 0000010: 0200 0100 00f8 0c00 2000 0800 3700 0000  ........ ...7...
> > 0000020: c9f3 0100 0000 0000 0000 0000 0000 0000  ................
> > 0000030: 0000 0000 0000 4641 5431 3220 2020 0000  ......FAT12   ..
> > 0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
> > And this is the SanDisk 32Mb card which mounts normally under 2.6:
> > 0000000: e900 0020 2020 2020 2020 2000 0220 0100  ...        .. ..
> > 0000010: 0200 01dd f9f8 0600 1000 0800 2300 0000  ............#...
> > 0000020: 0000 0000 0000 2900 0000 004e 4f20 4e41  ......)....NO NA
> > 0000030: 4d45 2020 2020 4641 5431 3220 2020 0000  ME    FAT12   ..
> > 0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
> On these FAT formats, the target field should be offset 512. 

Hm.

> > Maybe I should try to reformat the card in the reader?  My camera has
> > 'delete all images' but no 'format card' I'm sorry...
> Um.. Could you please test to reformat? Of course, do it after backup
> the your disk image.

Backups were done yesterday, I'm on the backup-freak side ;)

Just reformatted, it works - used mkdosfs -F 12 -v /dev/sda1, camera
reads the card and can write picture on it...

Reformatted card now can be mounted by standard fat.ko ...

-- 
           vms@bofhlet.net, IRC:*@Martin, /bin/zsh. C|N>K
Linux moria 2.6.0-test8 #1 Mon Oct 20 16:19:20 CEST 2003 i686
 19:30:50 up 1 day,  2:14,  1 user,  load average: 0.97, 1.51, 0.87
Najkraci C program se sastoji od osam znakova: main(){} (C)Hrv, 2002.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: *FAT problem in 2.6.0-test8
  2003-10-25 17:41         ` Vid Strpic
@ 2003-10-25 18:32           ` OGAWA Hirofumi
  0 siblings, 0 replies; 9+ messages in thread
From: OGAWA Hirofumi @ 2003-10-25 18:32 UTC (permalink / raw)
  To: Vid Strpic; +Cc: linux-kernel

Vid Strpic <vms@bofhlet.net> writes:

> > > Maybe I should try to reformat the card in the reader?  My camera has
> > > 'delete all images' but no 'format card' I'm sorry...
> > Um.. Could you please test to reformat? Of course, do it after backup
> > the your disk image.
> 
> Backups were done yesterday, I'm on the backup-freak side ;)
> 
> Just reformatted, it works - used mkdosfs -F 12 -v /dev/sda1, camera
> reads the card and can write picture on it...
> 
> Reformatted card now can be mounted by standard fat.ko ...

Ok. Your camera isn't buggy, but your SmartMedia's card had the bad
format. (Unfortunately, it sounds like reason is unknown... Some
SmartMedia may have this bad format.)

Thanks for testing it. 
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: *FAT problem in 2.6.0-test8
  2003-10-25 11:05     ` Andries Brouwer
@ 2003-10-25 18:43       ` OGAWA Hirofumi
  0 siblings, 0 replies; 9+ messages in thread
From: OGAWA Hirofumi @ 2003-10-25 18:43 UTC (permalink / raw)
  To: Andries Brouwer; +Cc: Vid Strpic, linux-kernel

Andries Brouwer <aebr@win.tue.nl> writes:

> [BTW - Does anyone have more information about this other nonstandard
> value, apparently found on pc9800?]

IIRC, it seems it was used by DOS of PC98 series.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-10-25 18:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-24 10:32 *FAT problem in 2.6.0-test8 Vid Strpic
2003-10-24 18:59 ` Andries Brouwer
2003-10-25 10:18   ` OGAWA Hirofumi
2003-10-25 10:55     ` Vid Strpic
2003-10-25 16:43       ` OGAWA Hirofumi
2003-10-25 17:41         ` Vid Strpic
2003-10-25 18:32           ` OGAWA Hirofumi
2003-10-25 11:05     ` Andries Brouwer
2003-10-25 18:43       ` OGAWA Hirofumi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.