Supporting the Maximum Number of Files

To some extent, storing the maximum number of files on a partition is an issue of the efficient allocation of space for small files, as described in the preceding section, "Minimizing Space Consumption." Another factor, though, is the number of available inodes. Most filesystems support a limited number of inodes per disk. These inodes limit the number of files a disk can hold; each file requires its own inode, so if you store too many small files on a disk, you'll run out of inodes. With ext2fs and ext3fs, you can change the number of inodes using the -i or -N options to mke2fs when you create the filesystem. These options set the bytes-per-inode ratio (typically 2 or 4; increasing values decrease the number of inodes on the filesystem) and the absolute number of inodes, respectively. With XFS, you can specify the maximum percentage of disk space that may be allocated to inodes with the maxpct option to mkfs.xfs. The default value is 25, but if you expect the filesystem to have very many small files, you can specify a larger percentage.

ReiserFS is unusual in that it allocates inodes dynamically, so you don't need to be concerned with running out of inodes. This fact also means that the -i option to the df utility, which normally returns statistics on used and available inodes, returns meaningless information about available inodes on ReiserFS volumes.

0 0

Post a comment