I recently switched from a Galaxy S2 running CM 10.2 (Android 4.3.1) to a Nexus 5 running 6.0.1 (stock rooted).

My goal was to migrate all my WhatsApp data (history, media, etc.) over to the new device. Restoring the history was no problem using WhatsApp's builtin backup/restore functionality. I then proceeded to copy all the .../WhatsApp/Media/ folders over to the new phone, however, I still got an error message stating that the file could not be found when trying to open any (old) received images or videos from within WhatsApp.

Upon further investigation, it seems like WhatsApp is (or was?) storing the absolute path to every individual media file in its database, e.g. on my S2: /storage/sdcard0/WhatsApp/Media/WhatsApp Images/IMG-20140813-WA0020.jpg
It just so happens that the /storage/sdcard0 symlink doesn't exist on my Nexus 5 and hence WhatsApp can't access older files since the links are broken.

So I figured all I needed to do was create the /storage/sdcard0 symlink, like this:

ln -s /sdcard /storage/sdcard0


root@hammerhead:/ # ls -l /storage
drwx--x--x root     sdcard_rw          1970-07-07 17:59 emulated
lrwxrwxrwx root     root              2015-12-30 16:26 sdcard0 -> /sdcard
drwxr-xr-x root     root              1970-07-09 08:57 self

Unfortunately, WhatsApp still couldn't access my old media files (not to mention that the symlink was gone after a reboot).

What am I doing wrong?


EDIT: I did some more testing and noticed that the /storage/sdcard0 symlink is still there in versions prior to Marshmallow (I tested factory images of 5.0, 5.0.1 and 5.1.1 plus a friend's N5 running 4.4.4).

For now I have downgraded to 5.1.1 (with an intact /storage/sdcard0 symlink) and my old WhatsApp media now works as expected.

It's still very odd that the symlink didn't exist/work on 6.x though.

  • In my Android Lollipop: sdcard is a symlink to /sdcard/emulated/legacy && sdcard0 is a symlink to /sdcard/emulated/legacy && legacy is a symlink to /mnt/shell/emulated/0. There are other things to consider, such the group of the directories and the files. – Firelord Jan 14 '16 at 23:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.