Strange power problem

KandS:
I have an Adruino Mega2560 with Ethernet shield and two Nano's all connected to each other through I2C. The power supply comes from a 12v DC source which is put through a 9v regulator to power the boards via Vin.
When I power the Maga through its USB and the Nano's from the 9v everything works perfect, but when I change the Mega to run from the 9 volts the SD card gets corrupted on any attempt to read or write it. I have also tried powering the Mega through the jack socket instead of Vin but still the same problem.

Show a diagram of your connections.
Could be an earth problem between the various power supplies and your computer