grep -rl "filesystem" ./blog

Linux Filesystems and Storage

How Linux organizes data on disk: filesystem types and their tradeoffs, the directory hierarchy, mounting, volume management, and snapshots.

25 articles

Recovering Deleted Files on Linux With TestDisk and PhotoRec What to do in the first five minutes after deleting the wrong file, how TestDisk recovers lost partitions and undeletes files, how PhotoRec carves files from raw data, and why SSDs and ext4 make recovery harder. chattr and Extended Attributes: File Properties Beyond Permissions A file root cannot delete, a directory where files can only be appended to, and where SELinux labels and capabilities actually live. Two different mechanisms people conflate, and what each is genuinely useful for. The /dev Directory Explained: Device Files, null, zero and random Everything in /dev is a file that is not a file. Block versus character devices, why /dev/null and /dev/zero differ, what /dev/random actually blocks on now, and why the directory is rebuilt from nothing on every boot. Inodes, Dentries and the Page Cache: What Happens When You Open a File A path is not a file. Resolving one walks a cache of directory entries to find an inode, which points at data the kernel keeps in the page cache. Understanding those three explains disk full errors with free space, and why the second read is instant. sysfs Explained: What /sys Is and How to Read It procfs is about processes. sysfs is about devices, drivers and the kernel object model, and almost every tuning knob people paste into a terminal is a file in here. How it is organised and how to change things so they survive a reboot. Btrfs vs ZFS: Choosing a Copy-on-Write Filesystem Both do snapshots, checksums, and compression. The differences that decide it are licensing, memory behaviour, how each handles RAID, and which failure modes you can live with. EROFS Explained: The Read-Only Filesystem Behind Android and Containers How EROFS achieves random access on compressed data, why it replaced SquashFS for Android system images and container layers, and the LZ4 rolling decompression issue in Linux 7.3. Filesystem Quotas Explained Setting per-user and per-group disk limits on ext4 and XFS, the difference between soft and hard limits, and why inode quotas matter as much as block quotas. inotify and File Watching Explained How the kernel notifies programs about file changes, why you keep hitting the watch limit, and what fanotify does that inotify cannot. fsck: Checking and Repairing Linux Filesystems Never run it on a mounted filesystem. Beyond that one rule, here is how to force a check at boot, what the repair prompts actually mean, and when a filesystem problem is really a disk problem. ZFS on Linux: Pools, Datasets, Snapshots, and the Licensing Problem ZFS checksums everything, snapshots instantly, and replicates efficiently. It also cannot be merged into the kernel, which shapes how you install and maintain it. Here is what you need to know before committing. Btrfs Snapshots and Timeshift: Undo for Your Whole System Btrfs can capture the state of your filesystem in an instant snapshot that costs almost nothing until files change. Paired with Timeshift or Snapper, that becomes an undo button for bad updates. Here is how it works and how to set it up. NFS vs Samba Explained: Sharing Files Between Machines NFS and Samba both put one machine s storage on another machine s filesystem, but they come from different worlds. Here is how each works, which to choose, and minimal working configs for both. Symlinks vs Hard Links Explained: The ln Command and How Links Actually Work Symbolic links point to a path; hard links point to the data itself. Understanding the difference explains why one survives renames, why the other breaks, and what ln -s actually creates. LVM (Logical Volume Manager) Explained LVM adds a flexible layer between raw disks and filesystems, letting you resize, combine, and snapshot storage without being locked into fixed-size partitions. This guide covers physical volumes, volume groups, logical volumes, and common resizing operations. Mounting Drives and /etc/fstab Explained How Linux attaches storage devices to the filesystem tree with mount and umount, how to find a drive to mount, and how to make mounts persist across reboots using /etc/fstab. The /etc Directory Explained /etc is where Linux keeps system-wide configuration files. This guide explains what belongs in /etc, how it is organized, and the safe way to edit configuration without breaking your system. The /home Directory Explained The /home directory is where every user on a Linux system keeps their personal files, settings, and configuration. This guide covers how /home is structured, why it often lives on its own partition, and how to manage it safely. The /opt Directory Explained /opt is reserved for self-contained, third-party software packages that keep all their files in one place. This guide explains what belongs in /opt, how it differs from /usr, and what to expect when you find something installed there. The Root Directory (/) Explained Every Linux filesystem starts at a single directory called root, written as /. This guide explains what root actually is, what lives directly inside it, and why Linux has no drive letters. The /tmp Directory Explained /tmp is Linux's designated scratch space for temporary files, often cleared on every reboot. This guide explains how /tmp works, why it is sometimes stored in RAM, and how it differs from /var/tmp. The /usr Directory Explained /usr holds the vast majority of installed software, libraries, and documentation on a Linux system. This guide explains what belongs in /usr, how it differs from /bin and /opt, and why the historic /usr merge happened. The /var Directory Explained /var holds the data that changes constantly while Linux runs: logs, caches, spools, and databases. This guide explains what lives in /var, why it grows over time, and how to manage its disk usage. Linux File System Hierarchy Explained Linux puts every file in a specific place for a reason. This guide walks through the Filesystem Hierarchy Standard, explains what belongs where, and covers the modern changes that have reshaped the traditional layout. Linux Filesystem Basics: What Every Directory Is For Linux organizes all files under a single root directory, with each subdirectory serving a specific purpose defined by the Filesystem Hierarchy Standard. This guide explains what lives in /, /home, /etc, /var, /usr, /opt, and /tmp -- and why.