Trying to replicate the gpt option on this post How to examine disks and their partitions via terminal?

I do:

sudo gpt -r show disk0

what I get is:

gpt show: unable to open device 'disk0': Operation not permitted

This is supposed to be an inoffensive reading action. How is not allowed?

How can it be done? (I read there are other third party tools that can overcome this issue, but I want to use native gpt).

diskutil list:

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI ⁨EFI⁩                     314.6 MB   disk0s1
   2:                 Apple_APFS ⁨Container disk1⁩         500.0 GB   disk0s2
  • 1
    You have to unmount the disk/volume first. What's your goal here? What are you trying to accomplish?
    – Allan
    Aug 9, 2023 at 22:54
  • Explore the GUID partition tables. Is this booting from Recovery (⌘+R), where the Recovery partition is the main (mounted/master) one and then, from Terminal just executing the above? If I generate some file in this Recovery context (i. e. using output redirection like >), how can I then access it after booting normally? (IOW, how can the Recovery partition be accessed from the normal session? Is it trivial? Just mounting it as any other device? diskutil mount /dev/...? Where would be the mountpoint location? Like an mounted drive in left bar?).
    – nostromo
    Aug 9, 2023 at 23:05
  • And @Allan, another question. The need to unmount the partition to get this things... I have been thinking... Has nothing to to with permissions/security but with the fact that in the booting-mounting process, things that are loaded "after" some point in a sequence, are the only things accesible to some tools and things out of the scope (things "before" some point) of some logical regions are not accesible due to this?
    – nostromo
    Aug 9, 2023 at 23:24
  • Which version of macOS and what model/year Mac are you using? Aug 10, 2023 at 2:29
  • BTW: The sudo gpt -r show disk0 command never required an unmount. Aug 10, 2023 at 6:22

1 Answer 1


The current accepted answer to the question "How to examine disks and their partitions via terminal?" was posted on Feb 3, 2017. The latest release of macOS at that time was Sierra. With this version of macOS, SIP allowed the reading of the GPT from drive containing the startup disk. However starting with macOS High Sierra through Monterey, SIP prohibited the reading of the GPT from the drive containing the startup disk. Apparently, SIP under Ventura will allow the gpt command to read the GPT from the drive containing the startup disk.

Answer to the OP's questions:

  • How could be this overcome?

    Disable SIP.

  • How is not allowed?

    SIP prevents the gpt command from reading from /dev/disk0.

  • How can it be done?

    There are many ways. Below are two common ways. Note that reading from /dev/disk0 is permitted while booted to macOS Recovery.

    • Boot to macOS Recovery and enter the command csrutil disable. Next, boot back to macOS and enter the command sudo gpt -r show disk0.
    • Boot to macOS Recovery and enter the command gpt -r show disk0. Next, boot back to macOS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .