Fstab
From Linux 101, The beginner's guide to all things Linux.
If there is a device that you are going to access often, you can add it to /etc/fstab so you do not have to tell mount everything it needs to know to mount the device each time.
Each entry in /etc/fstab has this layout:
<device> <mount point> <file system> <options> <dump/pass> /dev/hda3 /home reiserfs noatime 0 0
| <device> | the device, such as /dev/hda1 for the first partition on the first drive, or //<server>/<share> for a Windows shared folder |
| <mount point> | the directory on your system where the device should be mounted |
| <file system> | this may be ext2, ext3 or reiserfs for your local drives, smbfs for a Windows shared folder, or auto for a removeable device |
| <options> | different options, depending on the file system |
| <dump/pass> | options for dump / fsck, see below |
[edit] Allowing users to mount
If you specify user in the options list, users will be able to mount the directory. The user who does so will be recorded in mtab so that only (s)he can unmount it. For example: /dev/cdroms/cdrom0 /mnt/cdrom iso9660 user,noauto,ro 0 0
Some distributions change the owner of devices to match the user of the physical console. In this case, you can specify owner instead of user in the options, which allows only the owner of the device to mount the filesystem. This makes a lot of sense for removeable drives, as it implies that only the person with physical access to the drive can mount and unmount filesystems on the drive.
[edit] auto vs. noauto
If you specify auto in the options list, then when mount -a is run, the filesystem will be mounted. This is typically run by startup scripts when you boot. Removable devices should not be automounted. To effect this, specify the option noauto. Then the filesystem can be mounted only by explicitly specifying it when running mount.
[edit] dump/pass
That first numeric field specifies a priority for dump. Main portions of your filesystem (root, home, etc.) generally have a value of 1 and all others have a value of 0. The second numeric field specifies an order for fsck. The filesystem your root directory is on should have a value of 1, and all other filesystems you want to check should have a value of 2. You want to specify 0 for removable devices and networked filesystems.
See Also: Mounting drives

