This morning my phone froze and I had to hard reset it. Now when I boot and I insert my SD card, I get the following two messages:
- Preparing SD card/checking for errors.
- A dialog offering to encrypt my SD card. Here I can pick disable or continue, entering my device password.
So far I have only tried continue, with device password - then I have "sd card encryption encrypting sd card" alongside checking for errors.
So I've started digging. Firstly
$ mount | grep -i extsdcard
/dev/block/vold/179:65 /mnt/media_rw/extSdCard exfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=utf8,namecase=0,errors=remount-ro 0 0
/mnt/media_rw/extSdCard /storage/extSdCard sdcardfs rw,seclabel,nosuid,nodev,relatime,uid=1023,gid=1023,derive=unified 0 0
/storage/extSdCard /storage/extSdCard ecryptfs rw,seclabel,nodev,relatime,ecryptfs_sig=094f421508772d43,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_enable_cc,ecryptfs_passthrough 0 0
So I can see I'm using ecryptfs and the sdcard is formatted exfat (yuck, but never mind). I was suspicious about the state of the exfat filesystem, so I followed the top voted answer from this question. fsck.exfat /dev...
returns "no errors" so it is happy. I can browse to the sd card in the shell and see the files, but obviously not their contents, so the exfat filesystem appears intact.
So the problem I have is clearly with the ecryptfs layer. My question is therefore:
- Is there a fsck-like tool I can run with some actual output to know what is going on for ecryptfs?
- Failing that, can I extract from the device the key used to encrypt the sd card files?
- If I just wait, will it fix itself? I guess not...
Ideally I'd like to recover those files, however there's nothing in there that's critical.
Environment: rooted lollipop samsung s5, stock firmware, custom recovery (twrp), busybox, supersu.