Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apfs-fuse saved my stuff #175

Open
mikejsavage opened this issue Feb 16, 2023 · 4 comments
Open

apfs-fuse saved my stuff #175

mikejsavage opened this issue Feb 16, 2023 · 4 comments

Comments

@mikejsavage
Copy link

mikejsavage commented Feb 16, 2023

Hi, this isn't actually an issue so feel free to just close it. It could have been an email too but this specific error isn't on Google yet, so hopefully this helps someone else in the future too. :)

I have an old MacBook with an encrypted boot partition, and some combination of resizing the partition and upgrading macOS fried it to the point where disk utility in recovery mode doesn't recognise it as APFS and fsck returns a scary error:

# fsck_apfs /dev/disk0s2
** Checking the container superblock.
   Checking the checkpoint with transaction ID 191941.
** Checking the EFI jumpstart record.
** Checking the space manager.
** Checking the space manager free queue trees.
** Checking the object map.
** Checking the encryption key structures.
error: container keybag (14666476+1): failed to get keybag: Inappropriate file type or format
   Encryption key structures are invalid.
** The container /dev/disk0s2 could not be verified completely.

and after going nowhere with Apple support I decided to google "Linux APFS" and found this, which took less than two minutes to compile and as far as I can tell works flawlessly.

Looks like I will still have to waste some time reinstalling but your project at least saved my data, so thank you!

@RJVB
Copy link

RJVB commented Feb 16, 2023 via email

@mikejsavage
Copy link
Author

mikejsavage commented Feb 18, 2023 via email

@sgan81
Copy link
Owner

sgan81 commented Mar 11, 2023

Interesting ... I'm actually also surprised that this worked. I wonder what was broken in your keybag. But then, apfs-fuse might sometimes be more tolerant than Apple's APFS ...

@mikejsavage
Copy link
Author

I messed around a bit after creating this issue, if you uncomment this it blows up with both my password and the recovery key: https://github.com/sgan81/apfs-fuse/blob/master/ApfsLib/KeyMgmt.cpp#L478

but that comes after you enter a decryption key so I dunno. I saved the superblock/keybag blocks if you're curious (not asking you to fix my stuff for free, that partition is gone already anyway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants