LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fat partition accessing error due to fstab (https://www.linuxquestions.org/questions/linux-newbie-8/fat-partition-accessing-error-due-to-fstab-437464/)

gregorian 04-21-2006 11:30 AM

fat partition accessing error due to fstab
 
I have Red Hat Linux 9 and Windows XP installed on one computer.I have lots of mp3s on that drive and I want to access it.I know that having fat partition makes things better fro linux.

I tried mounting the partition but it said:
mount: can't find /dev/hda2 in /etc/fstab or /etc/mtab

I read the related posts but cant find a solution.The partition I need to access is hda2.

The other threads required me to post my fstab file so here it is:


LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdb3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

Thanks a lot for your help.

onelung02 04-21-2006 11:38 AM

That error simply means no entry is made in your /etc/fstab for the partition.

First I would make sure that you have kernel support for the file system, then make the following entry in your /etc/fstab

Code:

/dev/hda2  /mnt/fat  vfat umask=0000  0 0
Now, you have to create the mount directory before mounting, which is done by:

Code:

mkdir /mnt/fat
Keep in mind you can make that dir anywhere you want and it can be anything you want, but it has to match with whatever mount point you have in your fstab.

The umask option that I have shown you is for all access to everyone on your system. If you would like different options, look into the umask option.

Now:
Code:

mount /dev/hda2
You should be set. Something worth reading on the subject is found right here:
http://gentoo-wiki.com/HOWTO_Mount_W..._FAT%2CNTFS%29

Have fun,
onelung02

gregorian 04-22-2006 02:09 AM

I did exactly what you said but I get this error message:

mount: wrong fs type, bad option, bad superblock on /dev/hda2,
or too many mounted file systems
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)

Here is my fstab file:

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdb3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hda2 /mnt/windows vfat umask=0000 0 0

Thanks for the help anyway.

pen8wen 04-22-2006 04:03 PM

use
fdisk /dev/hda to see the partition info
type p at the fdisk prompt

hda2 should show up as a dos-ish partition type, eg. FAT32

use q to quit fdisk.

it may be that you will possibly need to add ntfs support if you want to access xp. as of the last time i looked at it, ntfs is read only.

onelung02 04-22-2006 05:41 PM

Maybe switching the VFAT part in your /etc/fstab to auto, try that.

gregorian 04-23-2006 05:06 AM

Yes I tried putting auto but it is no good.

kevkim55 04-23-2006 05:51 AM

Post the output of -->
fdisk -l /dev/hda

gregorian 04-23-2006 07:07 AM

This is the output:

Cannot open /dev/hda

michaelk 04-23-2006 08:02 AM

You must be root to use the fdisk command.
From the error messages hda2 is an extended partition which can not be mounted.

gregorian 04-23-2006 09:50 AM

Here is the output of fdisk -l /dev/hda

Disk /dev/hda: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1218 9783553+ 7 HPFS/NTFS
/dev/hda2 1219 4870 29334690 f Win95 Ext'd (LBA)
/dev/hda5 1219 2436 9783553+ b Win95 FAT32
/dev/hda6 2437 3654 9783553+ 7 HPFS/NTFS
/dev/hda7 3655 4870 9767488+ 7 HPFS/NTFS

P.S.I have Windows XP and not 95 and where is hda3 and hda4?I have my Linux Installed on hdb and what is LBA

I have two hardrives, one containing Windows and the other Linux.The partition I want to access is in Windows and is D drive and I formatted it with Fat for linux compatibility.I assumed it is hda2 since C: drive is hda1.

But after seeing the info above,I have my doubts.

michaelk 04-23-2006 10:39 AM

Partitons 101:
Your d: drive is hda5.

Partitions 1-4 are called primary partitions and when hard drives first were introduced to the PC world this was the max amount you could have.

To overcome this limitation the extended / logical partitions were developed so now you can divide the drive into 64 partitions. A primary partition is designated as an extended partition. Then logical partitions are created within the extended partition. logical partitions have IDs >=5.

Partitions 3 & 4 in your case are not used.

gregorian 04-23-2006 10:51 AM

Thanks a lot guys.My problem is now fixed.I am able to access all the partitions.Thanks for your time.


All times are GMT -5. The time now is 07:52 AM.