Bug 196241 - gpart does not recognize Apple Core Storage partitions
Summary: gpart does not recognize Apple Core Storage partitions
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: Andrey V. Elsukov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-23 22:16 UTC by roddi
Modified: 2015-03-19 14:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description roddi 2014-12-23 22:16:36 UTC
When creating an encrypted partition on a OS X system a Core Storage partition is created. I wont go into details about these partitions but you can do a "man diskutil" on a OS X system to learn more. A disk partitioned with such a partition looks like this on OS X (output of "diskutil list"):

/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:          Apple_CoreStorage                         250.0 GB   disk2s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk2s3
   4: 516E7CBA-6ECF-11D6-8FF8-00022D09712B               1.7 TB     disk2s4

Note partition (or slice) 2

On FreeBSD "gpart show":

=>        34  3906963389  da0  GPT  (1.8T)
          34           6       - free -  (3.0K)
          40      409600    1  efi  (200M)
      409640   488281256    2  !53746f72-6167-11aa-aa11-00306543ecac  (233G)
   488690896     1269536    3  apple-boot  (620M)
   489960432  3417002984    4  freebsd-zfs  (1.6T)
  3906963416           7       - free -  (3.5K)

So obviously "!53746f72-6167-11aa-aa11-00306543ecac" is the magic UID for the Core Storage slice. All this applies to GUID partition tables. I have no idea what the situation is with other partition schemes but I doubt that Core Store Volumes can be created anywhere else than GPT.

While not really a serious bug, I still think this should be added to the list of known partition types.

P.S.: The output above is from the exact same disk. Apple uses base-10 values instead of base-2 values so everything appears to be larger.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-03-12 18:51:38 UTC
A commit references this bug:

Author: ae
Date: Thu Mar 12 18:51:33 UTC 2015
New revision: 279935
URL: https://svnweb.freebsd.org/changeset/base/279935

Log:
  Add GUID and alias for Apple Core Storage partition.

  PR:		196241
  MFC after:	1 week

Changes:
  head/sbin/geom/class/part/gpart.8
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part.h
  head/sys/geom/part/g_part_gpt.c
  head/sys/sys/gpt.h
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-03-19 14:09:40 UTC
A commit references this bug:

Author: ae
Date: Thu Mar 19 14:09:29 UTC 2015
New revision: 280261
URL: https://svnweb.freebsd.org/changeset/base/280261

Log:
  MFC r269854:
    Remove duplicate entry.

  MFC r279935:
    Add GUID and alias for Apple Core Storage partition.

    PR:		196241

Changes:
_U  stable/10/
  stable/10/sbin/geom/class/part/gpart.8
  stable/10/sys/geom/part/g_part.c
  stable/10/sys/geom/part/g_part.h
  stable/10/sys/geom/part/g_part_gpt.c
  stable/10/sys/sys/gpt.h
Comment 3 Andrey V. Elsukov freebsd_committer freebsd_triage 2015-03-19 14:15:38 UTC
Committed in head/ and stable/10. Thanks!