#!/bin/bash
disk=$(ll /dev/|grep da | awk -F , '{print $2}'| awk 'NR==1 {print $5}')
# fix disk and use all space
printf "fix\n" | parted ---pretend-input-tty /dev/$disk print
# Resize /dev/vda2 partition
printf "yes\n" | parted ---pretend-input-tty /dev/$disk "resizepart 2 100%"
#
# Resize Btrfs filesystem
btrfs filesystem resize max /
