Skip to content
# Storage & disks

Mounting filesystems and /etc/fstab

Mount a disk by hand, then make it persistent across reboots with fstab.

List available disks and partitions

lsblk shows every block device and its mount points; blkid shows each partition's filesystem type and UUID, which you'll need for fstab.

bash
lsblk -f
sudo blkid

Mount and unmount manually

Create a mount point, then mount the device onto it. This mount only lasts until the next reboot.

bash
sudo mkdir -p /mnt/data
sudo mount /dev/sdb1 /mnt/data
sudo umount /mnt/data

Make it persistent: /etc/fstab

Add a line to /etc/fstab using the partition's UUID (not /dev/sdb1, which can change order on reboot). Fields are: device, mount point, filesystem type, options, dump, pass.

text
UUID=1234-5678-90ab-cdef  /mnt/data  ext4  defaults  0  2

Test before you reboot

mount -a re-reads fstab and mounts anything not already mounted, without rebooting β€” it will fail loudly with a typo instead of leaving you locked out after a reboot.

bash
sudo mount -a