0% found this document useful (0 votes)
7 views

fstab-file-linux-slides

The fstab file in Linux OS defines how disk partitions, block devices, or remote filesystems are mounted into the filesystem. It consists of six fields: device name (UUID or device file), mounting directory, filesystem type, options, dump, and fsck check order. Each field serves a specific purpose, such as specifying the device, its mount point, and whether it should be checked at boot time.

Uploaded by

Jatin Chopra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

fstab-file-linux-slides

The fstab file in Linux OS defines how disk partitions, block devices, or remote filesystems are mounted into the filesystem. It consists of six fields: device name (UUID or device file), mounting directory, filesystem type, options, dump, and fsck check order. Each field serves a specific purpose, such as specifying the device, its mount point, and whether it should be checked at boot time.

Uploaded by

Jatin Chopra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Define Fstab File in Linux OS?

# cat /etc/fstab

UUID=a8063676-44dd-409a-b584-68be2c9f5570 / xfs defaults 0 0

The first field (Device Name)


 The first field specifies the device. This example uses the UUID to specify the device.
 File systems create and store the UUID in their super block at creation time.
 Alternatively, you could use the device file, such as /dev/vdb1.

The second field (mounting directory)


 The second field is the directory mount point, from which the block device will be accessible in
the directory structure. The mount point must exist; if not, create it with the mkdir command.

Third field (filesystem_type)


 The third field contains the file-system type, such as xfs, ext4, ext3, ext2..etc

The fourth field (options)


 The fourth field is the comma-separated list of options to apply to the device.
 defaults is a set of commonly used options. The mount man page documents the other available
options.

The fifth field (dump)


 The fifth field is used by the dump command to back up the device. Other backup applications
do not usually use this field.
 binary value (“0” for false and “1” for true) for “dumping.” This is a pretty much out-dated
method of backup for cases when the system went down. You should leave this as “0”.
 Specifies the option that need to be used by the dump (backup utility) program. If the value is
set to 0, then the partition is excluded from taking backup and if the option is a nonzero value,
the filesystem will be backed up.
The sixth field (fsck Check)
 The last field, the fsck order field, determines if the fsck command should be run at system boot
to verify that the file systems are clean. The value in this field indicates the order in which fsck
should run.
 If this value is not provided it defaults to 0, and the filesystem will not be checked.
 Mentions the fsck option. That is if the value is set to zero, the device or partition will be
excluded from fsck check and if it is nonzero the fsck check will be run in the order in which the
value is set.
 The root partition will have this value set to one (1) so that it will be checked first by fsck. If you
set to two (2) that means the system to do fsck on all rest partition marked '2' in sequence on
system reboot.
 For XFS file systems, set this field to 0 because XFS does not use fsck to check its
 file-system status. For ext4 file systems, set it to 1 for the root file system and 2 for the other
ext4
 file systems. This way, fsck processes the root file system first and then checks file systems on
 separate disks concurrently, and file systems on the same disk in sequence.

Note:

0: file systems that are not to be checked

1: the root directory

2: all other modifiable file systems; file systems on different drives are checked in parallel

 This can be completed via system utility called fsck (file system consistency check). This check
can be done automatically during boot time or ran manually.
 FSCK always use to check Filesystem integrity.
 Linux fsck utility is used to check and repair Linux filesystems (ext2, ext3, ext4, etc.).
 Depending on when was the last time a file system was checked, the system runs the fsck during
boot time to check whether the filesystem is in consistent state. System administrator could also
run it manually when there is a problem with the filesystems.
 Make sure to execute the fsck on an unmounted file systems to avoid any data corruption
issues.

https://www.tecmint.com/fsck-repair-file-system-errors-in-linux/

https://www.thegeekstuff.com/2012/08/fsck-command-examples/

Follow these link to get info about fsck commands.

******************************** Thanks *********************************************

You might also like