[Bug 1490608] Re: parted allows to fix broken GPT only interactively

Phillip Susi psusi at ubuntu.com
Fri Sep 18 13:37:16 UTC 2015


The fix code gets run based on the response the exception handler gives.
The exception handler returns the default answer for all exceptions when
in script mode, and the default for that one is not to fix it.  Thus, to
get it to say yes, fix it, you need the exception handler to recognize
the specific exception and return the fix it response.

There is another way of accomplishing what you want though and that is
to fake interactive mode.  If you pass, I believe it was ---pretend-
input-tty, you can run parted in interactive mode even though you have
redirected it from a file.  You can then script the commands to do the
resize, and then answer fix it.  Of course, this relies on knowing in
advance the exact responses you will get from parted, and they must not
deviate from that.

I suppose the other option is to change the default for that error to
fix.  I didn't do that originally because there are times when that
might be the wrong thing to do and it could cause data loss, so didn't
seem appropriate to do without user consent.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to parted in Ubuntu.
https://bugs.launchpad.net/bugs/1490608

Title:
  parted allows to fix broken GPT only interactively

Status in parted package in Ubuntu:
  Triaged

Bug description:
  when physically resizing a disk (i.e. because it is a kvm image where
  you dd zeros to the end or because you dd'ed an image from a smaller
  disk to a bigger one) the GPT backup at the end of the device sits in
  the wrong sectors ...

  while parted offers you a yes/no question in interactive mode to fix
  this, there is no way to make use of this feature when using "parted
  -s" (scripted mode). parted should get an option to fix the GPT even
  when using it non-interactively i.e. from a "grow rootfs at first boot
  to full disk size" script.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions



More information about the foundations-bugs mailing list