#!/bin/sh roottmp=$(lsblk -l -o MAJ:MIN,MOUNTPOINT | grep '/$') rootpart=/dev/block/${roottmp% /} rootdev=${rootpart%:*}:0 parted -s $rootdev resizepart 2 100% resize2fs $rootpart