Tuesday, September 6, 2011

Linux File System Table

The Linux /etc/fstab is a configuration file that contains information of all the partitions and storage devices in your computer. The Linux /etc/fstab contains information of where your partitions and storage devices should be mounted and how.

The following contents lists a sample Linux /etc/fstab file

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0

Additional entries are "devpts", "/proc", "tmpfs", "sysfs"

• The devpts file system provides an interface to pseudo-terminal (pty) devices. It is typically mounted at /dev/pts.

• The /proc filesystem is to provide an easy way to view kernel and information about currently running processes.

• The tmpfs is a temporary file storage facility.

• sysfs is a virtual file system which exports information about devices and drivers from the kernel device model to userspace, and is also used for configuration.

The following table describes the different fields of /etc/fstab file.

Field Name

Description

Device

Specifies the device to be mounted. You can specify the device file or Label in this field. If mounted, you can find the related information from /etc/mtab file.

Mount Point

The directory under the root filesystem, where this filesystem will be mounted.

Filesystem Format

Specifies the filesystem type (ext2, ext3, iso9660 etc).

Mount Options

Refer the next link to learn about different Linux mount options

Dump Value

Dump is a backup utility. The possible values can be either 0 or 1. Dump use this value to decide whether the filesystem should be backed up. If the value is "0", dump will ignore that filesystem.

Filesystem Check Order

"fsck" is a tool to check the file system consistency. This value determines the order that filesystems are checked by "fsck" program during the boot process. If the value is "0", fsck won't check the filesystem.



Linux Mount Options:

Mount Option

Description

auto and noauto

The Linux "auto" mount option allows the the device to be mounted automatically at bootup. The Linux "auto" mount option is the default option. You can use the "“noauto" mount option in /etc/fstab, if you don't want the device to be mounted automatically. With the Linux noauto mount option, the device can be mounted only explicitly and later you can use "mount -a" command to mount the devices listed in Linux /etc/fstab file.

user and nouser

The Linux "user" mount option allows normal users to mount the device, whereas the Linux "nouser" mount option allows only the super user (root) to mount the device. "nouser" is the default mount option.

exec and noexec

"exec" mount option allows you to execute binaries stored on that partition and "noexec" option will prevent it. "exec" is the default Linux mount option.

ro

The Linux "ro" (Read Only) mount option is used to mount the filesystem read-only.

rw

The Linux "rw" (Read Write) mount option is used to mount the filesystem read-write.

sync

The "sync" mount option specifies the input and output to the filesystem is done synchronously. When you copy a file to a removable media (like floppy drive) with "sync" option set, the changes are physically written to the floppy at the same time you issue the copy command.

async

The "async" mount option specifies the input and output to the filesystem is done asynchronously. When you copy a file to a removable media (like floppy drive) with "async" option set, the changes are physically written to the floppy some time after issuing the copy command. If "async" option is set and if you remove the media without using the "unmount" command, some changes you made may be lost.

defaults

Uses the default options that are rw, suid, dev, exec, auto, nouser, and async. Usually the Linux operating systems use this option in /etc/fstab file.

No comments:

Post a Comment