# Filesystems, Disks and Storage

> Learn the Linux directory layout, how disks are partitioned and mounted, and how to find out what is filling a disk at 3 a.m. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/devops/filesystems-storage
Last updated: 2026-11-28

Learn the Linux directory layout, how disks are partitioned and mounted, and how to find out what is filling a disk at 3 a.m.

Beginner · about 6 hours · difficulty 2/5

Learn first: [Linux Command Line and Packages](https://www.internhack.in/roadmaps/tracks/devops/linux-basics)

A full disk is one of the most common production incidents. Knowing how Linux organises storage lets you diagnose it quickly and design systems that do not fall over.

### Layout and concepts

- The **Filesystem Hierarchy Standard**: `/etc` config, `/var/log` logs, `/var/lib` app data, `/tmp`, `/home`, `/opt`, `/usr/bin`.
- **Inodes**: each file has metadata stored in an inode. You can run out of inodes before running out of space (millions of tiny files).
- **Hard links vs symbolic links**, and why deleted-but-open files still consume space until the process closes them.

### Disks and mounts

- Inspect with `lsblk`, `df -h`, `df -i`, `du -sh *`, `ncdu`.
- Partition and format with `fdisk`/`parted` and `mkfs.ext4` or `mkfs.xfs`, then mount and persist in `/etc/fstab` (use UUIDs).
- **LVM** lets you resize volumes; cloud block volumes (EBS, Azure Disk) can often be grown online.
- Swap, tmpfs, and network filesystems such as NFS.

### Pitfalls

Logs without rotation (configure `logrotate`), a bad fstab entry that stops the machine booting (use `nofail` for optional disks), and deleting a huge log file that a process still holds open.

**Good enough to move on:** you can attach a new disk to a VM, format and mount it persistently, and track down the directory eating all the space.

## Key concepts

- **Filesystem Hierarchy Standard**
- **Inodes and links**
- **df, du, lsblk, ncdu**
- **Partitioning, mkfs and fstab**
- **LVM**
- **logrotate**
- **NFS and network storage**

## Mini project

Attach a second virtual disk to a VM, create an ext4 filesystem, mount it at /data via a UUID fstab entry, reboot to prove it persists, and set up logrotate for an app log written there.

## Check yourself

df says the disk is full but du cannot find the files. What is the likely cause and how do you confirm it?

## Free resources

- [Linux Journey: The Filesystem](https://linuxjourney.com/) (linuxjourney.com)
- [hier(7) man page](https://man7.org/linux/man-pages/man7/hier.7.html) (man7.org)

Previous: [Processes, Signals and Resources](https://www.internhack.in/roadmaps/tracks/devops/processes-signals) · Next: [Users, Groups and Permissions](https://www.internhack.in/roadmaps/tracks/devops/users-permissions)

## More in Living on Linux

- [Linux Command Line and Packages](https://www.internhack.in/roadmaps/tracks/devops/linux-basics)
- [Processes, Signals and Resources](https://www.internhack.in/roadmaps/tracks/devops/processes-signals)
- [Filesystems, Disks and Storage](https://www.internhack.in/roadmaps/tracks/devops/filesystems-storage)
- [Users, Groups and Permissions](https://www.internhack.in/roadmaps/tracks/devops/users-permissions)
- [Services with systemd](https://www.internhack.in/roadmaps/tracks/devops/systemd-services)
- [Performance and Troubleshooting](https://www.internhack.in/roadmaps/tracks/devops/linux-performance)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
