On Wed, 2002-04-24 at 02:08, ASANO Masahiro wrote:
> Hi,
>
> What is the maximum number of files per filesystem for XFS?
>
> The inode.i_ino field has 32 bits, so I guess the maximum number
> is 4 giga, is it correct?
>
> --
> Masano
Other people have already provided some of the information here.
On linux the thoretical limit is indeed 4G of inodes, however, as
Eric mentioned, the inode numbers are sparse, so it will probably
be less than that.
Inode numbers actually contain an encoding of the disk address of the
inode. Various factors come into play, but with default mkfs parameters
you have the potential to overflow 32 bits with any filesystem larger
than 1 Tbyte. Larger inode sizes can push this size up somewhat.
In order to deal with the 32 bit limit on Linux, and with issues with
3rd party applications such as Legato Networker on Irix, changes
went in recently which adjust the inode placement policy of XFS to
restrict inodes to the part of the filesystem which keeps them within
32 bits, unless the inode64 mount option is used. The fix is more
complex than that as we need to make data prefer space not suitable
for inodes to avoid filesystems which have lots of space but cannot
create new files.
The other aspect of how many inodes you can have is controlled via
mkfs and growfs. Inode space is restricted to a default 20% of the
disk space.
So for a 1 Tbyte filesystem, the default maximum number of inodes
you could have is around 850 million (inodes are 256 bytes by default).
Since the largest addressable filesystem on Linux is currently 2 Tbytes,
the maximum possible number of inodes with default mkfs options is twice
that.
Note that 4Gbytes of default inodes takes 1 Tbyte of disk storage for
the inodes themselves, so the inode percentage would need to be upped
to 50% for this to be theoretically possible.
The theoretical maximum for XFS without the limits imposed by the
Linux block and vfs layers is probably on the order of 2^6x which
is a very very big number and would probably require the output of
several major drive vendors for a long time to construct, around 115
million 160G drives by my calculation!
Steve
--
Steve Lord voice: +1-651-683-3511
Principal Engineer, Filesystem Software email: lord@xxxxxxx
|