Sunday, February 21, 2010

Auto-mounting partitions & samba shares at start-up

For windows users, this may be quite frustrating for mounting partitions every time they start their OS.

For auto-mounting, you need to edit /etc/fstab file. If you add a partition in /etc/fstab file, that partition will be auto-mounted.

# <file system> <mount point> <type> <options> <dump> <pass>
This line which is already present in the /etc/fstab file tell the format.
<file system>  --> the partition to mount for ex. /dev/sda4 or //
<mount point>  --> An empty folder where you want to mount the partition
<type> --> file system type for ex. ntfs-3g, smbfs etc..
<options>  --> additions options. You can simply put it "default".
<dump> --> an appropriate number which decides whether to backup the partition
<pass>--> 0 in most cases

So, for mounting an ntfs partition, we will write something like this:-

/dev/sda5 /media/Abhijeet ntfs-3g defaults,locale=en_IN 0 0
For mounting a samba(windows) share, add:-

// /home/shadyabhi/Lecture smbfs username=user,password=pass 0 0
Here is a sample of the /etc/fstab file i use...

No comments:

Post a Comment