// learn Β· linux Β· rhcsa Β· 9 min

File systems & mounts.

A partition is just bytes until you format it with a filesystem and mount it somewhere. Watch a block device become an XFS filesystem, get mounted, and survive a reboot via /etc/fstab β€” then learn the options that govern its behavior.

Linux filesystems and mounts animated tutorial. mkfs.xfs and mkfs.ext4, the mount command, mount options, /etc/fstab format and UUIDs, fsck and tune2fs, xfs_growfs and resize2fs. RHCSA EX200 ready.
// filesystems & mounts

From a bare partition to a mounted, persistent filesystem β€” six layers, all with their own commands.

// before you start
you should know
  • Β·The partitions lesson (lsblk, blkid)
  • Β·Comfortable as root
  • Β·Know what a journaling filesystem is, vaguely
by the end you'll

Format a partition with mkfs, mount it, persist it in /etc/fstab using UUID, pick the right mount options, and grow / check it.

pace: 9 minutes

filesystem stack β€” step 1 / 6 Β· pick FS
1. block device
/dev/sdb1
2. filesystem
(none)
3. mount point
(unmounted)
4. /etc/fstab
(no entry)

Pick a filesystem β€” XFS or ext4

Two RHCSA defaults: XFS (RHEL's default since 7) β€” fast, scales to huge volumes, grows online but CANNOT shrink. ext4 β€” slightly older, slower at scale, supports BOTH grow and shrink (offline shrink). Pick XFS unless you specifically need to shrink. Both journal, both are stable.

$lsblk -f /dev/sdb1
$blkid /dev/sdb1
// key insight

The chain: block device β†’ filesystem β†’ mount β†’ fstab. Skip the last step and your work vanishes at reboot. ALWAYS run `mount -a` after editing fstab β€” if you don't, the next reboot might drop into emergency mode and the only way out is rescue media.

// exam-ready Β· mkfs, mount, fstab, repair
$mkfs.xfs / mkfs.ext4 DEV
$mkfs.xfs -L LABEL DEV
$mount DEV MOUNTPOINT
$umount MOUNTPOINT
$mount -a
$mount -o remount,ro DIR
$findmnt / findmnt --verify
$lsof DIR / fuser -mv DIR
$blkid DEV
$/etc/fstab
$xfs_growfs MP
$resize2fs DEV
$xfs_repair DEV (unmounted)
$fsck.ext4 -y DEV
$tune2fs -l DEV
$df -hT / du -sh DIR
// check yourself
4 quick questions
Q1

You added a new line to /etc/fstab and want to verify it works WITHOUT rebooting.

Q2

You need to SHRINK a filesystem. Which filesystem can you use?

Q3

`umount /data` returns 'target is busy'. How do you find the culprit?

Q4

Why reference partitions by UUID in /etc/fstab?

These aren't graded β€” they're just for active recall, which is what actually makes the lesson stick.

πŸ’Ύ
// next layer up

LVM stacking

Put LVM between the partition and the filesystem and growing space online becomes one command. See the whole stack: disks β†’ PVs β†’ VG β†’ LVs β†’ FS.

open β†’
// more in linux

keep going β€” these pair well with what you just learned.

see all linux β†’
back to RHCSA trackall lessons