Storage Devices, Partitions & Filesystems
Module 4 · Storage Management

Storage Devices, Partitions & Filesystems

Block vs. character devices, MBR/GPT partitioning, and the filesystem types — ext4, XFS, and beyond — that CompTIA Linux+ expects you to recognize.

Types of Storage Devices

TypeExampleNotes
Magnetic (rotational)HDDSpinning platters — cheap per gigabyte, slower, mechanically fragile
Solid-stateSSD / NVMeNo moving parts — fast, especially NVMe over the PCIe bus
OpticalCD/DVD/Blu-rayRemovable, read-mostly media
Removable/networkUSB flash drives, network-attached storageAttached or detached without a reboot; identified dynamically by udev

Linux exposes each attached device as a device file under /dev. Devices fall into two device-file categories:

CategoryBehaviorExamples
Block devicesRead/written in fixed-size chunks, randomly addressable/dev/sda, /dev/nvme0n1
Character devicesRead/written as a continuous stream, one character at a time/dev/tty, /dev/null

Device naming follows a pattern: /dev/sda is the whole first SCSI/SATA disk; /dev/sda1 is its first partition. NVMe drives use a slightly different scheme: /dev/nvme0n1p1 (controller 0, namespace 1, partition 1).


Partitioning: MBR vs. GPT

A partition divides one physical disk into multiple independently-formattable regions. Two competing partition table formats exist:

MBR (Master Boot Record)GPT (GUID Partition Table)
LocationFirst physical sector of the diskMultiple locations, with backup copies
Max partitions4 primary (or 3 primary + 1 extended, subdivided into logical partitions)128 by default
Max disk size2 TBEffectively unlimited (exabytes)
Pairs withLegacy BIOSUEFI
Boot record redundancyNone — single point of failureBackup copy stored at the end of the disk

GPT is the modern standard and is what you should default to on any new install.

Managing partitions:

TaskCommand
Interactive partition editor (menu-driven, both MBR and GPT)parted /dev/sda (menu options include print, mkpart, resizepart, rm)
Tell the kernel to re-read the partition table without rebootingpartprobe
Create a filesystem on a new partitionmkfs -t ext4 /dev/sdb1 (or mkfs.xfs, mkfs.ext4, etc.)
Apply a human-readable label to a filesysteme2label /dev/sdb1 mylabel (ext) or xfs_admin -L mylabel /dev/sdb1 (XFS)

Filesystem Types

FilesystemNotes
ext4The long-standing Linux default — journaling, mature, well-supported everywhere
XFSHigh-performance journaling filesystem, the default on RHEL/Rocky/AlmaLinux — excels with large files
BtrfsCopy-on-write, built-in snapshots and volume management — default on some SUSE and Fedora setups
NTFSWindows’ native filesystem — Linux reads/writes it via the ntfs-3g driver for interoperability
Network filesystemsNFS (Linux-native network sharing) and CIFS/SMB (Windows-interoperable network sharing) — mounted like local filesystems but backed by a remote server

Journaling

A journaling filesystem (ext3/ext4, XFS, Btrfs) writes pending changes to a log before committing them to the main filesystem structure, so an interrupted write (power loss, crash) can be replayed or rolled back cleanly instead of corrupting the filesystem. The general phases are:

  1. Logging — the intended change is written to the journal first
  2. Commit — the journal entry is marked complete
  3. Checkpoint — the actual data blocks are updated on disk
  4. Journal reuse — once checkpointed, that journal space is freed for new entries

Inodes and the Virtual Filesystem (VFS)

An inode is a data structure storing everything about a file except its name and contents: permissions, ownership, timestamps, size, and pointers to the actual data blocks on disk. The filename itself just lives in the containing directory, mapped to an inode number.

TaskCommand
Check inode usage/details for a directory or mountdf -i (disk free, inode view) or stat file for a single file’s inode metadata

The Virtual Filesystem (VFS) is a kernel abstraction layer that lets every filesystem type — ext4, XFS, NFS, even /proc — present the same interface to user-space programs, so cat, ls, and every other tool work identically regardless of what’s actually underneath.


Identifying File Types

Linux recognizes several distinct file types under a single hierarchy: regular files, directories, symbolic links, device files (block and character), and special IPC files (named pipes/FIFOs, sockets). Determine any file’s actual type with:

file somefile
⚠️ Common Pitfall: File Extensions Are a Suggestion, Not a Rule

Unlike Windows, Linux doesn’t rely on file extensions to determine type or behavior — a script without .sh runs exactly the same as one with it, and a .txt file could technically be a binary. file inspects the actual content (magic bytes) rather than trusting the name, which is why it’s the tool Linux+ expects for “determine what kind of file this actually is” questions.


🧠 Knowledge Check

1. Which partition table format supports disks larger than 2 TB and up to 128 partitions by default?

2. What does a journaling filesystem write before committing an actual change to disk?

3. A file named notes.txt is actually a compiled binary with no readable text. Which command reveals its true type by inspecting content rather than trusting the name?


What’s Next

Creating a filesystem is only half the job — Lesson 2 covers actually mounting it, keeping it mounted across reboots, and repairing it when something goes wrong.