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?
sfdisk -N 2 /dev/loop14and then typing from the keyboard<space>,<space>+7506944K,work?/dev/loop14, and how will look after.+sign. If I simply enter the size as 7506944K, without the plus it works. This obviously works also using the pipe