Maximum number of files in GPFS
In GPFS we can configure a maximum number of inodes setting per fileset. This value can be online increased/decreased as needed, but never lower than the to the number of allocated inodes in the fileset. The maximum number of files (inodes) in a GPFS file system is documented to be:
The sum of maximum number of inodes per fileset is not allowed to exceed this. Default inode size is 4096 bytes, and the subblock size is variable depending on the file system block size:
| Block size | Subblock size |
|---|---|
| 64 KiB | 2 KiB |
| 128 KiB | 4 KiB |
| 256 KiB | 8 KiB |
| 512 KiB | 8 KiB |
| 1 MiB | 8 KiB |
| 2 MiB | 8 KiB |
| 4 MiB | 8 KiB |
| 8 MiB | 16 KiB |
| 16 MiB | 16 KiB |
The mmchfs --inode-limit switch seems to have a hard limit of
which then is a hard limit no matter what file system capacity we have. If this was all data-in-inode files, it would require a 1024 PiB = 1 EiB sized file system, so I don’t expect this to be a limit I’ll be hitting in the near future.
To test how many inodes we’re allowed to configure, we create a dummy file system on a sparse loopback device of various sizes:
First test different inode sizes:
# dd if=/dev/zero of=/root/diskimage.1PiB seek=1125899906842623 count=1 bs=1
# losetup /dev/loop1 /root/diskimage.1PiB
# echo loop1 generic > /var/mmfs/etc/nsddevices
# chmod 755 /var/mmfs/etc/nsddevices
# cat <<'EOF' > disk.desc
%nsd: device=/dev/loop1
EOF
# mmcrnsd -F disk.desc
# mmcrfs 🐯🦈fs -F disk.desc -n 1 -i 512
# mmchfs 🐯🦈fs --inode-limit 281474976710654
Total file system capacity allows 129354309632 inodes.
Total current inode limit used over all inode spaces is 134217728
Total file system capacity allows setting inode limit to at the most 129354309632 for inode space 0
Input parameter value for inode limit out of range.
mmchfs: tschfileset failed.
mmchfs: Command failed. Examine previous error messages to determine cause.
# mmdelfs 🐯🦈fs
# mmcrfs 🐯🦈fs -F disk.desc -n 1 -i 1024
# mmchfs 🐯🦈fs --inode-limit 281474976710654
Total file system capacity allows 122167959552 inodes.
Total current inode limit used over all inode spaces is 134217728
Total file system capacity allows setting inode limit to at the most 122167959552 for inode space 0
Input parameter value for inode limit out of range.
mmchfs: tschfileset failed.
mmchfs: Command failed. Examine previous error messages to determine cause.
# mmdelfs 🐯🦈fs
# mmcrfs 🐯🦈fs -F disk.desc -n 1 -i 4096
# mmchfs 🐯🦈fs --inode-limit 281474976710654
Total file system capacity allows 91625969664 inodes.
Total current inode limit used over all inode spaces is 134217728
Total file system capacity allows setting inode limit to at the most 91625969664 for inode space 0
Input parameter value for inode limit out of range.
mmchfs: tschfileset failed.
mmchfs: Command failed. Examine previous error messages to determine cause.
This was a 4 MiB block size file system, subblock size 8 KiB. “system” pool has 1099511627776 KiB metadata capacity.
- 512 byte inode size:
- 1024 byte inode size:
- 4096 byte inode size:
This seems to match very well with the documented formula.
Maximum number of inodes for different file system sizes, according to formula and tested for 4 MiB block size, 4K inode size file system:
| File system capacity | Bytes | 64 KiB block size | 128 KiB block size | 256 KiB-4MiB block size | 8-16 MiB block size | Tested 4 MiB block size |
|---|---|---|---|---|---|---|
| 1 GiB | 1073741824 | 174763 | 131072 | 87381 | 52429 | 88064 |
| 10 GiB | 10737418240 | 1747627 | 1310720 | 873813 | 524288 | 874496 |
| 100 GiB | 107374182400 | 17476267 | 13107200 | 8738133 | 5242880 | 8738816 |
| 1 TiB | 1099511627776 | 178956971 | 134217728 | 89478485 | 53687091 | 89479168 |
| 10 TiB | 10995116277760 | 1789569707 | 1342177280 | 894784853 | 536870912 | 894785536 |
| 100 TiB | 109951162777600 | 17895697067 | 13421772800 | 8947848533 | 5368709120 | 8947849216 |
| 1 PiB | 1125899906842620 | 183251937963 | 137438953472 | 91625968981 | 54975581389 | 91625969664 |
| 10 PiB | 11258999068426200 | 1832519379627 | 1374389534720 | 916259689813 | 549755813888 | |
| 100 PiB | 112589990684262000 | 18325193796267 | 13743895347200 | 9162596898133 | 5497558138880 |