mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
core: 扩容时更优雅地找到当前硬盘
This commit is contained in:
parent
43aad6f533
commit
5252f1e581
@ -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]*$')
|
||||
|
Loading…
x
Reference in New Issue
Block a user