Bug 1056376

Summary: gdisk doesn't know about Linux LVM partitions
Product: [Fedora] Fedora Reporter: Cristian Ciupitu <cristian.ciupitu>
Component: gdiskAssignee: Terje Røsten <terje.rosten>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 20CC: orion, rodsmith, terje.rosten
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-25 15:28:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cristian Ciupitu 2014-01-22 04:31:40 UTC
Description of problem:
gdisk doesn't know about Linux LVM partitions - PVs (physical volumes).

Version-Release number of selected component (if applicable):
gdisk-0.8.8-1.fc20.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. gdisk /dev/sdc

Actual results:
   8       453761024      1477754879   488.3 GiB   8E00  

Expected results:
   8       453761024      1477754879   488.3 GiB   8E00  Linux LVM

Additional info:
fdisk output:

/dev/sdc8     453761024   1477754879 488.3G Linux LVM

Comment 1 Terje Røsten 2014-01-25 14:25:00 UTC
Thanks for your report.

Comment 2 Rod Smith 2014-01-25 15:25:45 UTC
You're misinterpreting the final column -- the one you claim should contain the string "Linux LVM". That column contains the GPT partition name data. See http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_entries; it's the final (72-byte) entry in the "GUID partition entry format" table. GPT fdisk will set this value to something descriptive of the partition type when it CREATES a new entry, and it will change the name to something descriptive when changing the type code IF the original value matches its own internal description. When reading an existing partition table, though, gdisk simply reads what's there and displays it. Thus, if the partition table was created by a tool that doesn't set this field (or more precisely, sets it to a null string), gdisk shows nothing in that column. You can change it to whatever you like by using the "c" option on the main menu.

Comment 3 Cristian Ciupitu 2014-01-25 15:50:18 UTC
Thanks for the explanation, Rod Smith. Then perhaps this is a bug or a missing feature of fdisk.

Comment 4 Rod Smith 2014-01-25 18:12:18 UTC
Linux fdisk was designed for MBR partition tables, which don't support partition names, so it doesn't present them on MBR disks; instead, it presents a description of the partition based on the type code. When I wrote gdisk, I tried to replicate the fdisk user interface as much as possible, but fitting both a type-code-based description and a name on a single line would have resulted in a cramped display and probable truncation of one or both fields, so I opted to show the name alone, instead relying exclusively on the type code field to convey type code information. Both my cgdisk and the latest version of fdisk present both a description and a name on a single line for GPT disks, but one or both is likely to be truncated. None of these conditions constitutes a bug. You could argue that omitting one piece of information or another is a missing feature, but the fact is that there's enough information to be presented that it won't all fit completely on one line, so some sort of compromise is required. As shown on the GPT Wikipedia page (http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_entries), GPT partition entries are 128 bytes in length. Even compressing the 72 bytes for the name to 36 characters (since it's encoded in UTF-16), it would take a 100-character line to display all that information -- and that's without spacing between elements and other human formatting niceties. If you compare gdisk, cgdisk, the latest fdisk, and parted, you'll see that each program omits certain pieces of information from its default display. (All also display additional information, such as partition number, partition size, or the filesystem that's ACTUALLY in the partition, as opposed to the type code.) Both gdisk and cgdisk enable you to see all the information on a partition stored in the data structure via the "information" ("i") option, but that takes EIGHT LINES to summarize (with English labels).

Any of these programs is adequate for casual use, but if you need access to particular information, it behooves you to understand both the GPT data structures themselves and what information from those data structures (and from elsewhere) each program displays and enables you to change. Similar comments apply to MBR, but as MBR is simpler and as both fdisk and parted were designed first for MBR, there are fewer compromises in these programs' MBR support.

Comment 5 Cristian Ciupitu 2014-01-25 18:42:36 UTC
I understood the limitations of the display the first time, I was only
trying to say that fdisk could set that field when creating or toggling
the type of a partition, so that users of gdisk would see something. The
GUID or even better the content is what matters in the end, but it's
nevertheless nice to also have a human readable description.

Anyway, sorry for the false alarm and thank you for the i command hint.
I shall also update bug #1056375 which is related to fdisk.

Comment 6 Rod Smith 2014-01-25 19:47:46 UTC
Ah, yes, I see what you're saying. Yes, having some sort of description in the name field is desirable, no matter what tool you use to create the partition. Filing a request for this feature against a program that doesn't do so is certainly reasonable.

Comment 7 Cristian Ciupitu 2014-01-25 22:14:57 UTC
For your information I've reported bug #1057894.