The basic syntax of fstab entry is :-
[Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]Let us take each term one by one.
- Device : Here we specify the device we want to mount. For eg. HardDisks are generally named as /dev/hda1 or something similar.
- Mount Point : This entry tells the OS about the folder on which your partition or device will be mounted. You should keep all your mounted devices in /mount/the_device_name or /mnt/the_device_name. Again, this in convention not compulsion.
- File System Type : Here you can tell the OS about the type of file system you are going to mount. If you are not sure of the type then try using auto. This will make an attempt to detect the file system type automatically.
For NTFS write ntfs-3g. Other popular file system types are ext3 and swap.
- Options : Fstab supports a lot of options. Some major ones are discussed here.
- ro or rw : This stands for read only or read write type of mounting.
- exec or noexec : This option enables or disables the execution of binaries present in the specified device.
- auto or noauto : If you want the device to get automatically mounted on boot then choose auto otherwise choose noauto.
- user or nouser : Choosing user will enable all the users to mount the device while nouser will make sure that device is monted only by root user.
- defaults : If you find all of this too confusing :) .
- Dump and Pass : These options have a little role to play if your computer does not contain important data. Dump tell the OS to backup the device, if it is setted to 1. 0 disables it.
Pass specifies the order to check file system. Usually 1 is used for root partition and 2 for the other devices. The options are :-
0 == do not check.
1 == check this partition first.
2 == check this partition(s) next
/dev/hda6 /mount/hda6 ntfs-3g defaults 0 0