Hey everyone! After wasting half the day on this, I finally figured out one piece of the snapshots/error 66 puzzle.
The TL;DR is that
you can just call apfs_systemsnapshot -v /Volumes/... -r ""
to boot from the live volume. I haven't seen this published anywhere yet, and the accepted wisdom seems to be that you
can't boot the live volume in BS. Hopefully this method will continue to work. It will make patching
much easier.
Long version:
- disable SIP, including ARV (funnily enough, my very early
boot.efi
patch with all the 0xffffffffs actually works for this, even though
@dosdude1's 0x67 one does not... anyways, I'll find the correct flags shortly and make a new patch)
- boot into Big Sur or a BS recovery/install disk
-
diskutil mount diskXsY
the
real system volume (not the root snapshot, which will already be mounted at
diskXsYsZ
)
- find the path to the mounted volume (if you're booted into the same system, it will be
volume_name 1
because of the previously mounted snapshot)
-
/S*/L*/F*/apfs.fs/C*/R*/apfs_systemsnapshot -v "/Volumes/volume_name" -r ""
- reboot
-
mount -uw /
should now work, changes will apply immediately to the live volume, and you can remove all the snapshots with
diskutil apfs deletesnapshot
if desired
(I spent ages reverse engineering
apfs_systemsnapshot
and learning about the
fs_snapshot_*
functions before realizing you could just call the tool with an empty string. But if anyone is interested in the code for programmatically managing snapshots, I am happy to share it.)
Thanks to
@mac_4eva/
this post for the starting point.
One remaining mystery is figuring out how to mount the BS root from Cat. With the sealing/snapshots disabled, I don't see any reason why it shouldn't be possible.
I hope this works for others!