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

Adam Baxter <[email protected]>
Newsgroups gmane.comp.gnu.parted.bugs
Message-ID <CAChFQ9QaaNOEgBpxismWkvN943E0Z5-n1AZm=2Po=fRBaRpA1w@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.