What is fstab?
/etc/fstab defines how drives are mounted automatically at boot.
Basic Structure
UUID=xxxx /mnt/storage ext4 defaults 0 2
| Field | Description |
| UUID | Disk identifier |
| Mount Point | Where it mounts |
| Filesystem | ext4, ntfs, xfs, etc |
| Options | Mount options |
| Dump | Backup flag |
| Pass | Filesystem check order |
Find UUID
sudo blkid
Example: Mount ext4 Drive
sudo mkdir -p /mnt/storage
sudo nano /etc/fstab
Add:
UUID=abcd-1234 /mnt/storage ext4 defaults 0 2
Test Without Reboot
sudo mount -a
Common Options
| Option | Description |
| defaults | Standard mount options |
| noatime | Disable access time logging |
| ro | Read-only |
| rw | Read-write |
Doing a read only mount:
UUID=abcd-1234 /mnt/storage ext4 ro 0 2
Conclusion
Using UUID in fstab ensures stable mounts even if device names change.
Comments (0)
No comments yet. Be the first to comment!
Leave a Comment