core: 扩容时更优雅地找到当前硬盘

This commit is contained in:
bin456789 2023-10-22 00:42:06 +08:00
parent 43aad6f533
commit 5252f1e581
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -22,7 +22,8 @@ update_part() {
# 找出主硬盘
# shellcheck disable=SC2010
xda=$(mount | awk '$3=="/" {print $1}' | grep -Eo 'sda|hda|xda|vda|xvda|nvme0n1')
root_drive=$(mount | awk '$3=="/" {print $1}')
xda=$(lsblk -r --inverse "$root_drive" | grep -w disk | awk '{print $1}')
# 删除 installer 分区
installer_num=$(readlink -f /dev/disk/by-label/installer | grep -o '[0-9]*$')