I have been working with linux for a long time but from time to time I come to a very simple concept that I should have already known. I have been reading my old books and I ran across a discussion of /etc/fstab which sparked my interest into better understanding each of the fields in /etc/fstab in linux.
Column Order Field Description
1 Label The file system label identifer or mount point
2 Mount Point location to mount the label
3 Format File system type for the mount identified in 2
4 Mount Options commonly default which is rw can also be: suid, dev, exec, auto, nouser, and async etc..
5 Dump Value If 1 the filesystem is automatically written to disk
6 File system check order File systems that need fsck, root should be 1, other partitions should be 2 and block devices or remote directories should be 0
On the surface this seems to be a simple concept. The most basic example is /dev/hda1 or /dev/sda1 which would be device hard drive a partition 1 (/dev/hda1) or scsi drive a partition 1 (/dev/sda1) but many things can be placed inside this field to identify hard drives. You can use a multitude of options in modern linux. You can use drive labels, device names or UUID’s. Label’s and UUID’s provide the advantage of not possibly changing with a reboot.
The location on the file system where you want to mount the partition.
The filesystem on the partition. Can be mount using fdisk if needed.
There are lots of mount options for different needs.
sync/async All I/O to this file system should be done synchronously or asynchronously
auto Mounted at boot or when mount -a is used.
noauto File system will not automatically mounted at boot time or with mount -a
dev/nodev Interpret/Do not interpret block devices on file system
exec / noexec Allow or deny execution of binaries from file system
suid/nosuid Allow or Deny the use of suid or sgid bits
ro/rw Mount Read Only (ro) or Read Write (rw)
user Allow any user to mount file system
nouser Allow only root to mount the file system
defaults Default settings equals: rw, suid, dev, exec, auto, nouser, async
_netdev Network file system bring up after network is up (only used with nfs)
atime Record latest time when a file is accessed
noatime Do not record latest time when a file is accessed
relatime Update access time if earlier than modification time.
This field is used to denote if the backup program dump is used to backup the file system. A value of 0 means it’s ignored while any number larger denotes how often in days the file system should be dumped. This value is mostly ignored since very few people use dump now. Root should be a 1 while other file systems should be 2 except swap which should be a 0.
Filesystem Check Order
This is the order in which file systems are checked during boot by fsck -p. A setting of 0 is ignored while root should be 1 and everything else a 2 or higher.
© 2009, Joseph Griffiths. All rights reserved.