14

Tune2fs allows to change inode size from default (128 bytes on ext3, 256 bytes on ext4) to almost anything, but it should be power of two. What are the reasons for changing default inode size?

Here it's written that this can be done to be able to store ACL attributes inside inodes. What else can be stored inside an inodes?

Is there any reason to increase inode size on modern high-capacity drives (2TB and more)?

Franklin Piat
  • 736
  • 6
  • 22
Vladislav Rastrusny
  • 2,581
  • 12
  • 39
  • 56
  • 1
    I know a reason *not* to change the inode size from 128 bytes - Ext2IFS will no longer be able to mount your partition. If you are using this driver to access your Linux partitions from Windows, you should take care to keep your inode size at 128 bytes. – DevSolar Jun 01 '10 at 22:33
  • @DevSolar Nowadays [in 2015], Ext2IFS is obsolete and ext3 too :-) [How to read ext4 partitions on Windows?](http://superuser.com/q/37512/427727). ext4 defaults to 256 to store some new file attributes. – Franklin Piat Mar 27 '15 at 22:34

4 Answers4

10

I think by default current versions of mkfs.ext2/3/4 default to 256 byte inode size (see /etc/mke2fs.conf). This IIRC enables nanosecond timestamps with ext4, and as you say, more extended attributes fit within the inode. Such extended attributes are, for instance, ACL's, SELinux labels, some Samba specific labels.

Bigger inodes of course waste a little bit of space, and as you make them bigger you get into diminishing returns territory pretty quickly. The default 256 bytes is probably a perfectly good compromise for most situations.

janneb
  • 3,761
  • 18
  • 22
1

Is there any reason to increase inode size on modern high-capacity drives (2TB and more)?

If you want to handle timestamps after 2038, otherwise it won't work.

From mkfs.ext2 manual:

File systems with an inode size of  128  bytes  do  not  support
timestamps  beyond January 19, 2038.  Inodes which are 256 bytes
or larger will support extended timestamps,  project  id's,  and
the ability to store some extended attributes in the inode table
for improved performance.

Note that some distribution have this in /etc/mke2fs.conf:

    small = {
        blocksize = 1024
        inode_size = 128
        inode_ratio = 4096
    }

which means even nowadays small partitions like /boot will have this smaller inode_size.

From mke2fs man page:

If the filesystem size is greater than or equal to 3 but less than 512 megabytes, mke2fs(8) will use the filesystem type small.

Patrick Mevzek
  • 9,273
  • 7
  • 29
  • 42
1

With the ext4 option inline_data (new in Linux 3.8), there is a new good reason for larger inode sizes: Given this option, the file contents can be stored in the inode of the file (if the file is small enough). This avoids one seek operation. I have not seen any real-world benchmarks for this, yet.

Sven
  • 113
  • 3
0

Grub doesn't work with an inode size of 256, so 128 is what I use.

peterh
  • 4,914
  • 13
  • 29
  • 44
mathew
  • 1
  • grub is supporting 256 bytes inode size since 2008, with patches for its version 0.97, see https://forums.fedoraforum.org/showthread.php?191363-256-byte-Inodes-Unpatched-GRUB-No-problem for example. – Patrick Mevzek Mar 28 '22 at 20:11