The version of mkfs for each type of Linux filesystem provides some options that are specific to that type of filesystem. One of the most interesting options for the mkfs.ext2 command is the -T option, which enables you to invoke predetermined filesystem configuration definitions that are designed to optimize the filesystem for a specific usage pattern. The mkfs.ext2 man page lists among others the following -T options:
■ news: One inode per filesystem block. In this case, each inode would have a 4K block space allocated for data. If you have a large amount of small files on your system (less than 4K), this will provide one inode per filesystem block.
■ largefile: One inode per 1 MB of data allocation. This would be used where most of your files are about 1 MB in size. This makes the dispersal of data across the filesystem less granular but optimizes the amount of inodes needed.
■ largefile4: One inode per 4 MB of data allocation. If your filesystem will primarily store huge files, this will optimize the amount of inodes needed on your system for larger files.
If you are using this filesystem for general purposes, such as to hold the operating system itself, it is a bad idea to use these options because they are not designed for general purpose environments. Linux system partitions such as the root filesystem contain a diverse mixture of small and large files. Under- or over-allocating inodes can prove either disastrous or overzealous for general-purpose use.
Listing 3-6 shows the output of the mkfs.ext2 command when creating an EXT2 filesystem with default settings.
Was this article helpful?