[parted-devel] [PATCH] parted: Fix resizepart command
Phil Susi
psusi at ubuntu.com
Wed Sep 20 17:14:10 UTC 2017
On 9/20/2017 10:51 AM, Sebastian Parschauer wrote:
> Okay, it is only in the 'Yes' case and I mean that parted asks for the
> end although it has been provided on the command line already.
>
> # parted /dev/sda resizepart 1 100%
> Warning: Partition /dev/sda1 is being used. Are you sure you want to
> continue?
> Yes/No? yes
> End? [2147MB]?
>
> Okay, the patch description has to be reworked in this regard.
>
> What about this?:
>
> "The check and the warning for that are located in the middle of
> parameter checking. If telling parted to continue anyways, then it asks
> for the partition end although it has been provided as a parameter
> already. So move that after parameter checking."
I see now. I believe it used to be that it would consume the "1"
command line argument as the answer to the yes/no question. I think
there was a patch to fix that a while ago. I had thought it just made
the exception handler not take input from the command line, but now it
appears to discard the remainder of the command line. It shouldn't be
doing that.
By moving the check, if you answer No, then you first get prompted for
the end, even though it is a moot point. Interactively it would be nice
to avoid this, but when using the command line, it is probably better
your way since otherwise, answering No and skipping the End question
would leave the end value in the command line buffer and then try to
interpret that as another command.
More information about the parted-devel
mailing list