Thursday, January 13, 2005

Auto Mount Partition Window

Found a link which teach how to auto mount window partition.
It's come from http://www.linuxcompatible.org/

Here is a small and useful tip. Most of us use linux and windows in a dual boot combination, and sometimes its annoying to mount the windows partitions every time u login to ur linux box.

Remember the first primary partition on first fixed disk is hda1. As most of us never create a secondary, third or fourth primary partition on the same harddisk so there is no hda2, hda3 or hda4. The first logical drive in the extended partition is hda5 (D drive on windows).

For example, in windows if u have partitions like C:,D:,E:
that means your drive C: is hdc1, drive D: is hdc5 and drive E: is hdc6.

So if you want to automount all of your windows partitions in linux when you boot into linux. Just update the /etc/fstab file with the appropriate entries. here is how my /etc/fstab looks after updating it.


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/hda9 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hda1 /mnt/CDrive vfat defaults 0 0
/dev/hda5 /mnt/DDrive vfat defaults 0 0
/dev/hda6 /mnt/EDrive vfat defaults 0 0


Now the last three lines are the new lines i have put in my /etc/fstab. before putting these lines in i created the directories /CDrive,/DDrive and /EDrive in my /mnt/.now everytime i boot up, it automatically mounts my windows drives into the above given directories.

Don't forget that if you're using NTFS on your Windows partitions to put "ntfs" instead of "vfat"... (and make sure the ntfs module is functioning on your kernel... but on most modern distros it's there).