[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: VFAT: Very stupid question



On Thu, Oct 21, 2004 at 09:18:17AM +0200, greg wrote:
> I try to mount a VFAT USB key on my Debian/pure64 distro without any
> success:
> 
> root@grodeb:/home/greg\> mount -t vfat /dev/sda1 /media/usb/
> mount: wrong fs type, bad option, bad superblock on /dev/sda1,
>        or too many mounted file systems
> 
> I can mount the key on a ix86 32 bit system.
> I don't think this is an USB problem, because I can mount the key when it's ext2 formated, all
> modules related to USB are loaded etc etc.
> I don't have any VFAT HD partition to make tests.
> I tried with FAT (msdos), same problem.
>  
> So here is my question: is there someone here, who can mount VFAT or
> FAT with the kernel-image-2.6.8-amd64 ?

The problem is that the device used to create the partition table on
that particular USB stick forgot to put the LBA addresses in the table.
IOW: the partition table only contains entries in CHS
(cylinder/head/sector) adresses.

What probably happened is that the device used to create the partition
table and your current kernel have a different idea about the number of
heads, cylinders and sectors of the USB device. It's bogus for USB
sticks and modern hard drives (modern meaning: anything newer than 10
years old or so), but still there for backward compatibility.

To overcome this problem, the partition table also contains the LBA
address of the partition, i.e. the start of the partition in 512 byte
sectors. That's what Linux (and modern Windows versions) use. If there
is no LBA address, the only way to get the offset of the partition is
to guess a CHS for the device and hope it's right. Apparently that
guess was wrong and your mount failed.

The easiest way to fix this is to write a new partition table (and this
time right), "gpart" might be useful to figure out where the partition
is. If you care about your data, be sure to make a backup of the device
before you start: dd if=/dev/sda of=backup .


Erik

-- 
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands



Reply to: