How to: Find the inode size of an ext2 / ext3 filesystem

by on November 9, 2007 · 6 comments· LAST UPDATED November 9, 2007

in , ,

Q. I need to find out inode size of my ext3 file system for recovery purpose. How can I find the inode size of an ext2/ext3 filesystem?

A. You need to use tune2fs command, which allows the system administrator to adjust various tunable filesystem parameters on Linux ext2/ext3 filesystems.

Find the inode size of the filesystem

The -l option lists the inode size of the filesystem. Using the same option, other information of the filesystem superblock can also be seen. The superblock contains information about the filesystem, such as the number of free blocks available, and the number of mounts, that may be useful for tuning purposes.
# sudo tune2fs -l /dev/sda2
Output:

tune2fs 1.40.2 (12-Jul-2007)
Filesystem volume name:   
Last mounted on:          
Filesystem UUID:          8c2da865-13f4-47a2-9c92-2f31738469e8
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file
Filesystem flags:         signed directory hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              12222464
Block count:              24412775
Reserved block count:     1220638
Free blocks:              17464715
Free inodes:              12055081
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1018
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         16384
Inode blocks per group:   512
Filesystem created:       Sat Oct  6 04:51:23 2007
Last mount time:          Fri Nov  9 08:07:04 2007
Last write time:          Fri Nov  9 08:07:04 2007
Mount count:              12
Maximum mount count:      32
Last checked:             Mon Nov  5 13:33:36 2007
Check interval:           15552000 (6 months)
Next check after:         Sat May  3 13:33:36 2008
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128
Journal inode:            8
First orphan inode:       1163400
Default directory hash:   tea
Directory Hash Seed:      bcaf359b-11c2-4c1a-8823-92be72c09ac4
Journal backup:           inode blocks

To find the inode size, enter:
# sudo tune2fs -l /dev/sda2 | grep Inode
Output:

Inode count:              12222464
Inodes per group:         16384
Inode blocks per group:   512
Inode size:               128
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 6 comments… read them below or add one }

1 patrick November 20, 2007 at 11:52 am

How to configue a network printer SUSE Linux?

Reply

2 nixCraft November 20, 2007 at 3:49 pm

Run yast config tool, type yast2 at shell prompt and select printer configuration:
yast2

Reply

3 alex January 22, 2009 at 1:57 pm

Need help. Does anybody know how to change inode size? I use Red Hat based Linux.2.4 kernel.

Reply

4 Hemo March 11, 2009 at 6:17 pm

You need to back everything up and reformat the filesystem if you want to change the inode size. man mkfs

Reply

5 Jas October 21, 2009 at 11:36 pm

Thanks for the info Vivek, what was the size of your /dev/sda2 disk out of interest and would you agree on this calculation? Based on the above output:

inode count x inode size = Total inode Size in Bytes
12222464 x 128 = 1564475392 bytes [1.45GB of Inode Data]

FLAME: Patrick why are you contaminating this thread with irrelevant questions that are in no relation to inode data?. Did you even try a simple web search lazy prick.

Reply

6 taps July 9, 2011 at 12:34 pm

also you can use this command:
df -i /dev/sda2

Reply

Leave a Comment

Tagged as: , , , , , , , , , ,

Previous Faq:

Next Faq: