Get the adoptable storage key from the phone

I’m using an FP3+ with Android 10. And got a new SD card. And had a bad idea.

I got a new microSD card and was so enthusiastic about it that I replaced the old card without saving my data. I was convinced that this old card was not in use.

So I inserted the new card, attached it as adoptable storage. And then realized that the recently shot photos disappeared (luckily, I had the “old” microSD card only some weeks in place).

So I switched cards again, but the Fairphone didn’t recognize the old one. I tried to read the data on my laptop. Without success, there are two partitions “android_meta” and “android_expand” on the card which can’t be read. I know now this means, the card is encrypted and was used as adoptable storage.

I used Linux and dd (without any specific options) to write images of both partitions in img files (again I had some luck, the card has only 8GB). Then I had the idea to let the phone use the old microSD card again as adoptable storage, shut down the phone, then restore the dded images and boot the phone with the old card and the restored data. Unfortunately, the phone told me the card was broken.

Now I hope there is a chance

  • that the dd command was correct and did not produce corrupt images
    From the web I got that one might want to use gddrescue for andoptable storages.
  • that it’s possible to extract the encryption key the Fairphone used to encrypt the adoptable storage.
    Again, I tried to get information about this on the web. And it seems, each encryption key is preserved. Which would be good. But I used this exact microSD card twice as adoptable storage :frowning:

Thanks in advance for any useful hint

A post was merged into an existing topic: How to get the key used for the encryption of sdcard (internal storage)