4.4 Persistent Mounts and NFS
/etc/fstab
Section titled “/etc/fstab”Command line mounts (sudo mount) disappear when you reboot. To make them permanent, edit /etc/fstab.
Best Practice: Use UUIDs
Section titled “Best Practice: Use UUIDs”Device names (/dev/sdb1) can change if you unplug/plug disks. UUIDs (Universally Unique Identifiers) never change.
- Find UUID:
sudo blkid - Edit file:
sudo nano /etc/fstab
Format:
<Device UUID> <Mount Point> <Filesystem> <Options> <Dump> <Pass>
Example:
- Verify: run
sudo mount -a. If it outputs no errors, you are safe.
Network File System (NFS)
Section titled “Network File System (NFS)”Accessing storage over the network.
Client Setup:
-
Install commons:
sudo apt install nfs-common(Ubuntu) orsudo dnf install nfs-utils(Rocky). -
Test mount:
-
Add to
fstabfor persistence: