Interview Prep/Linux/Storage, disks and filesystems

A batch job writes millions of tiny files per day. Which filesystem and options would you pick?

AdvancedScenarioStorage, disks and filesystems
Answer

Situation read → Inode density and metadata performance matter more than throughput.

What I'd do →

  1. Prefer XFS: inodes are allocated dynamically, so you don't run out early.
  2. If ext4 is required, format with more inodes: mkfs.ext4 -i 4096 /dev/sdb or -N <count>.
  3. Mount with noatime to avoid a metadata write on every read.
  4. Use a directory hashing scheme (ab/cd/abcdef...) so no single directory holds millions of entries.
  5. Reconsider the design: object storage or packing files into archives is often better.

Why → ext4 fixes the inode count at format time; tiny files exhaust inodes before blocks.

Interview tip → Show you'd monitor df -i alongside df -h.

All Linux questions Roadmap: Linux

More on Storage, disks and filesystems