3

On xfs file systems, I was under the impression that:

# xfs_info /dev/mapper/rootvg-root
meta-data=/dev/sda1              isize=512    agcount=16, agsize=1285043 blks
         =                       sectsz=4096   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=19730834, imaxpct=25
         =                       sunit=64      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=5119, version=2
         =                       sectsz=4096   sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

imaxpct=25 - is the percentage of filesystem space inodes can potentially take up

isize=512 - the bytes size of each single inode

So when I look at my setup below:

# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-root        80G  42G   38G   51% /

# df -hi
Filesystem                   Inodes IUsed IFree IUse% Mounted on
/dev/mapper/rootvg-root        1.3M   27K   1.3M    1% /

How is it possible that I could have a maximum number of only 1.3 million inodes? If each inode is 512bytes, then that means that total amount of disk space the inodes can take up (if fully used) is only 665mb. Wherewas 25% of 80gb is 20gb, so I would expect a lot more inodes than this.

I don't see any option in mkfs.xfs to determine a numerical number for inodes, rather only size of each inode and percentage of file system inode can take up.

Any ideas of what I'm missing here? This is for rhel 7, xfs file system.

2

Unlike classic Unix filesystems, XFS will not allocate all the inodes at mkfs time. Instead, it will create new inodes according to demand, until it hits the imaxpct limit. This keeps the disk space "wasted" to unused inodes to a minimum.

And if the default imaxpct limit turns out to be incorrect for your usage, you can adjust it with the -m option of the xfs_growfs utility, while the filesystem is mounted and active.

The side effect of this is, the Inodes value of df -i will not reflect the maximum available number of inodes on the filesystem until the filesystem has actually had a reason to create enough inodes to hit the imaxpct limit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.