This blog has moved! Redirecting...
You should be automatically redirected. If not, visit http://scrolls.mafgani.net/ and update your bookmarks.

Saturday, March 25, 2006

Mounting fat32 partition/hard disk

I found this easy method somewhere online:

First find out what the partition is labelled as by performing fdisk -l


[root@localhost /]# fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20972826 7 HPFS/NTFS
/dev/sda2 2612 3886 10241437+ 83 Linux
/dev/sda3 3887 5161 10241437+ 83 Linux
/dev/sda4 5162 14593 75762540 5 Extended
/dev/sda5 5162 8221 24579418+ b W95 FAT32
/dev/sda6 8222 11281 24579418+ b W95 FAT32
/dev/sda7 11282 14593 26603608+ b W95 FAT32


So sda5, 6 and 7 are my fat32 partitions. I need to mount those so that I can make use of them. The following method also mounts them at reboot so you only need to do this once.

Open /etc/fstab in any convenient editor.

In my case, I had to append the following at the end of the file:

/dev/sda5 /mnt/academics vfat users,owner,rw,umask=000 0 0
/dev/sda6 /mnt/media vfat users,owner,rw,umask=000 0 0
/dev/sda7 /mnt/storage vfat users,owner,rw,umask=000 0 0


This gives all users read/write access to the three paritions. I decided to name them academics, media and storage. If you want only read access and no write access, change the "rw" to "ro".

Save the fstab file.

Next, you would like to create mount points for these partitions. I decided to have them under "/mnt". So:


[root@localhost /]# mkdir /mnt/academics
[root@localhost /]# mkdir /mnt/media
[root@localhost /]# mkdir /mnt/storage


And finally, automount:

[root@localhost /]# mount -a


The drives should be accessible now. Furthermore, they stay accessible after reboot. Enjoy.

1 Comments:

Blogger android said...

Pretty good stuff. Actually had to mount my hard disk the other day to recover the data on it. During the process my flatmate - a Linux geek - did all the "coding". Afterward, we wanted to print out the commands he had used, so I could have them handy for next time. Unfortunately, there was something screwed up with his history and we only had the last 8 commands, which was pretty much useless.

This method also seems a lot simpler. Thanks!

12:50 PM  

Post a Comment

<< Home