Skip to content

4.4 Persistent Mounts and NFS

Command line mounts (sudo mount) disappear when you reboot. To make them permanent, edit /etc/fstab.

Device names (/dev/sdb1) can change if you unplug/plug disks. UUIDs (Universally Unique Identifiers) never change.

  1. Find UUID: sudo blkid
  2. Edit file: sudo nano /etc/fstab

Format: <Device UUID> <Mount Point> <Filesystem> <Options> <Dump> <Pass>

Example:

UUID=1234-abcd-5678  /mnt/data  ext4  defaults  0  2
  1. Verify: run sudo mount -a. If it outputs no errors, you are safe.

Accessing storage over the network.

Client Setup:

  1. Install commons: sudo apt install nfs-common (Ubuntu) or sudo dnf install nfs-utils (Rocky).

  2. Test mount:

    sudo mount server_ip:/exported/share /mnt/local_mountpoint
  3. Add to fstab for persistence:

    server_ip:/share  /mnt/local  nfs  defaults  0  0