I have some disk image, taken with
dd if=/dev/somedevice of=filename.img. I was able to shrink them following this tutorial.
Now I would like to script all the procedure, and I managed to perform almost everything, apart the fdisk resize part. I'm trying to resize the partition with this command
echo " , +7506944K," | sfdisk -N 2 /dev/loop14
But independently from the size I use I get an error:
/dev/loop14p2: Failed to resize partition #2.
How can i script the redefinition of the end of a partition? Why is my command failing, can I get some more information somehow?