Total six columns are present in FSTAB file. Each column defines or performs a different role. To add or mount new device use new row.
Let’s understand the working of each column.
The first column will define the “Label” of partitions. For eg. “LABEL=/boot” or driver’s path, eg. “/dev/cdrom”. Device driver’s path tells the system to mount the device with the mentioned device driver.
The second column describes the mount point for the filesystem. There is some filesystem should be specified as ‘none’ like swap partition. The mount point is actually a name of the directory where that device is mounted. Using this mount point we can be able to view and modify the content of that partition. You can modify the mount point according to your requirement.
The third column will be used to define the Filesystem type of partition or device. Several no. of filesystems supported by Linux and some of them listed below,
If you are not sure about the filesystem then use “auto” option. “auto” will help to determine the file system and mount the device with that filesystem.
The fourth column is for permissions to be given to the partition at the time of booting. There are many options which constitute the fourth column.
They are as follows : –
1) ro – Read Only
2) rw – Read Write
3) auto – Mount on startup
4) noauto- Do not mount on startup
5) user – Any user can mount, but only unmount device mounted by him
6) nouser- the Only root can mount & unmount the device
7) users – Every user can mount and also unmount the device mounted by others
8) owner – Same as user (above no. 5)
9) dev – User can use device driver to mount the device
10) nodev – User cannot use device driver to mount the device
11) exec – Users can execute binaries on the partition
12) noexec- Users cannot execute binaries on the partition
13) async – Asynchronous, whenever a file is saved it will be first saved in the RAM and after 30 seconds all the queued files will be written on the hard disk
14) sync – Synchronous, whenever a file is saved it will be directly written to the hard disk
15) suid – Allow set-user-identifier for the device where users are allowed to run binaries even though they do not have to execute permissions. These binaries are temporarily made available to them to perform certain tasks
16) nosuid- Do not allow set-user-identifier
17) defaults- auto, rw, dev, async, suid, exec & nouser
This column is used as a backup option. It will contain two values either 0 or 1. Here 0 stands for “no” and 1 stands for “yes”. if option 1 used then system checks are enabled at the time of booting and if 0 used then system checks will be ignored. Backup option supported only ext3 filesystem which means for another filesystem this option should be disabled by default.
6th Column :
6th column is using for “fsck” option. Fsck stands for filesystem check. with this option system will scan the filesystem at time of start up. Here The / partition is assigned top priority i.e. 1 and the rest of the partitions are assigned second priority i.e. 2. If the value is set to 0 means no scanning will be done at the time of startup. If the same number is given to different partitions then the partitions are scanned together with equal priority. This minimizes error because if a link is present on one partition with higher priority and the source file in another partition with a priority lower than the link, it will give an error.
I hope you like the article if you find any difficulties then please do comment your queries or problem via the comment section, till then stay tuned to techthings.org for more such valuable articles.