You might have noticed that on the Linux side of the Yún the amount of available storage memory of the onboard flash memory is limited. Installing additional software packages you can run out of space soon. You can manually install software packages on an external SD card but it's tricky...and it's manual. OpenWRT gives you the possibility to move the root file system to an external storage as large as desired.

We wrote a sketch that is able through the Bridge library to format the SD card, prepare the partitions and configure the system to change the root directory. Then to move all your previous configuration to the new root file system.

Here the sketch:https://github.com/Fede85/YunSketches/blob/master/YunOverlayOnSD/YunOverlayOnSD.ino

The advantage of this approach is that you only need to upload a sketch and follow the step-by-step procedure on the serial monitor.The requirements are only the presence of the SD card in the socket and that the Yún is connected to internet.

As you can see I went from 6.7M available to 788.2M and my /mnt/sd folder has 1G

If you encounter any error and would like to restore your yun to its previous state, all you need to do is to reboot it with the SD card UNplugged, then edit file /etc/config/fstab removing the following section

My first Yun conversion went smoothly. But my second one failed (error detailed below). I surmised this was a issues with free space on / (of course that's why I was happy to see this extension scheme). I recalled I was at about 90% before running the conversion script. I removed a couple of packages to get to 83% full on / and re-ran the sketch. It ran correctly.

Bottom line is you may want to ensure you have about 80% free space on / before running this conversion.

Regarding performance, we observed similar performances. However, when running on the SD card the Yun could go much much faster

When configuring the SD card, we forced writes to be in syncThis ensures that files do not corrupt even if you suddenly unplug the yun while you're writing a file (or at least this reduces the changes that such a corruption may happen)However, if you just run the following command

My first Yun conversion went smoothly. But my second one failed (error detailed below). I surmised this was a issues with free space on / (of course that's why I was happy to see this extension scheme). I recalled I was at about 90% before running the conversion script. I removed a couple of packages to get to 83% full on / and re-ran the sketch. It ran correctly.

Bottom line is you may want to ensure you have about 80% free space on / before running this conversion.

@roadfun: Good point! thank you!!I've checked and the 4 software you need to install for this procedure requires around 700KB.So, I've added a function that checks if you have at least 1MB of free space on the flash memory and stops the procedure if you don't have enough space.

You can find the updated code on github or at zip attached to the tutorial page: http://arduino.cc/en/Tutorial/ExpandingYunDiskSpace

This is a really good idea! However I would rather just run/tweak the Linux script instead of via the sketch. Any Chance of publishing this? If not, I'll extract it from the sketch myself.

We decided to adopt the "Arduino sketch way" to keep the procedure as simple as possible (means you don't have to deal with the Linux terminal). I'm sorry but we are not going to publish a Linux bash script with the same commands. However, extracting them form the sketch is very simple.

F

EnricoSandoni

the procedure has been easy, thanks but during this I haven't read carefully and I made the Linux partition bigger than I wanted and trying to do the procedure again "arduino" says that the sd is already been prepared/modified..how can I do?