Monday, May 19, 2008

Manual Configuration for automounting your ntfs and fat32 partitions

This is a problem I faced earlier when winduhs partitions were not automatically shown to me. I have the bad habit of keeping all songs there and wanted it automatically mounted. I didn't find a comprehensive clear solution anywhere which told me everything the way I wanted it. So I am mentioning it here to help others.
For doing this you shall need to be root.

1. As root run a 'fdisk -l ' to recognise the partition numbers and types. Note these. The listing on my system looks like this:-

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 1274 10233373+ 12 Compaq diagnostics
/dev/sda2 * 1275 5950 37557418+ 6 FAT16
/dev/sda3 5950 10030 32768000 c W95 FAT32 (LBA)
/dev/sda4 10030 17931 63470630 f W95 Ext'd (LBA)
/dev/sda5 10030 14103 32721920 b W95 FAT32
/dev/sda6 14104 15378 10238976 b W95 FAT32
/dev/sda7 15379 15499 971901 82 Linux swap / Solaris
/dev/sda8 15500 17931 19535008+ 83 Linux


The Device boot mentioned in first column is the partition number you want.

2. For all vfat partitions make a new entry in the /etc/fstab file as follows:-

  /dev/sda3       /mnt/f          vfat    users,rw,auto,iocharset=utf8,umask=000        0       0

The above means that the partition /dev/sda3 should be mounted to /mnt/f. It shall be a utf8 charset and shall be accessible to all users. You must make the /mnt/f directory too after making the entry in the file.(Thats 'mkdir /mnt/f' as root in case you didn't know).

3. For the ntfs partitions which you want read write the ntfs-3g driver package must be installed (Debian etch users can get it from backports.org). Once that is done make an entry like this:-

  /dev/sda2       /mnt/c/dev/sda2       /mnt/c          ntfs-3g defaults        0       0

The above means that the ntfs partition /dev/sda2 shall be mounted to /mnt/c.

4. Repeat the same procedure for all the partitions that you have. Make sure that the mounting directories are created by you.

5. After next reboot all ntfs and vfat shall be mounted in r-w for all users! (Ignore the warning about utf8 you get in bootup for vfat. Thats the only charset that works).


6. Incase you have a multiboot with many linux distros where you want another distro's ext3 partition also mounted make a similar entry:-

/dev/sda8 /mnt/g ext3 users,rw,auto,umask=000 0 0

7. Last but not the least if you want to use linux partitions in Winduhs please use the ext2(works for ext3 also) driver from www.fs-driver.org



Hope this helps someone. If you have problems, please comment.

No comments: