21 November 2007

File format of /etc/fstab in Linux

fstab is a configuration file that contains information of all the partitions and storage devices in your computer.

*File system specifier: For disk-based file systems,either a device file,or a device label specification
*Mount point : Except swap partitions,this field specifies the mount point to be used when the file system is mounted
*File system type : Type of file system present on the specified device
*Mount Options : A comma-separated list of options that can be used to control mount's behaviour
*Dump frequency : If the dump backup utility is used,the number in this field will control dump's handling of the  specified file system
*File system check order: Controls the order in which the file system checker fsck checks the integrity of the file systems.

Mount options common to all filesystems are:
auto/noautoWith the auto option, the device will be mounted automatically (at bootup, or when we issue the mount -a command). auto is the default option. If you don't want the device to be mounted automatically, use the noauto option in /etc/fstab. With noauto, the device can be mounted only explicitly.
dev/nodev
Interpret/do not interpret block special devices on the filesystem.
exec/noexec
exec lets you execute binaries that are on that partition, whereas noexec doesn't let you do that. noexec might be useful for a partition that contains binaries you don't want to execute on your system, or that can't even be executed on your system. This might be the case of a Windows partition.
ro
Mount read-only.
rw
Mount the filesystem read-write.

sync/async
How the input and output to the filesystem should be done. sync means it's done synchronously. If you look at the example fstab, you'll notice that this is the option used with the floppy.,this means that copy a file to the floppy, the changes are physically written to the floppy at the same time you issue the copy command.

suid/nosuid
Permit/Block the operation of suid, and sgid bits.

user/nouser
Permit any user to mount the filesystem. This automatically implies noexec, nosuid,nodev unless overridden. If nouser is specified, only root can mount the filesystem.

defaults
Use default settings. Equivalent to rw,suid,dev,exec,auto,nouser,async.

No comments: