From 9be306830e3ecd4a2d4235dc4049b4f7936bb3d8 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Mon, 7 Aug 2023 23:30:14 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E6=9B=B4=E7=B2=BE=E7=A1=AE=E5=9C=B0?= =?UTF-8?q?=E6=89=BE=E5=87=BA=E7=B3=BB=E7=BB=9F=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resize.sh b/resize.sh index c1a795c..1ed6f18 100644 --- a/resize.sh +++ b/resize.sh @@ -21,9 +21,8 @@ update_part() { # ubuntu grownpart # 找出主硬盘 -# xda=$(lsblk -dn -o NAME | grep -E 'nvme0n1|.da') # shellcheck disable=SC2010 -xda=$(ls /dev/ | grep -Ex 'sda|hda|xda|vda|xvda|nvme0n1') +xda=$(mount | awk '$3=="/" {print $1}' | grep -Eo 'sda|hda|xda|vda|xvda|nvme0n1') # 删除 installer 分区 installer_num=$(readlink -f /dev/disk/by-label/installer | grep -o '[0-9]*$') @@ -55,6 +54,7 @@ update_part /dev/$xda case $part_fstype in xfs) xfs_growfs / ;; ext*) resize2fs /dev/$xda$part_num ;; +btrfs) btrfs filesystem resize max / ;; esac update_part /dev/$xda