Skip to content

4.2 Filesystems

A partition needs a filesystem structure to store data.

The mkfs (Make FileSystem) command family.

The default for Ubuntu/Debian. Robust and stable.

sudo mkfs.ext4 /dev/sdb1

The default for RHEL/Rocky. Excellent performance for large files and parallel operations.

sudo mkfs.xfs /dev/sdb1

To use a filesystem, it must be attached to the directory tree at a “mount point”.

# 1. Create a mount point (just an empty folder)
sudo mkdir /mnt/data

# 2. Mount the partition
sudo mount /dev/sdb1 /mnt/data

# 3. Verify
df -h

Important: You cannot unmount a filesystem if any user (including you) is currently “inside” it or using a file on it.

# Leave the directory first!
cd ~
sudo umount /mnt/data