Created
October 27, 2022 21:14
-
-
Save rany2/38a655bf2a377f3b8eb7d50578e0a3b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # requires parted, losetup, and resize2fs | |
| BOOT="$(sed -n -e "\|\s/boot\s.*$|{s///p;q}" /etc/mtab)" | |
| DISK="${BOOT%%[0-9]*}" | |
| PART="$((${BOOT##*[^0-9]}+1))" | |
| printf "fix\n" | parted ---pretend-input-tty ${DISK} print | |
| parted ${DISK} resizepart ${PART} 100% | |
| ROOT="${DISK}${PART}" | |
| LOOP="$(losetup -f)" | |
| losetup ${LOOP} ${ROOT} | |
| resize2fs -f ${LOOP} | |
| losetup -d ${LOOP} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment