Mount a Disk on Linux: Partition, ext4, mount and fstab (UUID)

mount disk linux fstab - custom-mntdisk-featured.png

Adding a data volume — cloud extra disk, SAN LUN, or local SSD — follows the same steps: identify the block device, partition (optional), create a filesystem once, mount, then persist in /etc/fstab with UUID so reboots are safe.

Related: fdisk & parted,
df and du, and
mdadm RAID when the disk is part of an array.

Identify the Block Device

Use lsblk and serial/size — never guess /dev/sd? on a live system with data.

bashinventory
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT
sudo fdisk -l
lsblk
right disk

Create a Partition (Optional)

Whole-disk filesystems are fine for data volumes; partitions help multi-tenant layouts.

WarningTriple-check device name before mkfs — formatting is irreversible.
fdisk
GPT

Create ext4 (or xfs)

Run once on empty space.

bashformat
sudo mkfs.ext4 -L data1 /dev/sdb1
mkfs.ext4
label

Mount Temporarily

Create mount point and mount to test before fstab.

bashmount
sudo mkdir -p /data
sudo mount /dev/sdb1 /data
df -h /data
mount
df -h

fstab Entry

Use UUID; defaults,nofail avoids boot hang if disk is missing.

bashexample line
UUID=abc123-def456  /data  ext4  defaults,nofail  0  2
/etc/fstab
nofail

Get UUID with blkid

Prefer UUID over /dev/sdb1 names that can shift.

bashblkid
sudo blkid /dev/sdb1
blkid
UUID

Test Before Reboot

mount -a applies fstab; findmnt confirms.

bashvalidate fstab
sudo mount -a
findmnt /data
mount -a
findmnt

Quick Reference

  • lsblk → mkfs once → mount → fstab with UUID
  • mount -a before reboot
  • nofail for optional data disks

Related tutorials

Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.