Thursday, September 11, 2008

What is in /etc/fstab?

The file fstab contains descriptive information about the various file systems. It is the duty of the system administrator to properly create and main-tain this file. fstab can be modified by special utils (e.g. fstab-sync). Each filesystem is described on a separate line; fields on each line are separated by tabs or spaces. Lines starting with # are comments. The order of records in fstab is important because fsck, mount, and umount sequentially iterate through fstab doing their thing.

The first field, (fs_spec), describes the block special device or remote filesystem to be mounted.
A block special device node (like /dev/cdrom or /dev/sdb7. For procfs, use proc.

The second field, (fs_file), describes the mount point for the filesystem. For swap partitions, this field should be specified as none.

The third field, (fs_vfstype), describes the type of the filesystem. Linux supports lots of filesystem types, such as adfs, affs, autofs, coda, coher-ent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf,ufs, umsdos, vfat, xenix, xfs, and possibly others.

For the filesystems currently supported by the running kernel, see /proc/filesystems. An entry swap denotes a file or partition to be used for swapping, cf. swapon (8). An entry ignore causes the line to be ignored.This is useful to show disk partitions which are currently unused.

The fourth field describes the mount options associated with the filesystem. By Default, it will be defaults.

The fifth field is used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.

The sixth field is used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.

No comments:

Ansible Playbook to collect uptime of servers

Hi,  This is to explain how we can write a small playbook to collect uptime of all servers in our environment. We can use our own server l...