Bug 224681 - "parted --script <dev> mklabel msdos" no longer works
Summary: "parted --script <dev> mklabel msdos" no longer works
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: parted
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: David Cantrell
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-01-26 23:54 UTC by Nick Dokos
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-09-13 21:19:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nick Dokos 2007-01-26 23:54:52 UTC
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):
parted-1.8.1-4.el5

How reproducible:
Always

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
3.
  
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
follows:
 
       -s, --script
              never prompt the user.


Additional info:

Comment 1 David Cantrell 2007-09-13 21:19:50 UTC
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-14 00:27:31 UTC
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?

Thanks!



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