Determine existing journal size on an Internal journal for EXT3 / EXT4 / LDISKFS file systems

Just a quick note about figuring out existing internal journal sizes for EXT3 / EXT4 and LDISKFS file systems:

First thing to do is determine the current inode block, this is usually inode 8, however this may change depending on the file system, so it’s worth checking for sure:

# tune2fs -l /dev/sdXY | grep -i "journal inode"

This command returns the inode at which the journal resides

Journal inode: 8

Next you’ll need to probe that inode directly with the debugfs tool. This can be done with the following commands

debugfs /dev/sdXY
debugfs 1.42.9 (4-Feb-2014)
debugfs: stat <8>

Which results in the following output:

Inode: 8   Type: regular    Mode:  0600   Flags: 0x80000
Generation: 0    Version: 0x00000000:00000000
User:     0   Group:     0   Size: 134217728
File ACL: 0    Directory ACL: 0
Links: 1   Blockcount: 262144
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x54278f31:00000000 -- Sat Sep 27 22:31:45 2014
 atime: 0x54278f31:00000000 -- Sat Sep 27 22:31:45 2014
 mtime: 0x54278f31:00000000 -- Sat Sep 27 22:31:45 2014
crtime: 0x54278f31:00000000 -- Sat Sep 27 22:31:45 2014
Size of extra inode fields: 28
EXTENTS:
(0-32766):2655233-2687999, (32767):2688000

What we’re interested in here, is the Blockcount

Links: 1   Blockcount: 262144

So in this case we have 262144, 4096 byte blocks, which equals 128 megabytes

Also, on some newer versions of debugfs, the tool will calculate the size of the inode based on block count. This calculation can be seen in the Size: field

User:     0   Group:     0   Size: 134217728

Leave a Reply

Your email address will not be published. Required fields are marked *