Work out filesystem inode requirement instantly with clear inputs, formula shown and shareable results.
ext4 allocates inodes at format time, one per bytes-per-inode of capacity, and the count cannot be increased afterwards. The default of 16 KB per inode suits general use but exhausts long before the disk fills when files average a few kilobytes — the classic no space left on device error with gigabytes free. XFS allocates inodes dynamically and avoids the problem.
Inode budget
inodes = filesystem bytes / bytes-per-inode; files expected = filesystem bytes / average file size; table size = inodes x inode size
Not on ext4. You must back up, reformat with a lower bytes-per-inode value, and restore. Plan for the workload before formatting.
XFS and Btrfs allocate inodes dynamically, so they run out only when the disk is genuinely full. That is a strong argument for XFS on mail and cache servers.