Problem mounting FAT32 filesystem

Asked by Chandan Haldar

Ubuntu 7.04 release fails to properly mount some FAT32 filesystems.
I have 2 disks. Disk 1 has a 20GB FAT32 partition with Win2K installed, followed by partitions for Ubuntu. Disk 2 has a 30GB FAT32 partition followed by more partitions for Ubuntu.
Grub works fine.
Win2K boots and works as usual with both the FAT32 file systems (as C: and D:).

Ubuntu boots from the root file system on Disk 1 (/dev/hda2). Everything works fine except mounting the FAT32 partition on Disk 2. The FAT32 partition on Disk 1 is mounted as a vfat file system on /media/hda1 and works as expected under Ubuntu. However, the FAT32 partition on Disk 2 does not.

At boot, dosfsck checks both the FAT32 partitions. For the FAT32 partition on Disk 2, dosfsck complains that the FSINFO sector signature is invalid. It mounts the partition anyway on /media/hdb1 as vfat. However, it shows up as empty with no files or directories in it. No data is lost because rebooting Win2K shows all the content.

I also tried an external 250GB USB harddisk with 2 FAT32 partitions of 125GB each. Ubuntu mounts the first partition properly (/dev/sde1 on /media/sde1), but the second partition (/dev/sde2) shows the same problem behavior as above (apparently mounted but no content).

Before Ubuntu, I tried FreeBSD. There was no problem mounting any of these FAT32 filesystems on FreeBSD.

Is this a known problem and is there a trivial fix? I'll post all the details if needed.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Chandan Haldar
Solved:
Last query:
Last reply:
Revision history for this message
Lars Friedrichs (l-friedrichs) said :
#1

Hi,
try again mounting by hand:
sudo umount /media/hdb1
sudo mount /dev/hdb1 /media/hdb1

and give the full error messages if any.

Bye
Lars

Revision history for this message
Chandan Haldar (chandan-ieee) said :
#2

Hi Lars,
Thanks for your suggestion. Tried hand mounting. No error message. But same result: no content. Here is df output post hand mounting:

root@hokusai:/tmp# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 1968620 308016 1560600 17% /
varrun 387868 100 387768 1% /var/run
varlock 387868 0 387868 0% /var/lock
procbususb 387868 152 387716 1% /proc/bus/usb
udev 387868 152 387716 1% /dev
devshm 387868 0 387868 0% /dev/shm
lrm 387868 33788 354080 9% /lib/modules/2.6.20-16-generic/volatile
/dev/hdb4 39286220 4007308 33283240 11% /home
/dev/hda1 19525456 17316928 2208528 89% /media/hda1
/dev/hda5 980308 17684 912828 2% /tmp
/dev/hda6 5692404 1845924 3557312 35% /usr
/dev/hdb3 1968620 329108 1539508 18% /var
/dev/hdb1 35229920 576 35229344 1% /media/hdb1

Note the 576 bytes used in /dev/hdb1. In reality, /dev/hdb1 contains almost 30GB of data.
Here's the output of mount (I mounted the vfat filesystems "ro" to minimize chances of data loss until I figure out what's happening):

root@hokusai:/tmp# mount
/dev/hda2 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.20-16-generic/volatile type tmpfs (rw)
/dev/hdb4 on /home type ext3 (rw)
/dev/hda1 on /media/hda1 type vfat (ro,utf8,umask=007,gid=46)
/dev/hda5 on /tmp type ext3 (rw)
/dev/hda6 on /usr type ext3 (rw)
/dev/hdb3 on /var type ext3 (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/hdb1 on /media/hdb1 type vfat (ro)

Now here is dosfsck output on the unmounted /dev/hdb1:

root@hokusai:/# dosfsck -nv /dev/hdb1
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking we can access the last sector of the filesystem
No FSINFO sector
  Not automatically creating it.
Boot sector contents:
System ID "MSWIN4.1"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
     32768 bytes per cluster
        32 reserved sectors
First FAT starts at byte 16384 (sector 32)
         2 FATs, 32 bit entries
   4404224 bytes per FAT (= 8602 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 8824832 (sector 17236)
   1100935 data clusters (36075438080 bytes)
63 sectors/track, 255 heads
        63 hidden sectors
  70477092 sectors total
Checking for unused clusters.
/dev/hdb1: 28286 files, 938819/1100935 clusters

Note that dosfsck can see the data in the partition. I'm guessing that the "No FSINFO sector" message indicates something relevant to my problem. Did some searches. Lots of info on FAT32 layout, FSINFO sector, etc., but none (that I can comprehend) on how to eliminate this problem. As I mentioned, FreeBSD mounts this partition correctly.

Any clue will be greatly appreciated.

Chandan

Revision history for this message
Justin Payne (neolithium82) said :
#3

There's some information here, about mounting FAT32 partitions, that could be some help, perhaps?
http://www.psychocats.net/ubuntu/mountwindows#fat32

Justin

Revision history for this message
Chandan Haldar (chandan-ieee) said :
#4

I just discovered that the file system is readable after mounting /dev/hdb1 even though df lists the data size as only 576 Kbytes. Not sure if I can take the chance of trying to mount it "rw" and check if writing corrupts existing data or not :-(.

What is causing dosfsck to declare the "No FSINFO sector" message and why df insists that the filesystem contains only 576 KB data?

Here are the fdisk outputs btw:

root@hokusai:/tmp# fdisk -l /dev/hda

Disk /dev/hda: 30.0 GB, 30020272128 bytes
16 heads, 63 sectors/track, 58168 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot Start End Blocks Id System
/dev/hda1 * 1 38760 19535008+ c W95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary.
/dev/hda2 38761 42729 2000092+ 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/hda3 42729 44705 996030 82 Linux swap / Solaris
Partition 3 does not end on cylinder boundary.
/dev/hda4 44705 58156 6779430 5 Extended
Partition 4 does not end on cylinder boundary.
/dev/hda5 44705 46681 995998+ 83 Linux
/dev/hda6 46682 58156 5783368+ 83 Linux
root@hokusai:/tmp# fdisk -l /dev/hdb

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/hdb1 1 4387 35238546 c W95 FAT32 (LBA)
/dev/hdb2 4388 4511 996030 82 Linux swap / Solaris
/dev/hdb3 4512 4760 2000092+ 83 Linux
/dev/hdb4 4761 9729 39913492+ 83 Linux
root@hokusai:/tmp#

Thanks.

Chandan

Revision history for this message
Justin Payne (neolithium82) said :
#5

Are you able to see anything with:
sudo mount -t vfat /dev/hdb1 /media/hdb1

I saw you tried mounting though, maybe specifying it, would work better.

Revision history for this message
Best Chandan Haldar (chandan-ieee) said :
#6

I finally solved the problem of "No FSINFO sector" by deleting and recreating the concerned partitions using the Windows 2000 Disk Manager (but without formatting the new partitions) and then reformatting the new partitions afresh as FAT32 using GParted under Ubuntu. Obviously I backed up the contents under Windows and restored the contents after formatting. Now these FAT32 partitions show up and work correctly under both Windows 2000 and Ubuntu with all their content. As far as I can see, the old partitions with the missing FSINFO sector were created as such by either partitionmagic or some old MS fdisk that didn't bother to create the FSINFO sector correctly. It also looks as if Windows 2000 or XP don't need the FSINFO sector on a partition.

Revision history for this message
Endolith (endolith) said :
#7

Regular fsck gives you the option of creating a FSINFO sector. Would that have fixed it instead of redoing the entire partition?