Can ContainerToInvert file be safely deleted?

After previously upgrading to High Sierra and converting my boot drive to APFS, I recently migrated to a new (larger) SSD boot drive. While setting that up, Disk Utility gave me an error when restoring from my old volume to the new one "APFS inverter failed to invert the volume - invalid argument".

I ended up using Carbon Copy Cloner to transfer the files which went OK, and I am now running from the new volume.

However I have a file at the root of the drive called ContainerToInvert. It is over 250GB in size, so I'd like to delete it if it isn't needed.

Can anyone confirm that deleting it won't cause any problems?


This often happens after cloning APFS drives using Disk Utility. The size of the file usually relates to the cloned partition size.

You can use the following steps to mount the ContainerToInvert file as an APFS container and access all the partitions.

  1. Download and install FUSE
  2. Download and install xmount1
  3. Open Terminal (usually located within Applications/Utilities)
  4. Type sudo mkdir /Volumes/apfs_image/ into Terminal and press Enter (when prompted, enter your password)
  5. Type sudo mkdir /Volumes/apfs_mounted/ into Terminal and press Enter (when prompted, enter your password)
  6. Type sudo xmount --in raw <path to ContainerToInvert file> --out dmg /Volumes/apfs_image/ into Terminal and press Enter (when prompted, enter your password)
  7. Type hdiutil attach -nomount /Volumes/apfs_image/ContainerToInvert.dmg into Terminal and press Enter (when prompted, enter your password)
  8. Type diskutil ap list into Terminal and press Enter (when prompted, enter your password)
  9. Type diskutil ap unlockVolume <Disk GUID> -nomount into Terminal and press Enter (when prompted, enter your password)
  10. Type sudo mount_apfs -o rdonly,noexec,noowners /dev/disk# /Volumes/apfs_mounted/ into Terminal and press Enter (when prompted, enter your password)
  11. Now you'll have the original partition mounted
  12. Browse the disk image to inspect the contents and once satisfied there's nothing there you need to transfer across you can unmount and delete the entire .dmg file

The above steps are based on the Mount All the Things! – Mounting APFS and 4k Disk Images on macOS 10.13 blog entry.

1. If you have trouble installing xmount, then run the following command in Terminal and try again:

 `mkdir -p /Library/Filesystems/osxfusefs.fs/Support/osxfusefs.kext`