Had the same problem a while ago. I'm using a Samsung 32 gb sd card. There was a corrupted file that made my sd card unmount randomly. I dont remember exactly what i did to fix it but i think i went through all the files somehow until i found the one that was corrupted and it unmounted it...