Error behavior in "print" command does not work well in a pipeline

Bug #1900344 reported by Kevin O'Gorman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
New
Undecided
Unassigned

Bug Description

I've got a script that includes "parted <device> print" in a pipeline with other things processing the output. This works fine usually, but I just saw the error

Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.

and processing appeared to freeze because the following "OK/Cancel" does not include a newline and the pipeline held it in a buffer so it never appeared on the console. There would be no way to answer anyway.

So consider this two or three feature requests:
- Since the message says "that one will be used" make to program just do that (it's just a "print" after all.)
- Provide an option to assume "yes" for such questions (or to assume cancel")
- Provide a command to fix the broken table with data from the good one

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: parted 3.3-4
ProcVersionSignature: Ubuntu 5.4.0-48.52-generic 5.4.60
Uname: Linux 5.4.0-48-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckResult: skip
Date: Sun Oct 18 11:16:37 2020
InstallationDate: Installed on 2020-09-19 (29 days ago)
InstallationMedia: Xubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
SourcePackage: parted
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I haven't checked it will help in your situation, but parted has a --script command line flag which is documented as "never prompts for user intervention" -- are you using that?

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

When I use that, it does not ask for confirmation, and will not make changes. Does not help me fix problems that arise with secondary GPT tables being slightly off when disks are of slightly different size. I see no other command-line utility that can do it at all, so I'd love it if this one could do it in a script.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.