sgan81 / apfs-fuse

FUSE driver for APFS (Apple File System)
GNU General Public License v2.0
1.78k stars 164 forks source link

OBJECT_TYPE_CHECKPOINT_MAP Assertion failed #128

Closed muuud closed 4 years ago

muuud commented 4 years ago

I have been running apfs-fuse in Ubuntu 18.04 for awhile since my Hackintosh partition stopped booting properly to access the data. Worked great for quite some time, but today I ran into an error which returns no results on Google.

sudo apfs-fuse -o allow_other /dev/nvme0n1p2 ~/nvme apfs-fuse: /home/<username>/apfs-fuse/ApfsLib/CheckPointMap.cpp:36: bool CheckPointMap::Init(oid_t, uint32_t): Assertion '(cpm->cpm_o.o_type & OBJECT_TYPE_MASK) == OBJECT_TYPE_CHECKPOINT_MAP' failed. Aborted

I am concerned that the drive has been corrupted, but am not sure if it is possible to recover the data or how without being able to load the drive through fuse. I am hoping someone more knowledgeable on the software could explain the cause of this error.

I tried booting in lax mode, the same error occurs. With -d 16 it tells me Device /dev/nvme0n1p2 opened. Size is 185849593856 before returning the same error. apfsutil also returns the same error.

RJVB commented 4 years ago

On Sunday August 02 2020 17:58:11 muuud wrote:

I am concerned that the drive has been corrupted, but am not sure if it is possible to recover the data or how without being able to load the drive through fuse.

If you don't have another boot partition to boot your hackintosh off (CarbonCopyCloner is our friend to maintain at least 1 bootable clone/backup!), then why not set up a VM? VirtualBox gives good enough raw access to the full disk either via its virtualised disk controllers or else by assigning a USB drive to the guest (I'm assuming those must work because there are now guest additions for Darwin). If that doesn't allow the partition to mount you're still not 100% certain it's a drive failure but if it does, at least you have your data back. Or at least access to it...

About the assert/abort: I don't know how rigorous the devs here work but nowadays these are often used as stopgap measures for situations that could very well be handled more gracefully (which doesn't mean this particular error is not a fatal one!). The good news is that if you're seeing an ASSERT you can probably get noticeably better performance by rebuilding in release mode ;)

PS: before you continue to tinker: use dd to make a lowlevel image of the entire partition; possibly corrupt filesystems have a habit of going really corrupt when trying to revive them (or I have a habit of making one wrong choice too many when dealing with this kind of situation)...

muuud commented 4 years ago

@RJVB Thank you for this advice. I had no idea you could access physical disks through a VM. I used VMware and managed to get access to the drive to backup the data. But I was in luck! During the backup I found a copy of the EFI partition saved on the Hackintosh and was able to use that to boot the system for the first time in over a year. Now with the boot sector fixed apfs-fuse doesn't run into the assert error.

RJVB commented 4 years ago

Glad I've been of help!