Junior
What is stored in the /etc/fstab file?
sobes.tech AI
Answer from AI
The /etc/fstab file contains information about file systems that should be mounted at system startup, as well as other available file systems for mounting. Each line in the file describes a separate file system. The line consists of six fields separated by spaces or tab characters:
- UUID or device: The identifier of the file system or the device path. Preferably use UUID for stability.
- Mount point: The directory where the file system will be mounted.
- File system type: For example,
ext4,xfs,ntfs,swap. - Mount options: Options that define behavior during mounting (e.g.,
defaults,ro,rw,noatime). - Dump: Used by the
dumputility. 0 - do not archive, 1 - archive. - Pass: Determines the order of file system integrity check by the
fsckutility during boot. 0 - do not check, 1 - check root FS, 2 - check other FSs.
Example line:
UUID=a1b2c3d4-e5f6-7890-1234-567890abcdef /home ext4 defaults,noatime 0 2
This line instructs to mount the file system with the specified UUID at the /home directory as an ext4 type file system, using default parameters and not updating the last access time to files, not archiving it with dump, and checking its integrity after checking the root file system.