Filesystem
A filesystem is the filing system for a disk. Raw storage is just billions of numbered blocks. The filesystem keeps track of which blocks belong to which file, what each file is called, which folder it is in, and who is allowed to open it. Formatting a drive means writing a new, empty filesystem onto it.
A filesystem defines on-disk structures (superblock, inode tables, directories, allocation bitmaps, journal) and the kernel driver that reads and writes them.
Common filesystems:
| Filesystem | Where | Notes |
|---|---|---|
| ext4 | Linux default on Ubuntu, Debian | Journaling, mature, fsck.ext4 |
| XFS | RHEL default | Large files, cannot shrink |
| Btrfs | Fedora, openSUSE | Copy-on-write, snapshots, checksums |
| ZFS | Proxmox, TrueNAS | Pooled storage, checksums, snapshots, RAID-Z |
| vfat/FAT32 | EFI System Partition, USB sticks | Universal, 4 GB file limit |
| exFAT | Large USB drives, SD cards | Cross-platform |
| NTFS | Windows | Read-write on Linux with the ntfs3 driver |
| APFS | macOS | Snapshots, encryption |
Journaling writes intended changes to a log before applying them, so a crash leaves the filesystem recoverable instead of corrupt.
The Linux view: everything appears in a single tree starting at /. Each filesystem is mounted at a directory. /etc/fstab lists what to mount at boot. Linux also has virtual filesystems with no disk behind them: /proc, /sys, tmpfs.
Working with filesystems
# Filesystem type and usage for each mount
$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext4 24G 9.1G 14G 41% /
/dev/sda1 vfat 1.1G 6.2M 1.1G 1% /boot/efi
# Create one on a NEW empty partition and mount it
$ sudo mkfs.ext4 -L data /dev/sdb1
$ sudo mkdir -p /mnt/data && sudo mount /dev/sdb1 /mnt/data
# What is mounted where, as a tree
$ findmnt Filesystem choice is a real decision on servers and NAS builds: ext4 for simple and reliable, XFS for large data on RHEL, ZFS when you want checksums, snapshots, and redundancy. Day to day, the filesystem problems you will see are full disks (df -h), running out of inodes (df -i), and a filesystem that needs fsck after a crash. Use exFAT for a USB drive that has to work on Windows, macOS, and Linux.