From a956e706e5d27eaca44d169aafcc006999dc3eef Mon Sep 17 00:00:00 2001 From: Alessio Igor Bogani Date: Fri, 7 Aug 2020 10:12:50 +0200 Subject: [PATCH] Parted workaround Since 3.3 parted refuses to resize mounted partition in the non-interactively way so use a workaround. --- resize-helper | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resize-helper b/resize-helper index d2ee13a..0af9111 100755 --- a/resize-helper +++ b/resize-helper @@ -43,8 +43,6 @@ DEVICE_NAME=$(echo /sys/block/*/"${ROOT_PART_NAME}" | cut -d "/" -f 4) DEVICE="/dev/${DEVICE_NAME}" PART_ENTRY_NUMBER=$(cat "/sys/block/${DEVICE_NAME}/${ROOT_PART_NAME}/partition") PART_TABLE_TYPE=$(${BLKID} -o value -s PTTYPE "${DEVICE}") -DEVICE_SIZE=$(cat "/sys/block/${DEVICE_NAME}/size") -END_SIZE=$((DEVICE_SIZE - 1)) # in case the root device is not on a partitioned media if [ "x$PART_ENTRY_NUMBER" = "x" ]; then @@ -56,6 +54,6 @@ if [ "$PART_TABLE_TYPE" = "gpt" ]; then ${SGDISK} -e ${DEVICE} ${PARTPROBE} fi -${PARTED} -m ${DEVICE} u s resizepart ${PART_ENTRY_NUMBER} ${END_SIZE} +echo -e "yes\n100%" | ${PARTED} ${DEVICE} ---pretend-input-tty unit % resizepart ${PART_ENTRY_NUMBER} ${PARTPROBE} ${RESIZE2FS} "${ROOT_DEVICE}"