jivanpal / drat

Utility for performing data recovery and analysis of APFS partitions/containers.
GNU General Public License v3.0
163 stars 21 forks source link

Feature not implemented #8

Closed nopol closed 3 years ago

nopol commented 3 years ago

I destroyed my Fotos library volume while backing it. So I destroyed both. my backup and my original. Anyway, I found your toolset while trying to fix it. Thank you for your great work so far.

https://pastebin.com/jYUw2qDA

The program ends with the message: "END: The ability to handle this case has not yet been implemented."

So I wanted to ask if there is any plan to implement this feature-

best regards and merry Christmas

jivanpal commented 3 years ago

Using these tools with sparse images hasn't been tested; I'll need to explore this. Assuming the beginning of the sparse image isn't sparse, it looks like the image is not a standalone APFS container; perhaps it has a partition table. Can you provide a hexdump of the beginning of the image? This should do it:

dd if=/Volumes/T7/Fotos.sparseimage bs=4096 count=2 | hexdump -C
nopol commented 3 years ago

I feel extremely stupid about it. The sparseimage has historical reasons. I used to have the Fotos lib on my network drive. Old MacOS needed tot have a sparseimage to mount, so I just used it on my ssd to mount it. Anyway while backing it up back to the network share I mounted the usb on the server and the server crashed while using rsync. I guess that's when the image broke. but I have no idea.

here is the hexdump. thank you for looking into it

https://pastebin.com/xdEv340b

jivanpal commented 3 years ago

Yeah, it's definitely a sparse image of a GPT-formatted disk that also has an EFI System Partition. My suggestion for now would be to unpack the sparse image into a non-sparse one, e.g. write the unpacked image to a spare disk with sufficient space. Alternatively, I think you can probably also mount the disk image virtually in Disk Utility and then use apfs-inspect etc., but I'll have to check this as I've not used sparse images much before. I'll try and spend some time exploring this in order to provide some more guidance. Depending on what exactly went wrong, your issue may be with the sparse image itself, rather than the APFS container encoded within it.

nopol commented 3 years ago

Thank you. I already tried both. The image is not mountable.