Last active
February 14, 2021 06:56
-
-
Save rctphone/62f75cf2f0293bdc9dd27eebac1d5c61 to your computer and use it in GitHub Desktop.
How to solve "APFS inverter failed to invert the volume" error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After cloning APFS drives using Disk Utility it usually ends with a volume containing ContainerToInvert file with the size of a cloned partition. | |
Don't be afraid, using the following steps you can mount this file as APFS container and get all partitions. | |
1. Requirements | |
We need FUSE and xmount installed | |
2. Terminal | |
Open Terminal app and type the following: | |
$ sudo mkdir /Volumes/apfs_image/ | |
$ sudo mkdir /Volumes/apfs_mounted/ | |
$ sudo xmount --in raw <path to ContainerToInvert file> --out dmg /Volumes/apfs_image/ | |
$ hdiutil attach -nomount /Volumes/apfs_image/ContainerToInvert.dmg | |
$ diskutil ap list | |
## this is optional step, I don't need it | |
$ diskutil ap unlockVolume <Disk GUID> -nomount | |
$ sudo mount_apfs -o rdonly,noexec,noowners /dev/disk# /Volumes/apfs_mounted/ | |
After that, you will have the original partition mounted to your system. | |
References and Thank You’s | |
https://www.mac4n6.com/blog/2017/11/26/mount-all-the-things-mounting-apfs-and-4k-disk-images-on-macos-1013 |
hdiutil attach -imagekey diskimage-class=CRawDiskImage ContainerToInvert -nomount
Should work without need for xmount
and is simpler
I've been using the code above, still the files I found in my ContainerToInvert are corrupt or at least, I can not open them. mehrdata's way did not work for me either.. still the files seem to be corrupt :-/
any ideas?
Super helpful! Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fantastic work, thank you so much for this!
I've kept a 40 GB
ContainerToInvert
file on my disk for months now because I didn't know quite what it represented, and opening it with a hex editor revealed strings that matched the contents of several files on my drive. My worst-case fear of deletingContainerToInvert
was that it might somehow be some important part of APFS, and deleting it would either delete the files I saw in the hex editor or corrupt my drive (likely both).But now I can browse it as a DMG, copying off whatever I need from it, and then safely delete it. Thanks so much again!!