MicroSD not able to initialize often

Digital pin 4 is the SD slave select.
Digital pin 10 is the w5100 slave select.
Digital pin 53 is the default slave select.

The SD.begin(4) will set the default slave select as OUTPUT and HIGH.

If you are using a Mega, you must disable the w5100 slave select before initializing the SD. If you don't, the w5100 will trash up the SPI, and chances are the setup will fail.

The SPI data lines are on the ICSP pins as well as on pins 50-52 on the Mega and pins 11-13 on the Uno. The ICSP connector is how the ethernet shield gets those SPI lines from either model, not the digital pins.

This post has code that I use to initialize both devices if I want to use them together.