The SIP problem described by the OP occurs with High Sierra through Monterey. Apparently, Ventura does not have this problem.
You will get what you want, easily:
(be VERY CAREFUL as other commentators cautioned. Not just with the of=
part. Also wrong parameters in bs=
or count=
can be dangerous. Also copy/pasting from text editors, missing important lines [i.e. only passing if=
and of=
leaving the rest]).
First, we need to address two key misconceptions:
- You have to focus on
disk0
, which is your main physical drive. The APFS container disk1
is stored in the partition disk0s2
(which is a slice of physical
drive disk0
).
- The block special file
/dev/disk0
can not be read by the dd
command while SIP is enabled under Monterey. This answer assumes you have booted to macOS Recovery for Monterey.
This is why:
sudo dd if=/dev/disk0 of=mbr.backup bs=512 count=1
while booted to Monterey was wrong.
The correct command, while booted to macOS Recovery for Monterey, would be (naming arbitrary destination i. e. "/Volumes/Macintosh\ HD\Users/Shared/mbr_disk0.backup
"):
cd /Volumes/Macintosh\ HD/Users/Shared
dd if=/dev/disk0 of=mbr_disk0.backup bs=512 count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.000851 secs (601645 bytes/sec)
ls *.backup
mbr_disk0.backup
Extraction of desired sector, done.
Now, just use the xxd
command piped with less
(or your favourite hex editor) against the file resulting from your extraction:
chroot /Volumes/Macintosh\ HD xxd /Users/Shared/mbr_disk0.backup | less
Voilá, here you have the hex dump you were looking for:
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000120: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000130: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000140: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000150: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000160: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000170: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001b0: 0000 0000 0000 0000 0000 0000 0000 00fe ................
000001c0: ffff eefe ffff 0100 0000 050c 4707 0000 ............G...
000001d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
Or, you could boot back to Monterey, then use the xxd
command piped with less
(or your favorite hex editor) against the file resulting from your extraction:
cd /Users/Shared
sudo chown ${USER}:staff mbr_disk0.backup
xxd mbr_disk0.backup | less
Note: My drive is 500.1 GB (122096646 sectors) in size. The OP's drive is approximately 500.3 GB in size. Therefore the size value stored at 0x1CA through 0x1CD will be slightly larger for the OP's drive.
diskutil umount
disk0, booted the computer withCMD+R
(as the recovery booting will be from a partition that allows me treat my usual main working partition as secondary in this context?). Are the mentioned MBR (bs=512 count=1
) parameters correct to apply also to this GPT "extraction"?dd
is a very dangerous command, but at least for my understanding, the most critical field of it is the output part:of=[anything-here-will-be-overwritten]
(agree? Did I leave something?). Doing the "tries" above, I first thoroughly typed the command string in an editor and then copied to the zsh terminal (yes, very tense moments).dd
to make an image of that then you can use your editor to your hearts content? You get to experiment with a GPT/APFS formatted device without putting your working drive at risk. Plus, you don't have to disable security, unmount existing volumes, boot to something else, etc. etc. etc.