From 910ee0466d42e13e267709e4ce5c8697f148c806 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sun, 7 May 2023 21:09:34 +0800 Subject: [PATCH] =?UTF-8?q?mkfs.ext4=20=E6=B7=BB=E5=8A=A0=20-F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果旧文件系统是 xfs, mkfs.ext4 会提示是否格式化,加 -F 不弹提示,强制格式化 --- ks-trans.cfg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ks-trans.cfg b/ks-trans.cfg index a613e51..8d9c40e 100644 --- a/ks-trans.cfg +++ b/ks-trans.cfg @@ -53,9 +53,9 @@ if [ -d /sys/firmware/efi ]; then mkpart '" "' ext4 -2GiB 100% \ set 1 boot on update_part /dev/$xda - mkfs.fat -F 32 -n efi /dev/${xda}*1 #1 efi - mkfs.ext4 -L os /dev/${xda}*2 #2 os - mkfs.ext4 -L installer /dev/${xda}*3 #3 installer + mkfs.fat -F 32 -n efi /dev/${xda}*1 #1 efi + mkfs.ext4 -F -L os /dev/${xda}*2 #2 os + mkfs.ext4 -F -L installer /dev/${xda}*3 #3 installer elif [ "$disk_size" -ge "$disk_2t" ]; then # bios 2t parted /dev/$xda -s -- \ @@ -65,9 +65,9 @@ elif [ "$disk_size" -ge "$disk_2t" ]; then mkpart '" "' ext4 -2GiB 100% \ set 1 bios_grub on update_part /dev/$xda - echo #1 bios_boot - mkfs.ext4 -L os /dev/${xda}*2 #2 os - mkfs.ext4 -L installer /dev/${xda}*3 #3 installer + echo #1 bios_boot + mkfs.ext4 -F -L os /dev/${xda}*2 #2 os + mkfs.ext4 -F -L installer /dev/${xda}*3 #3 installer else # bios parted /dev/$xda -s -- \ @@ -76,8 +76,8 @@ else mkpart primary ext4 -2GiB 100% \ set 1 boot on update_part /dev/$xda - mkfs.ext4 -L os /dev/${xda}*1 #1 os - mkfs.ext4 -L installer /dev/${xda}*2 #2 installer + mkfs.ext4 -F -L os /dev/${xda}*1 #1 os + mkfs.ext4 -F -L installer /dev/${xda}*2 #2 installer fi # 挂载主分区