From 2f342404c157f130129784f2592eaadf0930beab Mon Sep 17 00:00:00 2001 From: Etienne Dechamps Date: Thu, 20 Sep 2012 12:00:50 +0200 Subject: [PATCH] Force 4K blocksize when testing ext2 on zvol. Currently, mkfs.ext2 on zconfig.sh zvols tries to use a 8K blocksize, probably because by default zvol exposes an optimal I/O size of 8K. Unfortunately, a ext2 blocksize of 8K is not supported by the kernel, so the resulting filesystem is unmountable. This patch fixes the issue by making sure the blocksize is 4K. We have to use -F to force it else mkfs.ext2 won't allow us to use a blocksize smaller than the optimal I/O size. Signed-off-by: Brian Behlendorf Closes #979 --- scripts/common.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/common.sh.in b/scripts/common.sh.in index 71a6b18..0e792db 100644 --- a/scripts/common.sh.in +++ b/scripts/common.sh.in @@ -342,7 +342,9 @@ format() { local DEVICE=$1 local FSTYPE=$2 - /sbin/mkfs.${FSTYPE} -q ${DEVICE} || return 1 + # Force 4K blocksize, else mkfs.ext2 tries to use 8K, which + # won't mount + /sbin/mkfs.${FSTYPE} -b 4096 -F -q ${DEVICE} || return 1 return 0 } -- 1.8.3.1