Bug 1183077 - parted(8) man page mkpart part-type should be name for GPT disks
Summary: parted(8) man page mkpart part-type should be name for GPT disks
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: parted
Version: 24
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-16 16:01 UTC by Jeff Bastian
Modified: 2016-06-16 00:31 UTC (History)
1 user (show)

Fixed In Version: parted-3.2-21
Clone Of:
Environment:
Last Closed: 2016-06-16 00:31:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jeff Bastian 2015-01-16 16:01:51 UTC
Description of problem:
The parted(8) man page states:
             mkpart part-type [fs-type] start end
                     Make  a  part-type  partition  for filesystem fs-type (if
                     specified), beginning at start  and  ending  at  end  (by
                     default  in megabytes).  part-type should be one of "pri‐
                     mary", "logical", or "extended".

This is true for DOS partition tables, but not for GPT.  On GPT disks, the part-type is actually the name or label for the partition.  Thus, if you specify "primary" as the man page indicates, you get a bunch of partitions with the label "primary".

~]$ parted -s /tmp/disk.img mkpart primary 0 100
~]$ parted -s /tmp/disk.img mkpart primary 100 200
~]$ parted -s /tmp/disk.img mkpart primary 200 300
~]$ parted -s /tmp/disk.img print
...
Number  Start   End    Size    File system  Name     Flags
 1      17.4kB  100MB  100MB                primary
 2      100MB   200MB  100MB                primary
 3      200MB   300MB  99.6MB               primary


The GNU info page has a better explanation:

~]$ info parted "Using Parted" "Command explanations" mkpart
...
 -- Command: mkpart [PART-TYPE FS-TYPE NAME] START END
...
     PART-TYPE is one of 'primary', 'extended' or 'logical', and may be
     specified only with 'msdos' or 'dvh' partition tables.  A NAME must
     be specified for a 'gpt' partition table.  Neither PART-TYPE nor
     NAME may be used with a 'sun' partition table.


Version-Release number of selected component (if applicable):
parted-3.2-4.fc21.x86_64

How reproducible:
always

Steps to Reproduce:
1. man parted
2. truncate -s 1G /tmp/disk.img
3. parted -s /tmp/disk.img mklabel gpt
4. parted -s /tmp/disk.img mkpart primary 0 100
5. parted -s /tmp/disk.img print

Actual results:
"primary" is the name, not the type, so you have to fix the name with the 'name' command, e.g.
  parted -s /tmp/disk.img name 1 "/tmp"

Expected results:
man page clearly explains that the first argument for mkpart is a type for DOS partition tables and a name for GPT

Additional info:

Comment 1 Fedora End Of Life 2015-11-04 14:07:07 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Brian Lane 2015-11-05 23:06:08 UTC
https://github.com/bcl/parted/pull/3

Comment 3 Jan Kurik 2016-02-24 15:40:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 4 Mike McCune 2016-03-28 22:18:06 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions


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