Strange power problem

Ok after getting my wires crossed and blowing up the Mega board, I have rebuilt hoping the original problem wouldn't be there but it is.
So what I have found out is the 9v causes the mega to corrupt the SD card no mater where I apply it ie Vin or the jack. 12v on the jack works ok, but this is not a long term option due to the load on the on board regulator.
5v to the vIn, so far has not caused any problems to the SD card, so this looks like the solution, I can just add a 5v buck regulator.

It would have been nice to know why the SD card was corrupting under certain power configurations but I suppose that just life