Skip to content

Filesystem

← Back to all decks

11 cards — 🟢 3 easy | 🟡 5 medium | 🔴 3 hard

🟢 Easy (3)

1. What command shows the block device hierarchy including partitions and their mount points?

Show answer lsblk. It displays all block devices in a tree format showing relationships between disks, partitions, and LVM volumes, along with their mount points, sizes, and types.

2. How do you check filesystem usage in a human-readable format?

Show answer df -h. The -h flag shows sizes in human-readable units (KB, MB, GB). It displays total size, used space, available space, use percentage, and mount point for each mounted filesystem.

3. Why should you use UUIDs instead of /dev/sdX device names in /etc/fstab, and how do you find a UUID?

Show answer Device names like /dev/sdX can change between reboots (e.g., when disks are added or removed). UUIDs are persistent identifiers tied to the filesystem. Use the blkid command to show filesystem UUIDs and types.

🟡 Medium (5)

1. What are the key differences between ext4 and XFS filesystems?

Show answer ext4 is the safe default for general use: mature, well-tested, supports online resize (grow only). XFS excels at large files and parallel I/O, making it better for large-scale storage and high-throughput workloads. XFS cannot be shrunk, only grown. Btrfs adds snapshots and checksums but is less proven in production.

2. How do you create a filesystem on a partition, and what precaution should you take?

Show answer Use mkfs. (e.g., mkfs.ext4 /dev/sda1 or mkfs.xfs /dev/sdb1). Precaution: mkfs destroys all existing data on the partition. Always verify the target device with lsblk or blkid before running mkfs to avoid formatting the wrong device.

3. Explain the three-layer LVM abstraction: Physical Volumes, Volume Groups, and Logical Volumes.

Show answer Physical Volumes (PVs) are raw disks or partitions initialized for LVM. Volume Groups (VGs) pool one or more PVs into a single storage pool. Logical Volumes (LVs) are carved from VGs and are what you format and mount. This enables flexible resizing, snapshots, and spanning across multiple disks.

4. What is the difference between GPT and MBR partition schemes, and which tools manage them?

Show answer MBR is legacy: supports up to 4 primary partitions and 2TB max disk size. GPT is modern: supports up to 128 partitions and disks larger than 2TB. Use fdisk for MBR, gdisk for GPT, or parted for both. GPT is recommended for all new systems.

5. How do you find which directories are consuming the most disk space?

Show answer Use du -sh /path/* to show disk usage summary for each item in a directory. du -sh --max-depth=1 / shows top-level directory sizes. Sort with du -sh /path/* | sort -rh to find the largest consumers first.

🔴 Hard (3)

1. What are the key fields in an /etc/fstab entry, and what does a typical line look like?

Show answer An fstab entry has 6 fields: device (UUID preferred), mount point, filesystem type, mount options, dump flag (0/1), fsck pass order (0/1/2). Example: UUID=abc-123 /data ext4 defaults,noatime 0 2. The fsck pass order determines check order at boot (0=skip, 1=root, 2=other).

2. Describe the Linux storage stack from application down to hardware.

Show answer Application -> Filesystem (ext4, xfs, btrfs) -> Device Mapper / LVM / mdadm (optional layers) -> Block Device (/dev/sda, /dev/nvme0n1) -> Hardware (SATA, SAS, NVMe, virtio). Device Mapper is the kernel framework underlying LVM, dm-crypt (encryption), and multipath. Each layer adds capability and complexity.

3. What RAID levels does Linux software RAID (mdadm) support, and when would you use each?

Show answer RAID 1 (mirror): two copies of data, good for boot drives and small critical volumes. RAID 5 (parity): striping with one parity disk, good read performance, can survive one disk failure. RAID 10 (mirror+stripe): combines mirroring and striping, best performance and redundancy, requires minimum 4 disks. Use mdadm to create and manage software RAID arrays.