utils
utils copied to clipboard
Add mkfs customize arguments when need different mkfs case
Is your feature request related to a problem?/Why is this needed
the xfs has a bug when kernel os below the 5.10 https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/considerati[…]ly_file-systems-and-storage_considerations-in-adopting-rhel-9
High level of xfs default enable these two arguments bigtime=1 and inobtcount=1, but it will produces the mount failed. The situation happened when xfs in container uses high version but node os version is lower than 5.10. But we use the mount repo is hard code on mkfs arguments. All the options are for mount not mkfs. https://github.com/kubernetes/utils/blob/24370beab75816ab1d2b33fba9e288ee667530dd/mount/mount_linux.go#L368
We met this issue in our production volume driver.
root@root:/# lvcreate -L 1G vg10000 -y
Wiping xfs signature on /dev/vg10000/lvol3.
Logical volume "lvol3" created.
root@host:/# mkfs.xfs /dev/vg10000/lvol3
meta-data=/dev/vg10000/lvol3 isize=512 agcount=4, agsize=65536 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=1
= reflink=1 bigtime=1 inobtcount=1 nrext64=0
data = bsize=4096 blocks=262144, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=16384, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
root@host:/# mount /dev/vg10000/lvol3 /mnt/test
mount: /mnt/test: wrong fs type, bad option, bad superblock on /dev/mapper/vg10000-lvol3, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
root@host:/# mkfs -V mkfs from util-linux 2.39.3 root@host:/# uname -r 5.4.0-89-generic