Can't mount FAT32 drive under Ubuntu Linux

7

I have a 320GB USB drive with a single large FAT32 partition. The volume mounts perfectly fine on my Mac OS X 10.5.8 machine and Disk Utility on the mac reports no issues with the volume. I can read/write all data on the drive.

However when I connect the drive to my Ubuntu 9.10 Karmic system, the partition does not mount. dmesg|tail says:

[ 2752.334822] scsi3 : SCSI emulation for USB Mass Storage devices
[ 2752.335040] usb-storage: device found at 3
[ 2752.335044] usb-storage: waiting for device to settle before scanning
[ 2757.330301] usb-storage: device scan complete
[ 2757.331005] scsi 3:0:0:0: Direct-Access     WD       3200AAK External 1.65 PQ: 0 ANSI: 0
[ 2757.331772] sd 3:0:0:0: Attached scsi generic sg2 type 0
[ 2757.355647] sd 3:0:0:0: [sdb] 625142448 512-byte logical blocks: (320 GB/298 GiB)
[ 2757.360737] sd 3:0:0:0: [sdb] Write Protect is off
[ 2757.360749] sd 3:0:0:0: [sdb] Mode Sense: 00 00 00 00
[ 2757.360755] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 2757.367618] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 2757.367631]  sdb: sdb1
[ 2762.797622] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 2762.797636] sd 3:0:0:0: [sdb] Attached SCSI disk
[ 2822.866228] FAT: bogus number of reserved sectors
[ 2822.866237] VFS: Can't find a valid FAT filesystem on dev sdb1.

When I run fsck.vfat -a /dev/sdb1 I get:

root@cartman:~# fsck.vfat -a /dev/sdb1
dosfsck 3.0.3, 18 May 2009, FAT32, LFN
Logical sector size is zero.

Googling "vfat Logical sector size is zero" produced no consensus as to the solution. I would prefer not to have to completely reformat the disk if possible because it contains about 280GB of data I would rather not have to find a temporary home for. Any suggestions?

Josh

Posted 2010-04-09T14:20:46.633

Reputation: 7 540

Related (but closed as off-topic) on [SO]: How to fix a broken FAT32 partition without losing any data?

– Palec – 2015-01-07T08:41:48.997

Answers

4

For me, fsck.vfat /dev/sdd1 returning "Logical sector size is zero." was because it was not vfat, but rather newer exfat. So I had to install tools appropriate tools (apt-get install exfat-utils exfat-fuse) to be able to mount and fsck it (by using fsck.exfat /dev/sdd1 instead, or even better just fsck /dev/sdd1 and have fsck autodetect the filesystem)

Matija Nalis

Posted 2010-04-09T14:20:46.633

Reputation: 2 107

2

First, I would try to get access to chkdsk.exe if possible and run that on the drive just incase there is a problem with the filesystem and linux is just being much more picky about it.

It seems that fat32 has a backup boot sector at sector 6. You could always try to replace sector 0 with that sector and see if it helps you out, but I would probably try the chkdsk route and see if that helps you out at all.

Chris Disbro

Posted 2010-04-09T14:20:46.633

Reputation: 1 214

2

This has happened a few more times... it seems to be a problem specific to drives formatted as FAT-32 under Mac OS X 10.5. I backed the drives up on my mac and reformatted the drives on lnux using mkfs.vfat and they were then usable. Not an answer to my question, but I wanted to close this, so I'm just posting what I did. (If anyone has any other ideas, answer this question and I'll try them, and accept your answer if it works!)

Josh

Posted 2010-04-09T14:20:46.633

Reputation: 7 540

1

There's so surprisingly few useful info on this error at the web and so much noise that it became quicker to look into the source code for answers.

Logical sector size is written at offset 0x0B of your partition, little-ending, 2-byte size. Normally it should be a multiple of your physical sector size (like 512, 1024, 2048 etc.).

You could dig into the bytes yourself and see how badly it's screwed up (be careful! the last command writes data to the disk):

dd if=/dev/sdb1 bs=512 count=4 > ./part_header
<use your favorite hex editor to explore and fix it>
dd if=./part_header_fixed of=/dev/sdb1 bs=512 count=4

Or use "testdisk" utility.

ogurets

Posted 2010-04-09T14:20:46.633

Reputation: 116

0

Have you tried checking the nls modules?

A good resource is http://www.nslu2-linux.org/wiki/HowTo/MountFATFileSystems.

jneves

Posted 2010-04-09T14:20:46.633

Reputation: 311