Help !! Arduino yun SD card not mounting

Im using a new Kingston micro SD SDC 2Gb for my yun. After I ran the Cardinfo sketch, just to make sure the card was mounted, I'm getting initializing Failed. I have formatted the the card to FAT and FAT32, Yun rst, tried other sd cards and even came across a thread stating it was probably a hardware problem with the metal pins not touching and to use a screwdriver but still nothing.

What is the "Cardinfo sketch"? Is it an example for the SD library?

If so, that sketch, and in fact the entire SD card library will never work on the Yun. That library is intended for shields that attach the SD card directly to the Arduino processor. The Yun is completely different in that regard.

On the Yun, the SD card is not directly accessible from the Arduino processor or any sketch. The card is managed by the Linux processor. You must use the Bridge library (or an alternative means) for a sketch to be able to access the SD card.

Look at the Bridge library's FileIO class documentation, and start with the DataLogger and FileWriteScript examples.

This code works perfectly with my Yun (it will create a text file named “test.txt” and it write under "your content’) :

#include <FileIO.h>
void setup() {
    Serial.println("File write example");
    if (!FileSystem.begin()) {
        Serial.println("Init Failed !");
    File file ="/mnt/sda1/test.txt", FILE_WRITE);
    if (!file) {
        Serial.println("Open Failed !");
    file.print("your content");

Ok I did try the bridge Datalogging sketch code and im still getting that error even if i used a pen drive. I used the same sketch on another yun and it works flawlessly. So im not sure if its a hardware problem or something else because the 1st yun was bought recently were as the other one was bought last year janurary :/

I have seen a couple people report that they had problems with a new Yun recognizing an SD card - seems they have had some issues with the contact fingers of the SD card not making contact with the card. Maybe you have a bad SD card socket?

Yes I think so, even the usb port isnt working :/ I tried it on the old yun and everything works just fine.


Sorry for bringing this topic up but I think it would be useful for future reference as I was looking for this same issue.

I was having problems with yun and SD card, DataLogger example resulting in "error opening datalog.txt". In my case the problem was with the SD card itself (Samsumg 16GB SDHC). As I haven't found any constraint about the size my guess is a manufacturer problem. After I took a different SD card (Unknown 8GB SDHC) the problem was solved.

kreiss12: Yes I think so, even the usb port isnt working :/ I tried it on the old yun and everything works just fine.

@kreiss12, if your USB port is not working, then it is likely a hardware issue as the USB port is tied to the SD port. I forget how, but I can look it up if anyone wants to know. I recall there was a comment in the software scripts.