- Purpose: Defines how disk partitions, network shares, and other devices are mounted.
- Format: Each line represents a mount entry with six fields:
<file_system> <mount_point> <type> <options> <dump> <pass>
¶ 2. Useful Commands
| desc |
command |
| open fstab file for editing |
sudo nano /etc/fstab |
| remount all filesystems |
sudo mount -a |
| list current mounts |
mount |
| list mounted drives and their free/total space |
df -h |
| get uuids of drives |
sudo blkid |
file_system: The device or partition (e.g., /dev/sda1, UUID, LABEL).
mount_point: Directory where the filesystem will be mounted (e.g., /mnt/data).
type: Filesystem type (e.g., ext4, ntfs, swap).
options: Mount options (e.g., defaults, noatime, ro).
dump: Backup utility setting (0 or 1).
pass: Filesystem check order on boot (0 to disable).
defaults: Standard mount options (rw, suid, dev, exec, auto, nouser, async).
noatime: Disables updating access time for performance.
ro: Read-only mount.
rw: Read-write mount.
nosuid: Ignores setuid and setgid bits.
noexec: Disables execution of binaries on the filesystem.
# Mount an ext4 partition
UUID=1234-5678 /mnt/data ext4 defaults,noatime 0 2
# Mount a network share
//server/share /mnt/share cifs username=user,password=pass,iocharset=utf8,sec=ntlm 0 0
# Mount a swap partition
UUID=abcd-1234 none swap sw 0 0