Bug 962128 - parted should use the Linux filesystem data GUID
parted should use the Linux filesystem data GUID
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: parted (Show other bugs)
20
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Brian Lane
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-11 18:07 EDT by Reartes Guillermo
Modified: 2014-10-07 19:30 EDT (History)
10 users (show)

See Also:
Fixed In Version: parted-3.1-16.fc21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-10-07 19:30:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Reartes Guillermo 2013-05-11 18:07:24 EDT
Description of problem:

GPT partition code 0700 (GUID=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7) is Basic Data Partition (BDP)

FROM: http://en.wikipedia.org/wiki/Basic_data_partition
(BDP) is any partition identified with Globally Unique Identifier (GUID) of EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

Linux typically uses the same partition type GUID for basic data partition as Windows. However, a Linux specific Data Partition GUID 0FC63DAF-8483-4772-8E79-3D69D8477DE4 has been proposed[4] (see GUID Partition Table).

FROM: http://en.wikipedia.org/wiki/GUID_Partition_Table#endnote_linwinb

C. a b Previously Linux used the same GUID for the data partitions as Windows (Basic data partition: {EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}). Linux never had a separate unique partition type GUID defined for its data partitions. This created problems when dual-booting Linux and Windows in UEFI-GPT setup. The new GUID (Linux filesystem data: {0FC63DAF-8483-4772-8E79-3D69D8477DE4}) was defined jointly by GPT fdisk and GNU Parted developers. It is identified as type code 0x8300 in GPT fdisk. (See definitions in gdisk's parttypes.cc)

FROM: http://gptfdisk.git.sourceforge.net/git/gitweb.cgi?p=gptfdisk/gptfdisk;a=blob_plain;f=parttypes.cc;hb=HEAD

// DOS/Windows partition types, most of which are hidden from the "L" listing
// (they're available mainly for MBR-to-GPT conversions).
   AddType(0x0100, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // FAT-12
   AddType(0x0400, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // FAT-16 < 32M
   AddType(0x0600, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // FAT-16
   AddType(0x0700, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 1); // NTFS (or HPFS)
   AddType(0x0b00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // FAT-32
   AddType(0x0c00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // FAT-32 LBA
   AddType(0x0c01, "E3C9E316-0B5C-4DB8-817D-F92DF00215AE", "Microsoft reserved");
   AddType(0x0e00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // FAT-16 LBA
   AddType(0x1100, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // Hidden FAT-12
   AddType(0x1400, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // Hidden FAT-16 < 32M
   AddType(0x1600, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // Hidden FAT-16
   AddType(0x1700, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // Hidden NTFS (or HPFS)
   AddType(0x1b00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // Hidden FAT-32
   AddType(0x1c00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // Hidden FAT-32 LBA
   AddType(0x1e00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0); // Hidden FAT-16 LBA
   AddType(0x2700, "DE94BBA4-06D1-4D40-A16A-BFD50179D6AC", "Windows RE");
   AddType(0x4200, "AF9B60A0-1431-4F62-BC68-3311714A69AD", "Windows LDM data"); // Logical disk manager
   AddType(0x4201, "5808C8AA-7E8F-42E0-85D2-E1E90434CFB3", "Windows LDM metadata"); // Logical disk manager

// Linux-specific partition types....
   AddType(0x8200, "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F", "Linux swap"); // Linux swap (or Solaris on MBR)
   AddType(0x8300, "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "Linux filesystem"); // Linux native
   AddType(0x8301, "8DA63339-0007-60C0-C436-083AC8230908", "Linux reserved");
   AddType(0x8e00, "E6D6D379-F507-44C2-A23C-238F2A3DF928", "Linux LVM");

// A straggler Linux partition type....
   AddType(0xfd00, "A19D880F-05FC-4D3B-A006-743F0F84911E", "Linux RAID");

// EFI system and related partitions
   AddType(0xef00, "C12A7328-F81F-11D2-BA4B-00A0C93EC93B", "EFI System"); // Parted identifies these as having the "boot flag" set
   AddType(0xef01, "024DEE41-33E7-11D3-9D69-0008C781F39F", "MBR partition scheme"); // Used to nest MBR in GPT
   AddType(0xef02, "21686148-6449-6E6F-744E-656564454649", "BIOS boot partition"); // Used by GRUB
   AddType(0xef03, "D3BFE2DE-3DAF-11DF-BA40-E3A556D89593", "Intel Fast Flash"); // Used by Intel Rapid Start technology


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

How reproducible:
always

Steps to Reproduce:
1. Install Fedora to a gpt partitioned disk. (biosboot, /boot, / and swap, using 'standard partition' partition scheme)
  
Actual results:
mount points (standard partition) on gpt partitioned disks end up using Code 0700.

Expected results:
use the new Code 8300 for such partitions.

Additional info: 

FROM: http://lists.gnu.org/archive/html/bug-parted/2011-06/msg00026.html
 "Need for a unique Linux GPT GUID type code (PATCH included)"
 * In special: http://lists.gnu.org/archive/html/bug-parted/2011-06/msg00028.html

FROM: http://msdn.microsoft.com/en-us/windows/hardware/gg463525.aspx
 * Windows and GPT FAQ

   
* Fedora 18 Release, with 'gpt' boot parameter and creating a 'biosboot' partition.

biosboot: Code: ef02 (OK)
swap:     Code: 8200 (OK)
/,/boot:  Code: 0700 (BAD, but USABLE)

* Fedora 19b TC4, , with 'gpt' boot parameter and creating a 'biosboot' partition.

Currently Not working. (Reason: Bug 962104)

* Fedora 19b TC4, , with 'gpt' boot parameter and a pre-existing gpt partition table with just a 1mb biosboot partition.

biosboot: Code: ef02 (OK)
swap:     Code: 8200 (OK)
/,/boot:  Code: 0700 (BAD, but USABLE)



F19b TC4: (gdisk):

# gdisk /dev/vda
GPT fdisk (gdisk) version 0.8.6

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/vda: 18530304 sectors, 8.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F1012AF9-D84D-47F3-A5FA-F081424D8555
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 18530270
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02  BIOS boot partition
   2            4096         1052671   512.0 MiB   0700  
   3         1052672         2625535   768.0 MiB   8200  
   4         2625536        18528255   7.6 GiB     0700  

Command (? for help): t
Partition number (1-4): 2
Current type is 'Microsoft basic data'
Hex code or GUID (L to show codes, Enter = 8300): L
0700 Microsoft basic data  0c01 Microsoft reserved    2700 Windows RE          
4200 Windows LDM data      4201 Windows LDM metadata  7501 IBM GPFS            
7f00 ChromeOS kernel       7f01 ChromeOS root         7f02 ChromeOS reserved   
8200 Linux swap            8300 Linux filesystem      8301 Linux reserved      
8e00 Linux LVM             a500 FreeBSD disklabel     a501 FreeBSD boot        
a502 FreeBSD swap          a503 FreeBSD UFS           a504 FreeBSD ZFS         
a505 FreeBSD Vinum/RAID    a580 Midnight BSD data     a581 Midnight BSD boot   
a582 Midnight BSD swap     a583 Midnight BSD UFS      a584 Midnight BSD ZFS    
a585 Midnight BSD Vinum    a800 Apple UFS             a901 NetBSD swap         
a902 NetBSD FFS            a903 NetBSD LFS            a904 NetBSD concatenated 
a905 NetBSD encrypted      a906 NetBSD RAID           ab00 Apple boot          
af00 Apple HFS/HFS+        af01 Apple RAID            af02 Apple RAID offline  
af03 Apple label           af04 AppleTV recovery      af05 Apple Core Storage  
be00 Solaris boot          bf00 Solaris root          bf01 Solaris /usr & Mac Z
bf02 Solaris swap          bf03 Solaris backup        bf04 Solaris /var        
bf05 Solaris /home         bf06 Solaris alternate se  bf07 Solaris Reserved 1  
bf08 Solaris Reserved 2    bf09 Solaris Reserved 3    bf0a Solaris Reserved 4  
bf0b Solaris Reserved 5    c001 HP-UX data            c002 HP-UX service       
ed00 Sony system partitio  ef00 EFI System            ef01 MBR partition scheme
ef02 BIOS boot partition   fb00 VMWare VMFS           fb01 VMWare reserved     
fc00 VMWare kcore crash p  fd00 Linux RAID            
Hex code or GUID (L to show codes, Enter = 8300):

F19b TC4 (parted):

# parted /dev/vda
GNU Parted 3.1
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 9488MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start   End     Size    File system     Name                 Flags
 1      1049kB  2097kB  1049kB                  BIOS boot partition  bios_grub
 2      2097kB  539MB   537MB   ext4
 3      539MB   1344MB  805MB   linux-swap(v1)
 4      1344MB  9486MB  8142MB  ext4

 
Not a very detailed information...
Comment 1 Reartes Guillermo 2013-05-14 10:49:38 EDT
I created a demo partition table with gdisk, and then examined it with
the 3 utilities. NOTE: I did not format any partition, so parted will
not find any filesystem on them.

Partition #2, which is code 8300, seems to have been recognized by parted 
as "linux filesystem".

GDISK UTILITY (F19b TC4 ISO):
----------------------------

GPT fdisk (gdisk) version 0.8.6

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/vdb: 16384000 sectors, 7.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): EC1FA7AE-43BA-4E4D-BA93-82A1AB5590EF
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 16383966
Partitions will be aligned on 2048-sector boundaries
Total free space is 11661245 sectors (5.6 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02  BIOS boot partition
   2            4096         1052671   512.0 MiB   8300  Linux filesystem
   3         1052672         1576959   256.0 MiB   8200  Linux swap
   4         1576960         3149823   768.0 MiB   0700  Microsoft basic data
   5         3149824         3151871   1024.0 KiB  EF00  EFI System
   6         3151872         3938303   384.0 MiB   FD00  Linux RAID
   7         3938304         4724735   384.0 MiB   8E00  Linux LVM


   
PARTED UTILITY (F19b TC4 ISO):
-----------------------------

Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 8389MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  2097kB  1049kB               BIOS boot partition   bios_grub
 2      2097kB  539MB   537MB                Linux filesystem
 3      539MB   807MB   268MB                Linux swap
 4      807MB   1613MB  805MB                Microsoft basic data
 5      1613MB  1614MB  1049kB               EFI System            boot
 6      1614MB  2016MB  403MB                Linux RAID            raid
 7      2016MB  2419MB  403MB                Linux LVM             lvm
 
 
FDISK UTILITY (F19b TC4 ISO)
----------------------------
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/vdb: 8388 MB, 8388608000 bytes, 16384000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt


#         Start          End    Size  Type            Name
 1         2048         4095      1M  BIOS boot parti BIOS boot partition
 2         4096      1052671    512M  Linux filesyste Linux filesystem
 3      1052672      1576959    256M  Linux swap      Linux swap
 4      1576960      3149823    768M  Microsoft basic Microsoft basic data
 5      3149824      3151871      1M  EFI System      EFI System
 6      3151872      3938303    384M  Linux RAID      Linux RAID
 7      3938304      4724735    384M  Linux LVM       Linux LVM 
 
So fdisk appears to have gained some 'gpt support', as the legend shows, it is currently EXPERIMENTAL. 


FDISK UTILITY (Older version, F17):
----------------------------------

# fdisk -l /dev/sda 
                          
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 90.0 GB, 90028302336 bytes
255 heads, 63 sectors/track, 10945 cylinders, total 175836528 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1   175836527    87918263+  ee  GPT

This is needed to set bootable the partition, in case one switches from
esp to biosboot or the reverse. I did not find how to show this in the new
fdisk version with gpt support.


Additional Info:

FROM (bug-parted Mailing list): http://lists.gnu.org/archive/html/bug-parted/2013-05/msg00012.html

The patch from Rod Smith regarding "Need for a unique Linux GPT GUID type code" was pushed in late September, 2012.
Because Parted 3.1 was released earlier (on March 2nd, 2012) this commit is not included in parted-3.1.
There has been no official parted release since 3.1.
Comment 2 David Shea 2013-08-08 10:37:26 EDT
Reassigning to parted since anaconda doesn't set the partition GUIDs directly.
Comment 3 Fedora End Of Life 2013-09-16 09:52:47 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20
Comment 4 Brian Lane 2014-10-07 19:30:38 EDT
This will be in Fedora 21.

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