Benches macOS

10

APFS inverter failed to invert the volume…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi,

I recently had the same problem as described here:

https://discussions.apple.com/thread/8384650

Unfortunately it is not possible to reply there, it suggested me to open a new question, so here I am. :)

The process of cloning an apfs volume with disk utility led to the error in the title and left

me with a volume with only one file "ContainerToInvert" in it.

I did some googling and found that there's an utility apfs_invert. So I played around and found

that this command would make the copy work:

sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_invert -d /dev/disk3s3 -n ContainerToInvert -s 1

(where /dev/disk3s3 is the device of the container partition (check with "diskutil list" or "diskutil apfs list" for the right name).

Is it possible that one can circumvent the error that easily? If yes, couldn't Apple simply fix Disk Utility?

10 replies

Sign in or join Beachball Help to reply.

  1. 0

    astirusty

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Very good question as to why Apple's Disk Utility does not immediately reject the "Restore" when APFS disk(s) are involved. Even though Apple is saying they don't (well no longer) support use of "Restore" for cloning (backup), fact that Disk Utility does copying of disk data, does Verify, and fails only at End of "Restore"; says Apple messed up with APFS and Disk Utility.

    First time I ran into Inverter Failed problem, I was told it was due to my MacBook Air being to old, and it's Firmware as problem. This time both iMac and MacBook Pro were new enough that was not going to fly. Apple Support would not respond to me via Email as to issue between Disk Utility and APFS. Only way Apple Support would tell me was via phone. Which tells me, Apple wants it swept under rug.

  2. 0

    teskor

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    And I suppose it could be easily fixed by calling apfs_invert correctly. But the thing that's probably not so easily fixed is that it is not working with time machine local snapshots, and that's where they apparently gave up :-(

  3. 0

    teskor

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi astirusty, thanks for the info. But why don't they just give an error message then right at the start instead of cloning and verifying several hours and then giving a cryptical error message? This makes no sense to me... Anyway, I got it to work with my method stated above. As I suspected, I had to

    1. Disable automatic updates in time machine preferences
    2. Remove local time machine snapshots with " tmutil listlocalsnapshots" and then "tmutil deletelocalsnapshots <date>" for every entry from the list
    3. Do the cloning with disk util (in my case I had to boot from another drive because it was the system disk) until the error message.
    4. Then (in my case after a reboot) _eject_ or unmount the disk or apfs_invert will get an error
    5. sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_invert -d /dev/disk3s3 -n ContainerToInvert -s 1
    6. In one case that was all, in another case I had an "inactive" apfs container and had to do "first aid" in disk util to get the partition back.

    In any case it might be better and safer to use Cabon Copy Cloner, as some other people pointed out, but I just didn't want to give up :)

  4. 0

    astirusty

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    From what I got from Apple Support.

    Apple NO longer supports Apple's Disk Utility for use of restoring (aka cloning or backup) of a APFS drive from another drive.

    Apple ONLY supports using Time Machine from a disk or from Target disk mode from another Apple computer as a backup (cloning).

  5. 0

    MacBookProUserSince2010

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I found a workaround the drive inverter failed in my case... The clone I made from my MacBook Pro was named Macintosh HD, and prior to restore I would erase the internal disk with the name Macintosh HD and APFS format.

    What I did next was to name the next clone macOSMojave and restore it to my Macintosh HD, and the restore went through. However, on the next boot, the folder with question mark showed-up, so I went back to disk utility, rename change the name back to Macintosh HD,, then restarted with the “option Key”, my HD was there and it booted fine. After, in preference I made sure the disk was selected as the start-up disk, and the issue was gone.

  6. 0

    teskor

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I have to add that it didn't work yet for my boot drive because of this error:

    [michael.teske@MichaelsMacbook conf]$ sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_invert -d /dev/disk3s3 -n ContainerToInvert -s 1

    Password:

    lookup_topology:1189: raw cont: disk3s3

    lookup_topology:1190: synth container: disk4

    lookup_topology:1191: synth vol: disk4s1

    lookup_topology:1197: encrypted: no

    *** Mounting outer volume (/dev/disk3s3 s1)...

    nx_kernel_mount:1359: /dev/disk3s3: checkpoint search: largest xid 489, best xid 489 @ 137

    nx_kernel_mount:1423: /dev/disk3s3: sanity checking all nx state... please be patient.

    spaceman_metazone_init:476: metazone for device 0 of size 1780847 blocks (encrypted: 0-890423 unencrypted: 890423-1780847)

    spaceman_trim_free_blocks:3009: scan took 0.000675 s, trims took 0.000000 s

    *** Getting image dstream info...

    ContainerToInvert: dstream_id=16, size=431894802432

    *** Mounting inner volume (ContainerToInvert)...

    nx_kernel_mount:1359: : checkpoint search: largest xid 280390, best xid 280390 @ 134

    nx_kernel_mount:1423: : sanity checking all nx state... please be patient.

    sanity_check_alloced_blocks:261: fs_alloc_count mismatch: fs root nodes 369462 extent 41 omap 5683 snap_meta 1 er: 0 udata: 92443598 fs_alloc_count 92883346

    mount_inner_volume:872: Inner volume has snapshots

    These are probably the time machine local snaphots, I just deleted them but it will take some time to try again.

  7. 0

    BDAqua

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    No answer to your queries, but great work on your part, thanks. :)

  8. 0

    BDAqua

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    :)

  9. 0

    BDAqua

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Yeah, I hate the changes forced on us.

  10. 0

    astirusty

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You should not have to fight Inverter Failed problem. Nor go through all steps you did, and in one case run First Aid.

    Clearly "It just works", died with Jobs. :(