mkfs.ext4 添加 -F

如果旧文件系统是 xfs, mkfs.ext4 会提示是否格式化,加 -F 不弹提示,强制格式化
This commit is contained in:
bin456789 2023-05-07 21:09:34 +08:00
parent 0aac4fe2af
commit 910ee0466d
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -54,8 +54,8 @@ if [ -d /sys/firmware/efi ]; then
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.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 -- \
@ -66,8 +66,8 @@ elif [ "$disk_size" -ge "$disk_2t" ]; then
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
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
# 挂载主分区