Xperia Z2: SD Card not being shown as mounted under Storage, but is accessible from file manager After I rebooted my Xperia Z2 running Lollipop 5.0.2, the micro SD card is not indicated as being mounted  in Settings &rarr; Storage. I see a button to mount it, and another one to erase it, but it is accessible from FX File Explorer and I can read from it, and write to it without a problem.  

Here's a screenshot of the Storage screen showing the card unmounted :  https://goo.gl/photos/VdtZNy8uN52q9N9e7  

If I remove it and put it back in while the phone is still on, it shows up just fine in the Storage (I see a button to unmount it, and another one to erase it).    

This makes me think that something is going wrong at start-up, that prevents it from being mounted properly.  

I tried several new micro SD cards, and I can tell you it's not a problem with the cards themselves.
Any help is appreciated.
After a lot of research and browsing the XDA-Developers Forum, it appears that the problem lies within the stock kernel I'm using, so I flashed this custom kernel instead http://forum.xda-developers.com/xperia-z2/development/kernel-andropluskernel-v10-t2974841 which appears to solve the issue.
I rebooted my phone a few times, and my SD card is being mounted properly after each reboot.
A word of caution though, don't flash this kernel if you're using XZDualRecovery, you must uninstall it first (there are detailed steps in the post I linked above).