I have a 256gig card and it gets corrupted every few months. I turn off my phone, take it out, reformat it on my computer, put all my data (mostly music) and put it back in the phone. I'm guessing the problem is using the old unreliable FAT format.
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. Putting the data back on the phone solves it for a while, until the corrupted file gets indexed or something again.