debian: dd 云镜像后对分区扩容,防止首次启动 kernel panic

This commit is contained in:
bin456789 2023-08-03 23:02:12 +08:00
parent 899ced4011
commit 52473bd5d0
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -788,6 +788,15 @@ EOF
dd if=/first-1M of=/dev/$xda
update_part /dev/$xda
# 修复 vultr 512m debian 10/11 generic/genericcloud 首次启动 kernel panic
if [ "$distro" = debian ]; then
apk add parted
if parted /dev/$xda -s print 2>&1 | grep 'Not all of the space'; then
printf "fix" | parted /dev/$xda print ---pretend-input-tty
printf "yes" | parted /dev/$xda resizepart 1 100% ---pretend-input-tty
update_part /dev/$xda
fi
fi
modify_dd_os
fi