Bug 224681 - "parted --script <dev> mklabel msdos" no longer works
"parted --script <dev> mklabel msdos" no longer works
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: parted (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Cantrell
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2007-01-26 18:54 EST by Nick Dokos
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-09-13 17:19:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nick Dokos 2007-01-26 18:54:52 EST
Description of problem:
I use "parted --script <dev> mklabel msdos" and also
"parted --script <dev> mkpart 0 -1" in scripts,
but they have recently started failing - I think since RHEL5 rcs6
but it may go back to earlier snapshots; I believe it worked in
the beta2 from last October.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Go into parted and change the label of some device to e.g. "loop", then quit.
2.At a shell prompt, say: parted --script <dev> mklabel msdos
Actual results:
# parted --script /dev/sdb mklabel msdos
Warning: The existing disk label on /dev/sdb will be destroyed and all data on
this disk will be lost. Do you want to continue?

and the label does *not* change.

Expected results:
I expect the label of the disk to be set to "msdos". In fact, I expect
no warning since the --script option is documented in the man page as
       -s, --script
              never prompt the user.

Additional info:
Comment 1 David Cantrell 2007-09-13 17:19:50 EDT
Checked latest RHEL 5.1 test builds and the --script option is now working as
expected (i.e., it won't prompt you).

I used your two test commands:
parted --script <dev> mklabel msdos
parted --script <dev> mkpart 0 -1

The mklabel one works fine, but the mkpart one is actually invalid.  It lacks
the partition type.  Also, you can't specify -1 as the ending point.  So I used:

parted --script <dev> mkpart primary 0 1

And that worked.

Closing as nextrelease since this will be fixed in RHEL 5.1.
Comment 2 Nick Dokos 2007-09-13 20:27:31 EDT
How do you specify that the partition is to take up the whole disk?
That's what I used the -1 for: if I cannot use that, is there
another way?

Also, do you have a version number for the package that I should
get to try it out?


Note You need to log in before you can comment on or make changes to this bug.