#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:
- 4Directory Tree (VFS)/home, /var/log, C:\
- 3Filesystemext4, XFS, NTFS
- 2Partition TableGPT or MBR slices
- 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:
$ 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 groupGid - 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, incrementingLinks. Deleting one name leaves data intact untilLinksreaches 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:
$ 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 +0500Modify 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:
$ 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% /varTwo 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/tmpon one filesystem lets runaway logs fill/and stall the OS. - Permissive mount options: Mounting
/tmpor USB drives withoutnodev,nosuid,noexeceases binary execution and setuid abuse. - Assuming
rmwipes 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, whiledfcounts 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 -handdf -i, isolating/varand/tmp, and mounting withnodev,nosuid,noexecprevent outages and reduce local attack surface.