#!/bin/bash set -euo pipefail partition_device="$(findmnt -no SOURCE /)" partition_number="$(echo "$partition_device" | perl -ne '/(\d+)$/ && print $1')" disk_device="$(echo "$partition_device" | perl -ne '/(.+?)\d+$/ && print $1')" # resize the partition table. parted ---pretend-input-tty "$disk_device" <