linuxfilesystemsxfs

How to reduce the default metadata size for an XFS file system?


I have a special-purpose 12-disk volume, 48 TB total. After mkfs with default parameters, mounting using inode_64, the reported available space for files is 44 TB. So there is 4 TB metadata overhead, almost 10%.

I'm thinking this metadata size is probably intended to accomodate tens of millions of inodes, whereas I use only large files and would need 1-2 million files max. Given this, my question is whether it's possible to recover 2-3 TB out of the 4 TB metadata, to use for file data.

In the man page I see a maxpct option, possibly others, but I cannot figure out what is the correct way to use them in my case. I still need to make sure that the volume can hold the 2 million files. Also, I understand some metadata space is used for journaling and here I don't know how much would be enough.


Solution

  • Based on the specific percentage of storage that you're seeing missing, it seems likely that you're being misled by the difference between binary and decimal units of storage. Since disks are measured in decimal terabytes, using software tools that measure available storage in binary terabytes (which are 10% larger) will give you results that appear to be about 9% too low. The storage hasn't actually gone anywhere, though; you're just using units that make it look smaller!

    By default, the coreutils versions of the df and du commands use binary units. You can use the -H flag to make them use decimal units instead.