Initial script for partition maximizer

This commit is contained in:
Oswaldo Zerpa
2020-11-26 23:10:36 -05:00
parent c31c162db9
commit 1586e3d3de
+24
View File
@@ -0,0 +1,24 @@
#! /bin/sh
apk add --no-cache parted e2fsprogs-extra
lsblk
read -r -p "Do you want to expand / partition to max available size? Choose \"No\" to continue without expanding partition [y/N]: " response
case $response in
[yY][eE][sS]|[yY])
echo "Expanding / partition..."
PARTEND=`printf %s\\n 'unit GB print list' | parted | grep "Disk /dev/sda" | cut -d' ' -f3 | tr -d GB`GB
parted /dev/sda ---pretend-input-tty <<EOF
resizepart
3
yes
$PARTEND
quit
EOF
resize2fs /dev/sda3
echo "done"
echo ""
;;
*)
echo "continuing...."
;;
esac
lsblk