LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mounting w95 fat32? (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-w95-fat32-592157/)

lilili 10-16-2007 02:50 AM

mounting w95 fat32?
 
Hi everybody
When I do fdisk /dev/hda, I get this
Device Boot Start End Blocks Id System
/dev/hda1 1 2048 16450528+ 82 Linux swap
/dev/hda2 * 2049 7029 40009882+ 83 Linux
/dev/hda3 7030 19457 99827910 b W95 FAT32

but when I try mount -t vfat /dev/hda3 /mnt
It complains
mount: wrong fs type, bad option, bad superblock on /dev/hda3,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

doing dmesg|tail , I get
NTFS-fs error (device hda3): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
NTFS-fs error (device hda3): ntfs_fill_super(): Not an NTFS volume.
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev hda3.
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev hda3.
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev hda3.
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev hda3.

Can anybody show me how to mount /dev/hda3?

Thank you

jschiwal 10-16-2007 03:29 AM

First of all, do you know how the filesystem was created? Is it actually fat32?
You can check with "sudo file -s /dev/hda3". It is possible the the byte that identifies it is wrong for one reason or another. The error displayed is pretty generic, but checking if the filesystem needs repair, with fsck.vfat, might be worthwhile. If you just repartitioned your system, you will also want to reboot. However this doesn't seem to be the situation here.

For the fat32 filesystem, you also want to use the uid, fmask and dmask options. The first will make you the owner of the mounted filesystem, and the latter two will determine the permissions. These won't help you now until you can mount it successfully.

lilili 10-16-2007 03:44 AM

this is what I get when doing file -s /dev/hda3
/dev/hda3: data

This is what I get doing fsck /dev/hda3.
fsck /dev/hda3
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Couldn't find ext2 superblock, trying backup blocks...
/sbin/e2fsck: Bad magic number in super-block while trying to open /dev/hda3

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

This is what I get using dosfsck /dev/hda3
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Logical sector size is zero.


This is how my hda looks like
/dev/hda1 is swap
/dev/hda2 is my linux
/dev/hda3 is empty

Since I can not mount hda3, I am thinking can I just do fdisk /dev/hda
and do delete partition hda3, then create it again with linux (type 83) without putting my /dev/hda2 in danger?

Thank you

jschiwal 10-16-2007 04:21 AM

Quote:

this is what I get when doing file -s /dev/hda3
/dev/hda3: data

This is what I get doing fsck /dev/hda3.
fsck /dev/hda3
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Couldn't find ext2 superblock, trying backup blocks...
/sbin/e2fsck: Bad magic number in super-block while trying to open /dev/hda3
Did you run "file -s /dev/hda3" as root? A regular user doesn't have read permission on a device. Was a filesystem created on this partition? It may have been partitioned but not formatted.

My suggestion was to use "fsck.vfat" (or the equivalent "fsck -t vfat") to check the partition. You used the option for an ext3 partition.
However, it looks like that is what the dosfsck program does.

saikee 10-16-2007 04:30 AM

One can only mount a partition after it has been formatted.

In mounting a partition, which is a block device, the kernel has to read its filing system. No format=no filing system inside.

The partition id of b is just a byte in the 16-byte partition table indicating the partition has been created for a fat32 partition.

The hda3 will immediately mountable after this command has been issued in root console
Code:

mkdosfs -F32 /dev/hda3
It is my suspicion that the partition is unformatted as Post #3 confirms it is empty.

lilili 10-17-2007 02:11 AM

Thank you
mkdosfs -F32 /dev/hda3 does the trick

Yoohooo, learn something new everyday


All times are GMT -5. The time now is 06:53 AM.