How to partition and to have adopted storage at same time.
You don't need to root your device but the device i done this with is rooted
How to decrypt adopted storage.
You don't need to root your device but the device i done this with is rooted
- You need to enabled Developer Options.
- Enable the USB Debugging option.
- Make sure your SD card is formatted as portable, then get the adb executable from android sdk or any other source.
- Connect your device to your PC and run the adb devices command. If your device is connected correctly you will see your device listed in the output.
- Run adb shell sm list-disks adoptable. This will show you the list of disks that can be used for what we want.
- For my device it showed me disk:179,128 so i ran adb shell sm partition disk:179,128 mixed 80 on my 32 GB SD card. It gave me 5 GB as adoptable storage and the rest for other uses. (This will format your SD card.)
How to decrypt adopted storage.
- Your device must be rooted.
- Using a file browser like ES Explorer, browse to /data/misc/vold.
- The .key file there is the encryption key of your adopted storage.
- Open that file with a hex editor to view the 16-byte key.
- On any Linux distro you can do this first mount your SD card, in my case SD card was mounted at /dev/sdb2.
- Then run this command dmsetup create crypt1 --table "0 `blockdev --getsize /dev/sdb2` crypt aes-cbc-essiv:sha256 <You put the 16 bytes of hex data from the file here> 0 /dev/sdb2 0" This might give you a error but ignore it.
- If your key is correct you can mount it by mount -t ext4 /dev/mapper/crypt1 /mnt/1/
- Finally you can run cd /mnt/1 to browse the decrypted storage.
Last edited: