Which Arduino do you have the ethernet shield connected to? If you are using a Mega, this will cause a failure of the SD startup. It sets the w5100 SPI active before you start the SD. Bad news.
Serial.println("Initializing SD card...");
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
// this next call sets D10 as OUTPUT and LOW.
pinMode(10, OUTPUT);
if (!SD.begin(4)) {
Serial.println("initialization of SD failed!");
delay(1000);
return;
}
If you are using an Uno, it shouldn't matter. The SD.begin() call sets D10 (default SPI slave select) as OUTPUT and HIGH, so the w5100 is disabled by accident.