Sample Header Ad - 728x90

GNU parted resizepart in script

10 votes
10 answers
17129 views
I would like to used the yes command so that GNU parted does not wait for user input : root@195-xxx-xxx-xxx:/proc# parted /dev/sda unit B resizepart 2 1166016512B Warning: Shrinking a partition can cause data loss, are you sure you want to continue? Yes/No? y Information: You may need to update /etc/fstab. root@195-xxx-xxx-xxx:/proc# echo $? 0 However using yes does not work here : root@195-xxx-xxx-xxx:/proc# yes | parted /dev/sda unit B resizepart 2 166016512B Warning: Shrinking a partition can cause data loss, are you sure you want to continue? root@195-xxx-xxx-xxx:/proc# echo $? 1 Edit: The --script option does not work as well : root@195-xxx-xxx-xxx:/proc# parted --script /dev/sda unit B resizepart 2 1166016512B Warning: Shrinking a partition can cause data loss, are you sure you want to continue? root@195-xxx-xxx-xxx:/proc# echo $? 1
Asked by Xion345 (759 rep)
Mar 15, 2015, 06:36 PM
Last activity: Mar 19, 2025, 03:33 PM