Arduino Yun Datalogger problem

Hi everyone, i'm trying to use datalogger functions with arduino yun, but when i run the example sketch arduino doesn't create the file on the sd. The sd is working correctly ( i can upload file on it trough the www folder ). The sketch is this:

#include <FileIO.h>

void setup() {
  // Initialize the Bridge and the Serial
  Bridge.begin();
  Serial.begin(9600);
  FileSystem.begin();

  while(!Serial);  // wait for Serial port to connect.
  Serial.println("Filesystem datalogger\n");
}


void loop () {
  // make a string that start with a timestamp for assembling the data to log:
  String dataString;
  dataString += getTimeStamp();
  dataString += " = ";

  // read three sensors and append to the string:
  for (int analogPin = 0; analogPin < 3; analogPin++) {
    int sensor = analogRead(analogPin);
    dataString += String(sensor);
    if (analogPin < 2) {
      dataString += ",";  // separate the values with a comma
    }
  }

  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  // The FileSystem card is mounted at the following "/mnt/FileSystema1"
  File dataFile = FileSystem.open("/mnt/sd/datalog.txt", FILE_APPEND);

  // if the file is available, write to it:
  if (dataFile) {
    dataFile.println(dataString);
    dataFile.close();
    // print to the serial port too:
    Serial.println(dataString);
  }  
  // if the file isn't open, pop up an error:
  else {
    Serial.println("error opening datalog.txt");
  } 

  delay(15000);

}

// This function return a string with the time stamp
String getTimeStamp() {
  String result;
  Process time;
  // date is a command line utility to get the date and the time 
  // in different formats depending on the additional parameter 
  time.begin("date");
  time.addParameter("+%D-%T");  // parameters: D for the complete date mm/dd/yy
                                //             T for the time hh:mm:ss    
  time.run();  // run the command

  // read the output of the command
  while(time.available()>0) {
    char c = time.read();
    if(c != '\n')
      result += c;
  }

  return result;
}

Open the file you'll be writing the data to using a File object and FileSystem.open(). With the modifier FILE_APPEND, you can write information to the end of the file. If the file doesn't already exist, it will be created. In this case, you'll be creating and writing to a file at the root directory of the SD card named "datalog.txt".

From linino cxonsole type:

touch /mnt/sd/datalog.txt

to confirm directory exist.

How can i open the linino console?

http://forum.arduino.cc/index.php?topic=217733.msg1596193#msg1596193

Here is an observation, after i logged in via SHH(Command in your terminal: ssh root@ipAddressOfYun) and went to the mnt folder (Command : cd /mnt) , the sd card was mounted as sda1.
Therefore i change the the following line in the example sketch from File dataFile = FileSystem.open("/mnt/sd/datalog.txt", FILE_APPEND);
to File dataFile = FileSystem.open("/mnt/sda1/datalog.txt", FILE_APPEND);

After this the file datalog.txt was successfully created in the path/mnt/sda1/, to check this get into the /mnt/sda1 folder (cd /mnt/sda1) and then type (ls -l)
Note: this was a SD card, that i was using in my Android phone.

Thanks it worked now, i was having sda1 folder instead of sd. So changed the code to sda1 and it worked.

/mnt/sda1 is where an SD card is usually mounted, although it could also appear as /mnt/sda2 or higher, depending on circumstances.

Because there is sometimes some variability in the mount point, the system looks at a recently mounted SD card, and if it contains a folder named arduino at the root of the SD card, it will create a symbolic link to the SD card at /mnt/sd.

Using /mnt/sda1 will usually work, but sometimes you will need to use /mnt/sda2 or something else.

Using /mnt/sd should always work, as long as you have the folder named arduino at the SD card root. If you don't have it, create it, but the /mnt/sd link probably won't be created until you re-insert the card after creating the folder.