#!/bin/bash

DEVICE="/dev/sda"
PARTITION_NUMBER=2
echo "Зміна розміру розділу ${PARTITION_NUMBER} на дискі ${DEVICE}..."

sudo parted "${DEVICE}" ---pretend-input-tty <<EOF
resizepart ${PARTITION_NUMBER} 95%
Yes
quit
EOF

sudo partprobe "${DEVICE}"
sudo resize2fs "${DEVICE}${PARTITION_NUMBER}"

echo "Готово."

