All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4
@ 2021-05-10 13:47 Thadeu Lima de Souza Cascardo
  2021-05-11  6:19 ` Petr Vorel
  0 siblings, 1 reply; 9+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2021-05-10 13:47 UTC (permalink / raw)
  To: ltp

ext3 and ext4 filesystems will reserve at least 1024 blocks for the
journal.  With a blocksize of 4096, this will be 25% of the filesystem size
without accounting for any other overhead.

/etc/mke2fs.conf will use 1024 block size for small filesystems, which are
between 3M and 512M. However, on recent versions of Ubuntu, this
configuration has changed and thet default blocksize is 4096 even for small
filesystems.

Force the blocksize to 1024 on ext3 and ext4 filesystems, which will lead
to the expected results, as journals will take only 1M.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 testcases/commands/mkfs/mkfs01.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/commands/mkfs/mkfs01.sh b/testcases/commands/mkfs/mkfs01.sh
index 3e3e56719cf3..17c7fb9e4a1a 100755
--- a/testcases/commands/mkfs/mkfs01.sh
+++ b/testcases/commands/mkfs/mkfs01.sh
@@ -96,6 +96,9 @@ mkfs_test()
 	if [ "$fs_type" = "xfs" ] || [ "$fs_type" = "btrfs" ]; then
 		fs_op="$fs_op -f"
 	fi
+	if [ "$fs_type" = "ext3" ] || [ "$fs_type" = "ext4" ]; then
+		fs_op="$fs_op -b 1024"
+	fi
 
 	local mkfs_cmd="mkfs $mkfs_op $fs_op $device $size"
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-12 14:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 13:47 [LTP] [PATCH] mkfs: force block size to 1024 for ext3 and ext4 Thadeu Lima de Souza Cascardo
2021-05-11  6:19 ` Petr Vorel
2021-05-11 10:36   ` Thadeu Lima de Souza Cascardo
2021-05-11 14:19     ` Petr Vorel
2021-05-11 15:28       ` Thadeu Lima de Souza Cascardo
2021-05-12 13:17     ` Cyril Hrubis
2021-05-12 13:55       ` Petr Vorel
2021-05-12 13:59         ` Jan Stancek
2021-05-12 14:18           ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.