Filesystems in Linux
ext4
The default filesystem on most modern Linux distributions, ext4 is an evolution of ext3 with improved performance and larger filesystem support.
Key features
- Journaling for crash recovery
- Extent-based storage (fewer fragmentation issues)
- Supports volumes up to 1 EiB and files up to 16 TiB
Usage
mkfs.ext4 /dev/sdX1 # format partition as ext4
mount -t ext4 /dev/sdX1 /mnt/data
XFS
A high-performance 64-bit filesystem, XFS excels at handling large files and parallel I/O, making it popular on servers.
Key features
- Scales to petabyte volumes
- Delayed allocation for reduced fragmentation
- Online growing (must unmount to shrink)
Usage
mkfs.xfs /dev/sdX2 # format partition as XFS
mount -t xfs /dev/sdX2 /mnt/large
Btrfs
A modern Copy-On-Write (COW) filesystem with built-in snapshotting, subvolumes, and RAID-like features.
Key features
- Snapshots and rollbacks
- Subvolumes for flexible quotas
- Transparent compression (zlib, lzo, zstd)
Usage
mkfs.btrfs /dev/sdX3 # format partition as Btrfs
mount -t btrfs /dev/sdX3 /mnt/btrfs
btrfs subvolume snapshot /mnt/btrfs/@ /mnt/btrfs/@snap
Other Common Filesystems
Besides ext4, XFS and Btrfs, you may encounter:
- ext3 – older journaling FS, predecessor to ext4.
- FAT32 / exFAT – for USB sticks and cross-platform compatibility.
- NTFS – Windows filesystem, supported read/write via ntfs-3g.
Checking and Repairing
Filesystem checks
fsck.ext4 -f /dev/sdX1 # force check ext4
xfs_repair /dev/sdX2 # repair XFS
Always unmount before running or use rescue mode.