Skip to content

Quiz: Filesystems & Storage

← Back to quiz index

8 questions

L1 (5 questions)

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

Show answer ext4: mature, supports online resize (grow only), max 1EB volume. XFS: better for large files and parallel I/O, supports online defrag, no shrink. Both are journaling filesystems. XFS is default on RHEL; ext4 on Debian/Ubuntu.

2. What is a journaling filesystem and why does it matter?

Show answer A journal logs pending writes before committing them to disk. On crash, the journal replays or discards incomplete transactions, preventing filesystem corruption. Without journaling, fsck must scan the entire disk after an unclean shutdown.

3. A server is reporting 'No space left on device' but df shows free space. What do you check?

Show answer 1. Inode exhaustion (df -i).
2. Deleted files still held open by processes (lsof +D /mount | grep deleted) — space is not freed until the process closes the file handle.
3. Reserved blocks (tune2fs -l, typically 5% reserved for root).

4. How do you troubleshoot a filesystem that won't mount?

Show answer 1. Check dmesg for errors.
2. Verify the device exists (lsblk).
3. Check filesystem type matches mount command (-t).
4. Run fsck on unmounted filesystem.
5. Check /etc/fstab for typos.
6. For NFS: verify server is reachable and export exists (showmount -e).

5. How do you diagnose and resolve inode exhaustion?

Show answer Symptoms: 'No space left on device' but df shows free space. Verify: df -i shows inode usage. Diagnosis: find the directory with millions of tiny files: find / -xdev -printf '%h
' | sort | uniq -c | sort -rn | head. Common culprits: mail queues, session files, log fragments, /tmp. Resolution: delete the files (often a runaway process creating temp files). Prevention: monitor inode usage in your alerting system. Some filesystems (XFS) allocate inodes dynamically; ext4 fixes them at mkfs time.

L2 (3 questions)

1. How do you find which directory is consuming the most inodes?

Show answer find / -xdev -printf '%h
' | sort | uniq -c | sort -rn | head -20. This counts files per directory. Also: for d in /*; do echo $(find $d -xdev | wc -l) $d; done for a quick top-level breakdown.

2. A server hangs at boot with a mount error. How do you recover?

Show answer An /etc/fstab entry with default options will block boot if the device is missing. Fix:
1. Boot to rescue/single-user mode.
2. Edit /etc/fstab — add nofail option to non-critical mounts.
3. For NFS: add nofail,bg so mounts retry in background.

3. How do LVM snapshots work and what are their performance implications?

Show answer LVM snapshots use copy-on-write (COW): the snapshot volume starts empty and only stores original blocks that are overwritten after snapshot creation. Read from snapshot: if block unchanged, read from origin; if changed, read from snapshot copy. Performance impact: every write to the origin triggers a read-old-block + write-to-snapshot + write-new-block sequence (triple I/O penalty). Snapshots that fill up become invalid. Use for: pre-upgrade backups, consistent database dumps (freeze + snap + thaw). Not a replacement for real backups — they depend on the origin volume.