|
fstab file format or syntax in linux What is fstab file? Sample fstab file looks like this # Note that this system has two IDE partitions, one which is used as /, and the other used as /home. It also has two DOS partitions which are mounted under /mnt. Note the user option provided for the cdrom, and the floppy drive. This is one of the many default parameters you can specify. In this case it means that any user can mount a cdrom, or floppy disk. Other options will be dealt with later. fstab file format explination fstab consists of a number of lines (one for each filesystem) seperated into six fields. Each field is seperated from the next by whitespace (spaces/tabs). /dev/hdc /mnt/cdrom iso9660 noauto,ro,user 0 0 If zero then fsck won't check the filesystem. (as the example line above is a cdrom there is very little point in doing a fsck on it, so the value is zero). File system mount options As the filesystems in /etc/fstab will eventually be mounted using mount(8) it isn't surprising that the options field simply contains a comma-seperated list of options which will be passed directly to mount when it tries to mount the filesystem. All I/O to the file system should be done (a)synchronously. auto The filesystem can be mounted automatically (at bootup, or when mount is passed the -a option). This is really unnecessary as this is the default action of mount -a anyway. noauto The filesystem will NOT be automatically mounted at startup, or when mount passed -a. You must explicitly mount the filesystem. dev / nodev Permit any user to mount the filesyste. This automatically implies noexec, exec / noexec Permit/Prevent the execution of binaries from the filesystem. suid / nosuid Permit/Block the operation of suid, and sgid bits. ro Mount read-only. rw Mount read-write. user Permit any user to mount the filesystem. This automatically implies noexec, nosuid,nodev unless overridden. nouser Only permit root to mount the filesystem. This is also a default setting. defaults Use default settings. Equivalent to rw,suid,dev,exec,auto,nouser,async. There are numerous options for the specific filesystes supported by mount. ext2 check={none, normal, strict} debug print debugging info on each remount. sb=n n is the block which should be used as the superblock for the fs. fat check={r[elaxed], n[ormal], s[trict]} Not the same as ext2. Rather deals with allowed filenames. See mount man page. conv={b[inary], t[ext], a[uto]} Performs DOS<->UNIX text file conversions automatically. See mount man page. uid=n, gid=n iso9660 norock Disables Rock Ridge extensions. fstab file Supported file systems list If you want more details see mount man page If you want to know how to mount NFS in fstab file click here and this will explain how to setup NFS server. If you want more details about fstab file see the fstab man page. |