[Bug 1490608] Re: parted allows to fix broken GPT only interactively
This bug was fixed in the package parted - 3.5-1 --- parted (3.5-1) unstable; urgency=medium * Simplify some debhelper overrides slightly. * New upstream release: - Add --fix to --script mode to automatically fix problems like the backup GPT header not being at the end of a disk (LP: #1490608). -- Colin Watson Tue, 19 Apr 2022 17:05:20 +0100 ** Changed in: parted (Ubuntu) Status: Triaged => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
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 Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
oh, thats awesome, i'll play with --pretend-input-tty, didnt know about that before ... i think it already prints the error for the print command so i can run that first and separated from the actual actions (locales wont be an issue inside the initrd) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
Also I *think* that if you just don't use -s, you can put the "fix" command right on the command line following the print command and that will do it, but that behavior is really a bug in itself that I was planning on fixing at some point. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
oh, and note that i know beforehand that there is a GPT and that i want to resize (and i even know the GPT backup wont sit at the end), i have all that info before attempting to run parted, so in my specific case i wouldn't need the exception handler at all. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
ugh, indeed i didnt mean to have the cmdline option hooked to the text handler but simply have it run whatever gets executed to fix the gpt without interaction or anything ... we currently need to use an awfully hackish workaround to do the auto-resize on snappy images (store original table, create a brand new gpt and restore the old table) and i would like to somehow fix this before the next stable snappy release (in 4-8 weeks). i could indeed switch to gdisk but i'd really rather like to use parted as it is the traditionally used partitioning tool in ubuntu. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
I've been aware of this for a few years now since I first added the feature and sebner wanted to use it in the cloud-init-tools to do just that. The problem is that the exception handler only gets a text description, so you would need to do a loose string comparison to identify the particular exception you want to auto accept. You then need a way to specify this with a command line switch. I'm not liking the idea of parted --force-not_all_of_the_space_available Also the exact text is subject to change between releases, and changes depending on your locale, so it gets really tricky. ** Changed in: parted (Ubuntu) Status: Confirmed => Triaged ** Changed in: parted (Ubuntu) Importance: Undecided => Low -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: parted (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
it is in libparted/labels/gpt.c: 1033 q = ped_exception_throw 1034 (PED_EXCEPTION_WARNING, 1035 PED_EXCEPTION_FIX | PED_EXCEPTION_IGNORE, 1036 _("Not all of the space available to %s appears " 1037"to be used, you can fix the GPT to use all of the " 1038"space (an extra %llu blocks) or continue with the " 1039"current setting? "), disk->dev->path, 1040 (uint64_t) (last_usable_if_grown - last_usable)); that gets me a "Fix/Ignore" prompt. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1490608] Re: parted allows to fix broken GPT only interactively
What exactly is the message you get in interactive mode? this would help track down the relevant code. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1490608 Title: parted allows to fix broken GPT only interactively To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1490608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs