Junior — Middle
Can you explain what the file /etc/fstab is and what information it usually contains?
sobes.tech AI
Answer from AI
The /etc/fstab file in Linux and Unix systems is a configuration file that contains information about file systems that should be automatically mounted at system startup.
It typically stores the following information for each file system:
- Device or UUID (e.g.,
/dev/sda1orUUID=xxxx-xxxx) - Mount point (e.g.,
/,/home,/mnt/data) - File system type (e.g.,
ext4,xfs,swap) - Mount options (e.g.,
defaults,noatime,ro) - Parameters for the
dumpcommand (usually 0 or 1) - Parameters for file system check at boot (fsck)
Example line from /etc/fstab:
UUID=123e4567-e89b-12d3-a456-426614174000 / ext4 defaults 0 1
This file allows the system to automatically mount necessary partitions and devices at startup without manual intervention.