Skip to main content
Filesystems, Inodes & Storage Layout
Lesson 3 of 10

Filesystems, Inodes & Storage Layout

Learn how operating systems organize raw storage blocks into partitions and filesystems, how ext4 inodes and NTFS MFT records track files, and how to inspect disk layout, space, and metadata.

Beginner 22 min IT foundations

Learning objectives

  • Explain how block devices, partition tables, and filesystems layer together to store persistent data
  • Describe the role of inodes, directory entries, hard links, and symbolic links in Linux filesystems
  • Compare Linux ext4 inode metadata with the Windows NTFS Master File Table (MFT)
  • Inspect mounted filesystems, block usage, and inode consumption using lsblk, df, and stat

Recommended first: CPU, Memory & Program ExecutionOperating Systems, Kernels & Processes

#Why this matters

Processes execute in volatile RAM, which disappears on power loss. Persistent data - configurations, logs, binaries, and documents - lives on disks or SSDs. Understanding how an operating system turns raw blocks into named files helps you diagnose storage outages, preserve forensic evidence, and enforce mount boundaries against untrusted code.

#From raw blocks to partitions and filesystems

An SSD or hard drive presents a flat array of numbered sectors (logical blocks), typically 512 or 4096 bytes each. The OS stacks four layers over raw blocks:

  1. 4Directory Tree (VFS)/home, /var/log, C:\
  2. 3Filesystemext4, XFS, NTFS
  3. 2Partition TableGPT or MBR slices
  4. 1Block DeviceNVMe, SATA SSD, virtual disk

A partition table divides a drive into logical regions: modern UEFI hosts use GUID Partition Table (GPT), while legacy systems used MBR. Each partition is formatted with a filesystem (such as ext4 or XFS on Linux, or NTFS on Windows) that tracks free space, permissions, and block locations. Inspect Linux drives and mounts with lsblk:

Listing block devices and mount points on a lab host
$ lsblk --ascii -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
NAME        SIZE TYPE FSTYPE MOUNTPOINTS
nvme0n1      40G disk
|-nvme0n1p1 512M part vfat   /boot/efi
|-nvme0n1p2  20G part ext4   /
`-nvme0n1p3  19G part ext4   /var

#Inodes, directory entries, and the NTFS MFT

In ext4, a file's name is not stored inside its metadata. Instead, a directory maps filenames to integer inode numbers, while the inode holds everything else:

  • File type, permissions, owner Uid, and group Gid
  • Size, allocated blocks, and timestamps (Access, Modify, Change, Birth)
  • Hard link count (Links) and block pointers (extents)

Because names live in directories, multiple names can point to one inode:

  • A hard link (ln target linkname) adds another directory entry pointing to the same inode, incrementing Links. Deleting one name leaves data intact until Links reaches 0 and no process holds the file open.
  • A symbolic link (ln -s target linkname) creates a separate inode storing a path string; moving the target breaks the link.

Windows NTFS uses a Master File Table (MFT) instead of a separate inode table. Every file gets an MFT record holding $STANDARD_INFORMATION (timestamps, flags), $FILE_NAME, and $DATA (stored inline as resident data for tiny files, or pointing to external clusters).

Feature Linux ext4 Windows NTFS
Metadata unit Inode (integer ID) MFT record (file reference)
Filename storage Parent directory table $FILE_NAME attribute
Tiny-file storage Inline data / blocks Resident $DATA in MFT
Crash recovery Metadata journal (JBD2) Metadata journal ($LogFile)

Use stat to inspect an inode directly:

Checking inode metadata with stat
$ stat /var/log/syslog
  File: /var/log/syslog
  Size: 48120           Blocks: 96         IO Block: 4096   regular file
Device: 259,3   Inode: 131078      Links: 1
Access: (0640/-rw-r-----)  Uid: (  104/  syslog)   Gid: (    4/     adm)
Access: 2026-11-18 09:12:04.112000000 +0500
Modify: 2026-11-18 09:15:30.405000000 +0500
Change: 2026-11-18 09:15:30.405000000 +0500
 Birth: 2026-11-10 08:00:01.000000000 +0500

Modify tracks content changes, whereas Change tracks inode metadata edits such as chmod or ln.

#Mounting, capacity, and inode exhaustion

Windows assigns drive letters (C:\, D:\) to volumes, though folder mounts exist. Linux unifies all filesystems under /: mounting attaches a partition onto an existing directory (mount point). Check space with df:

Comparing block usage and inode usage with df
$ df -h / /var
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2   20G   11G  8.0G  58% /
/dev/nvme0n1p3   19G  4.2G   14G  24% /var
$ df -i / /var
Filesystem      Inodes  IUsed   IFree IUse% Mounted on
/dev/nvme0n1p2 1310720 185420 1125300   15% /
/dev/nvme0n1p3 1245184  14200 1230984    2% /var

Two ext4 details matter in operations. First, Used plus Avail is below Size because ext4 reserves 5% of blocks for root by default. Second, df -h counts blocks, while df -i counts inodes; millions of tiny files can hit 100% IUse% with gigabytes of block space still free.

#Common mistakes and security impact

  • Single-partition layout: Keeping /, /var/log, and /tmp on one filesystem lets runaway logs fill / and stall the OS.
  • Permissive mount options: Mounting /tmp or USB drives without nodev,nosuid,noexec eases binary execution and setuid abuse.
  • Assuming rm wipes data: Unlinking removes a directory entry, yet data blocks persist until overwritten, enabling forensic recovery.
  • Ignoring open deleted files: Deleting a log held open by a daemon hides it from ls, while df counts its blocks until the file descriptor closes.

#Summary

  • Partition tables (GPT or MBR) slice block devices, filesystems (ext4, NTFS) organize blocks into files, and mount points join them into a directory tree.
  • Linux ext4 separates filenames (directories) from metadata (inodes), while Windows NTFS stores attributes, names, and tiny-file payloads in MFT records.
  • Monitoring df -h and df -i, isolating /var and /tmp, and mounting with nodev,nosuid,noexec prevent outages and reduce local attack surface.

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge