GNU bug report logs - #50786
Missing info??

Previous Next

Package: parted;

Reported by: "Michael D. Setzer II" <mikes <at> guam.net>

Date: Fri, 24 Sep 2021 18:51:01 UTC

Severity: normal

Done: "Brian C. Lane" <bcl <at> redhat.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50786 in the body.
You can then email your comments to 50786 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#50786; Package parted. (Fri, 24 Sep 2021 18:51:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Michael D. Setzer II" <mikes <at> guam.net>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Fri, 24 Sep 2021 18:51:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Michael D. Setzer II" <mikes <at> guam.net>
To: bug-parted <at> gnu.org
Subject: Missing info??
Date: Fri, 24 Sep 2021 22:11:17 +1000
I've been working to create an iso image that includes 
both regular usb boot, and UEFI usb boot.
Process works fine. Create a 64M file, and create 
everything to the iso image.
When image is copied to a flash thou, it has an issue since 
the flash is much larger than the 64M.

Both gparted and parted -l will prompt to fix the error 
and do so nicely. 

With parted the -l option does the fix, but it runs on all 
devices in machine, not just the single flash??

Running parted -l shows info on all devices, and then 
prompts to repair.
Warning: Not all of the space available to /dev/sdb 
appears to be used, you can fix the GPT to use all of the 
space (an extra 15499264 blocks) or continue with the 
current setting? 
Fix/Ignore? Fix                                                           
Model: SanDisk Cruzer Blade (scsi)
Disk /dev/sdb: 8003MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  67.1MB  66.0MB  fat16        G4L   boot, esp

Have automated the fix with.
	echo -e "Fix" | sudo parted -l ---pretend-input-tty

Was looking at page on parted, and it doesn't list the -l 
option at all, and don't see the --pretend-input-tty either??

Would like to have the parted -l only run against the flash 
device rather than all devices, but doesn't seem to work 
by adding the device to line..

Not a big deal, but thought I would mention it.

The parted --help does list options.
OPTIONs:
  -h, --help                      displays this help message
  -l, --list                      lists partition layout on all block 
devices
  -m, --machine                   displays machine parseable 
output
  -s, --script                    never prompts for user 
intervention
  -v, --version                   displays the version
  -a, --align=[none|cyl|min|opt]  alignment for new 
partitions

Thanks.





Reply sent to "Brian C. Lane" <bcl <at> redhat.com>:
You have taken responsibility. (Fri, 24 Sep 2021 23:24:02 GMT) Full text and rfc822 format available.

Notification sent to "Michael D. Setzer II" <mikes <at> guam.net>:
bug acknowledged by developer. (Fri, 24 Sep 2021 23:24:02 GMT) Full text and rfc822 format available.

Message #10 received at 50786-close <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: 50786-close <at> debbugs.gnu.org
Subject: Re: bug#50786: Missing info??
Date: Fri, 24 Sep 2021 16:23:43 -0700
You don't mention what version and distribution you are using. Upstream
parted does have -l in the manpage so I'd file a bug with the
distribution.

parted now (or will, depending on whether your distribution includes
patches from master) has a --fix option for your exact problem. When
used along with --script it will automatically fix the size of the disk
and write the backup partition table.

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart





Information forwarded to bug-parted <at> gnu.org:
bug#50786; Package parted. (Sat, 25 Sep 2021 02:29:01 GMT) Full text and rfc822 format available.

Message #13 received at 50786 <at> debbugs.gnu.org (full text, mbox):

From: "Michael D. Setzer II" <mikes <at> guam.net>
To: 50786 <at> debbugs.gnu.org
Subject: Did find more info
 https://unix.stackexchange.com/questions/190317/gnu-parted-resizepart-in-script
Date: Sat, 25 Sep 2021 12:28:21 +1000
Shows it as undocumented command line?? option?
Also, figured it does need 3 dashes. Thought I might have 
mistyped it, and tried it with command and it failed. 
So does need 3 ---. Not sure why it is undocumented??

Note that 'isatty' test, which will fail. The 
'pretend_input_tty' is an undocumented command line 
option, which can be switched on via ---pretend-input-tty.

So, if you want to use parted from a script, my answer is 
the following:

/sbin/parted -a optimal /dev/loop1 ---pretend-input-tty 
resizepart 4 Yes 522239s





Information forwarded to bug-parted <at> gnu.org:
bug#50786; Package parted. (Sat, 25 Sep 2021 02:29:02 GMT) Full text and rfc822 format available.

Message #16 received at 50786 <at> debbugs.gnu.org (full text, mbox):

From: "Michael D. Setzer II" <mikes <at> guam.net>
To: 50786 <at> debbugs.gnu.org
Subject: Reply to reply... Clearing up things.
Date: Sat, 25 Sep 2021 12:28:21 +1000
Perhaps I wasn't clear. The distro I am using does shows
the -l option

The GNU page that I was looking at does not include it.
https://www.gnu.org/software/parted/manual/parted.html

2.3 Command Line Options

When invoked from the command line, Parted supports
the following syntax:

# parted [option] device [command [argument]]

Available options and commands follow. For detailed
explanations of the use of Parted commands, see
Command explanations. Options begin with a hyphen,
commands do not:

Options:

‘-h’
‘--help’

    display a help message
‘-s’
‘--script’

    never prompt the user
‘-a alignment-type’
‘--align alignment-type’

    Set alignment for newly created partitions, valid
alignment types are: none, cylinder, minimal and optimal.
‘-v’
‘--version’

    display the version

While the Fedora 33 distro shows.
OPTIONS
       -h, --help
              displays a help message

       -l, --list
              lists partition layout on all block devices

       -m, --machine
              displays machine parseable output

       -s, --script
              never prompts for user intervention

       -v, --version
              displays the version

       -a alignment-type, --align alignment-type
              Set alignment for newly created partitions, valid
alignment types are:

              none   Use the minimum alignment allowed by
the disk type.

              cylinder
                     Align partitions to cylinders.

              minimal
                     Use minimum alignment as given by the disk
topology information. This and the opt value will use
                     layout information provided by the disk to
align the logical partition table addresses to actual
                     physical blocks on the disks.  The min value
is the minimum alignment needed to align the parti‐
                     tion properly to physical blocks, which
avoids performance degradation.

              optimal
                     Use  optimum  alignment  as given by the
disk topology information. This aligns to a multiple of
                     the physical block size in a way that
guarantees optimal performance.

Neither have anything about ---pretend-input-tty option.

The line I am currently using to do the fixing is:
	echo -e "Fix" | parted -l --pretend-input-tty

It does fix the issue, put the time command in front of it,
and it reports
real	0m17.244s
user	0m0.015s
sys	0m0.025s

If I run parted -l a second time right after it shows.
real	0m0.211s
user	0m0.014s
sys	0m0.018s

So, not clear if the 17 seconds is to doing the repair on
flash, or if the info from first run was used to speed up
second run??
data on program with Fedora 33 is:
90888 Jul 29  2020 /usr/sbin/parted

The man at end shows 2007 March 29??
parted --help doesn't seem to show any date info.
OPTIONs:
  -h, --help                      displays this help message
  -l, --list                      lists partition layout on all block
devices
  -m, --machine                   displays machine parseable
output
  -s, --script                    never prompts for user
intervention
  -v, --version                   displays the version
  -a, --align=[none|cyl|min|opt]  alignment for new
partitions

That has the -l option, but it says it lists all block devices,
so doesn't show that there might be a way to do just one.

Tried piping the Fix , but without the --pretend-input-tty it
seemed to be ignored??

Thanks again. Will see if parted is updated over time.








bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 23 Oct 2021 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.