I'm trying to resize the root partition of a device to go to the end of the disk, like so:

parted /dev/mmcblk0 resizepart 3 -1s

This should grow the third partition to the very end of the device no matter what size the device is. Doing this works in parted's interactive mode, but I need to run this as a single command as part of an ansible playbook (the parted ansible module does not allow you to resize partitions). Is there any other way to specify "I don't care what size the disk is, use it up"?

  • If parted is like other GNU programs, it will accept a double hyphen -- to indicate that nothing following is to be parsed as an option: parted -- /dev/mmcblk0 resizepart 3 -1s – steeldriver Feb 7 at 2:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.