Since using fdisk
in this case is fairly complicated due to the fact that the non-interactive usage is probably not possible or at least very complicated (using printf
), I want to use parted resizepart
for resizing a partition to it's maximum size.
This can be utilized in scenarios like actual disk-resize in you cloud/hypervisor and then, you need to adjust your logical volume/pv to the new size (LVM case) or you want to adjust the partition size of a normal partition to it's maximum.
Let's assume I want to resize partition /dev/sda1
on obviously disk /dev/sda1
to its maximum possible size - how would I do this without getting asked any questions at all?
Eventhough parted /dev/sda resizepart 1
exists, it needs me to calculate and enter the maximum disk size - and that is the actual clue I am working on here.