I was wondering what the default journal size is for ext4
when it's built on a single partition? Or does it vary in size
Jeff Layton wrote:
> Good afternoon!
> I was wondering what the default journal size is for ext4
> when it's built on a single partition? Or does it vary in size
> as needed?
See figure_journal_size() in mke2fs.c. It's called w/ size == -1
if no other size is specified on the commandline so that goes
to ext2fs_default_journal_size(), which is pretty straightforward
in its scaling with nr of filesystem blocks:
* Find a reasonable journal file size (in blocks) given the number of blocks
* in the filesystem. For very small filesystems, it is not reasonable to
* have a journal that fills more than half of the filesystem.
int ext2fs_default_journal_size(__u64 blocks)
if (blocks < 2048)
if (blocks < 32768)
if (blocks < 256*1024)
if (blocks < 512*1024)
if (blocks < 1024*1024)