Initial script for partition maximizer
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user