PDA

View Full Version : Accessing other partitions


jethind
October 31st, 2005, 11:56 AM
I have 2 HDD with several partitions. Is there any way to access other FAT32 or VFAT partitions at my linux Fedora 4 OS? I really new to linux and appreciate your help. thanks.

kage
October 31st, 2005, 06:14 PM
Open a terminal and as root (su -) run 'fdisk -l. It will produce something that looks like:

root# fdisk -l

Disk /dev/hda: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 77545 39082648+ b W95 FAT32

Disk /dev/hdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 24662 198097483+ 83 Linux
/dev/hdb3 24663 24792 1044225 82 Linux swap / Solaris



From that you can see that the master hard drive (/dev/hda) contains the fat partition (FAT32) and the slave drive (/dev/hdb) contains the linux and linux swap partitions.

Now, there are two ways to mount the fat partition, a quick and more temporary way, and then a bit more involved but more permanent way. To quickly mount /dev/hda1, as root (su) run:

#mkdir /mnt/hda1
#mount -t vfat /dev/hda1 /mnt/hda1

When you 'mkdir /mnt/hda1' it can be any directory you want, such as /home/user/windows, just be sure to mount it to the same directory. Now you should be able to read the data mounted in that folder (and it should be everything in your windows partition).

As root you will be able to write to that partition, but as a normal user you will not have write privledges. To allow your normal user account to write to the partition, we'll edit the '/etc/fstab' file. It should look somethinglike this:

/dev/hdb1 / reiserfs defaults,user_xattr 1 1
/dev/proc /proc proc defaults,user_xattr 0 0
/dev/hdb3 swap swap defaults,user_xattr 0 0
/dev/hdc /media/cdrecorder auto user,exec,noauto,managed 0 0


Looking at that you can tell fairly easily what goes where, from the left you have the target device, then the mount point, the filesystem, and the mount options. Now lets add your windows partition. Run (as root) 'gedit /etc/fstab' (or your preferred text editor). You will want to add a line at the bottom of this file like:

/dev/hda1 /mnt/hda1 vfat noauto,user,exec,umask=000 0 0


/dev/hda1 is your windows partition, and /mnt/hda1 is where it will be mounted to (this can be changed to fit whereever you want it mounted to). The 'noauto' option can be changed to 'auto' if you want the partition to automatically be mounted at system boot.

That should be about it. If you need anything else or have any questions feel free to post.

-kage

jethind
November 1st, 2005, 08:51 AM
thanks for the help. Now i can access my files for both windows and linux. thanks again. :wave: