Green YGreck Guides FR
🐧 LinuxIntermediate⏱ 15 min5 steps

Disks, partitions and mounting (fstab)

Mount a disk and find it again at every boot.

  1. List disks and file systems:
    lsblk -f
    sudo blkid
  2. Temporarily mount a partition:
    sudo mkdir -p /mnt/data
    sudo mount /dev/sdb1 /mnt/data
  3. For a permanent mount, add a line to /etc/fstab (use the UUID):
    UUID=xxxx-xxxx  /mnt/data  ext4  defaults,nofail  0  2
  4. Test before rebooting:
    sudo mount -a
  5. Monitor space:
    df -h
    du -sh * | sort -h
⚠️ A mistake in /etc/fstab can prevent booting: keep the nofail option for secondary disks.