Bug 225813 - [geom][patch] gpart does not recognise Apple APFS partition type
Summary: [geom][patch] gpart does not recognise Apple APFS partition type
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2018-02-10 22:29 UTC by James Wright
Modified: 2018-02-11 07:13 UTC (History)
1 user (show)

See Also:


Attachments
Patch for adding Apple APFS as a known GPT partition type (2.92 KB, patch)
2018-02-10 22:29 UTC, James Wright
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Wright 2018-02-10 22:29:11 UTC
Created attachment 190494 [details]
Patch for adding Apple APFS as a known GPT partition type

Apple APFS partition type is not recognised by gpart, e.g.

james macbook ~ % gpart show
=>       34  977104993  ada0  GPT  (466G)
         34          6        - free -  (3.0K)
         40     409600     1  efi  (200M)
     409640  546875000     2  !7c3457ef-0000-11aa-aa11-00306543ecac  (261G)
...

I have included a patch to add the Apple APFS magic guid to the known types, recompiled and tested with the following results;

james macbook ~ % gpart show
=>       34  977104993  ada0  GPT  (466G)
         34          6        - free -  (3.0K)
         40     409600     1  efi  (200M)
     409640  546875000     2  apple-apfs  (261G)

Please could someone review and test the patch for me?

Thanks,
James
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2018-02-11 02:35:13 UTC
Patch looks fine to me modulo gratuitously changed lines in gpt.h and possible ABI break by inserting at the front of 'enum g_part_alias'.
Comment 2 Conrad Meyer freebsd_committer freebsd_triage 2018-02-11 06:57:43 UTC
Thank you for submitting the patch.  I added a blurb to gpart.8 manual page as well.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-02-11 06:57:44 UTC
A commit references this bug:

Author: cem
Date: Sun Feb 11 06:57:21 UTC 2018
New revision: 329119
URL: https://svnweb.freebsd.org/changeset/base/329119

Log:
  Add GUID and alias for Apple APFS partition

  PR:		225813
  Submitted by:	James Wright <james.wright AT jigsawdezign.com>

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/disk/gpt.h