Friday, 20 June 2014

Change the default size of an inode


It is possible to define a non-standard sized inode by using the mke2fs tool with an undocumented option, -I. The size of the inode has to be a power of two and between the size of EXT2_GOOD_OLD_INODE_SIZE (128 bytes) and size of blocks in bytes. One reason for doing this could be that user is going to use extended attributes. Extended attributes are arbitrary name/value pairs used to store system objects like Access Control Lists (ACL). If the size of the inodes is larger than the default size, then sufficiently small attributes can be stored in inode

tune2fs -l /dev/mapper/VGdata-LVdata | grep Inode
Inode count:              1572864
Inodes per group:         8192
Inode blocks per group:   512
Inode size:               256

mke2fs -I 8192 /dev/mapper/VGdata-LVdata
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1572864 inodes, 6291456 blocks
314572 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
192 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

tune2fs -l /dev/mapper/VGdata-LVdata | grep Inode
Inode count:              3276800
Inodes per group:         16384
Inode blocks per group:   1024
Inode size:               256

Ref: http://magazine.redhat.com/2007/04/23/how-can-i-change-the-default-size-of-an-inode-when-i-create-an-ext2ext3-filesystem/

No comments:

Post a comment