GNU bug report logs - #21151
Strange behaviour when using interactive vs non-interactive mode - is this a bug?

Previous Next

Package: parted;

Reported by: Adam Baxter <voltagex <at> voltagex.org>

Date: Tue, 28 Jul 2015 15:22:01 UTC

Severity: normal

To reply to this bug, email your comments to 21151 AT debbugs.gnu.org.

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#21151; Package parted. (Tue, 28 Jul 2015 15:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Adam Baxter <voltagex <at> voltagex.org>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Tue, 28 Jul 2015 15:22:02 GMT) Full text and rfc822 format available.

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

From: Adam Baxter <voltagex <at> voltagex.org>
To: bug-parted <at> gnu.org
Subject: Strange behaviour when using interactive vs non-interactive mode - is
 this a bug?
Date: Tue, 28 Jul 2015 08:20:59 -0700
[Message part 1 (text/plain, inline)]
Hi all,
With the following script and parted 3.2

#!/bin/bash
image=blank.img
dd if=/dev/zero of=$image bs=1M count=32
sync
cat <<-EOF | parted -s $image
        mklabel msdos
        mkpart primary ext2 0 100%
        set 1 boot on
EOF
sync
file $image

I see different results if parted is invoked with -s or without.

*With* -s, the call to file results in "blank.img: data" and there's no
partitions in the disk image.
*Without* -s,

Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)         mklabel msdos
(parted)         mkpart primary ext2 0 100%
Warning: The resulting partition is not properly aligned for best
performance.
(parted)         set 1 boot on
(parted) quit
blank.img: DOS/MBR boot sector; partition 1 : ID=0x83, active, start-CHS
(0x0,0,2), end-CHS (0x1ff,3,32), startsector 1, 65535 sectors

Removing the quit command makes no difference.

The script without -s will crash at least parted 2.3.


Thanks,
Adam Baxter
[Message part 2 (text/html, inline)]

Information forwarded to bug-parted <at> gnu.org:
bug#21151; Package parted. (Tue, 28 Jul 2015 22:41:02 GMT) Full text and rfc822 format available.

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

From: "Brian C. Lane" <bcl <at> redhat.com>
To: Adam Baxter <voltagex <at> voltagex.org>
Cc: 21151 <at> debbugs.gnu.org
Subject: Re: bug#21151: Strange behaviour when using interactive vs
 non-interactive mode - is this a bug?
Date: Tue, 28 Jul 2015 15:40:32 -0700
On Tue, Jul 28, 2015 at 08:20:59AM -0700, Adam Baxter wrote:
> Hi all,
> With the following script and parted 3.2
> 
> #!/bin/bash
> image=blank.img
> dd if=/dev/zero of=$image bs=1M count=32
> sync
> cat <<-EOF | parted -s $image
>         mklabel msdos
>         mkpart primary ext2 0 100%
>         set 1 boot on
> EOF
> sync
> file $image
> 
> I see different results if parted is invoked with -s or without.
> 
> *With* -s, the call to file results in "blank.img: data" and there's no
> partitions in the disk image.
> *Without* -s,

Don't put the commands on separate lines when using -s:

parted -s $image mklabel msdos mkpart primary ext2 0 100% set 1 boot on

> 
> Welcome to GNU Parted! Type 'help' to view a list of commands.
> (parted)         mklabel msdos
> (parted)         mkpart primary ext2 0 100%
> Warning: The resulting partition is not properly aligned for best
> performance.
> (parted)         set 1 boot on
> (parted) quit
> blank.img: DOS/MBR boot sector; partition 1 : ID=0x83, active, start-CHS
> (0x0,0,2), end-CHS (0x1ff,3,32), startsector 1, 65535 sectors
> 
> Removing the quit command makes no difference.
> 
> The script without -s will crash at least parted 2.3.

That's likely fixed in newer versions.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)




This bug report was last modified 9 years and 327 days ago.

Previous Next


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