From ae796ce3338e95e58bef9333d8409307d19e8a7c Mon Sep 17 00:00:00 2001 From: bin456789 Date: Fri, 1 Mar 2024 23:26:49 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E4=BF=AE=E5=A4=8D=E7=BC=A9=E5=B0=8F=20?= =?UTF-8?q?btrfs=20=E5=88=86=E5=8C=BA=E6=97=B6=EF=BC=8C=E5=B0=91=E7=BC=A9?= =?UTF-8?q?=E5=B0=8F1=E4=B8=AA=E5=AD=97=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trans.sh b/trans.sh index 65e9101..ceea433 100644 --- a/trans.sh +++ b/trans.sh @@ -1769,13 +1769,13 @@ dd_qcow() { # 缩小分区 part_start=$(parted /dev/nbd0 -s 'unit b print' | awk "\$1==$part_num {print \$2}" | sed 's/B//') part_size=$(btrfs filesystem usage /mnt/btrfs -b | grep 'Device size:' | awk '{print $3}') - part_end=$((part_start + part_size)) + part_end=$((part_start + part_size - 1)) umount /mnt/btrfs printf "yes" | parted /dev/nbd0 resizepart $part_num ${part_end}B ---pretend-input-tty # 缩小 qcow2 disconnect_qcow - qemu-img resize --shrink $qcow_file $part_end + qemu-img resize --shrink $qcow_file $((part_end + 1)) # 重新连接 connect_qcow