How to expand the storage memory on the Yún

It worked for me. Thanks

Does not look like the link to the sketch is working anymore (Page not found)?

We have also published it as a downloadable zip file. It's in the latest blogpost Time to Expand your Yún disk space and install Node.js | Arduino Blog

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.

http://forum.arduino.cc/index.php?topic=228204.msg1653830#msg1653830

Does running the Yun from the microSD have any impact on performance? I.e. what is the relative performance of a typical microSD vs the onboard memory?

Thanks.

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.

Software list updated. Installing software (this will take a while)...
err. installing e2fsprogs mkdosfs fdisk

Thank you @roadfun, we'll try to check free space before running it

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 sync
This 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

mount -o remount,async /dev/sda2

you'll see a great performance improvement (this is temporary: once you'll reboot, it will get back to "sync")

This is much more unsecure as files may get corrupted or you may lose data if the yun loses power while writing on the SD card

It's a trade-off and we chose with the conservative way as it is more secure and gives you a similar experience

roadfun:
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.

Software list updated. Installing software (this will take a while)...
err. installing e2fsprogs mkdosfs fdisk

@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

NewLine:
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.

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?

I know I am an asshole, but thanks for answering!

Unplug the sd and reboot the yun. Access it via ssh and edit file /etc/config/fstab as said in the previous post
How to expand the storage memory on the Yún - #2 by federicofissore - Arduino Yún - Arduino Forum ("If you encounter any error...")
Then rerun the procedure

Wow this is awesome, thanks for making the process easy and repeatable. Looking forward to installing a lot more packages with the room available.

Dumb question, but has anyone tried installing and using GCC on the yun and an expanded filesystem? :slight_smile: I'm guessing the limited memory and CPU will make compiling anything serious impossible, but it should be possible to do simple stuff right?

The only known way for that is cross compiling. Start here [0] and take inspiration from @fibasile script for nodejs [1]

[0] Cross Compile [Old OpenWrt Wiki]
[1] Compiling Node.js for Arduino YUN

Suppose I have 2 Yuns. On Yun1 I do the above and actually move the OS to the SD card.

Yun2 still uses the flash. How difficult would it be to modify Yun2 so that is works from the SD card from Yun1?

I am thinking of using the SD card as a way of distributing the whole setup of a Yun to people that do not want to configure the Yun themselves. It would be great if they could buy a Yun, plugin the SD-card and done.

It is as difficult as modifying a conf file on the flash 8) See last part of my reply at How to expand the storage memory on the Yún - #2 by federicofissore - Arduino Yún - Arduino Forum

You need to write that piece of conf instead of removing it

tdicola:
Dumb question, but has anyone tried installing and using GCC on the yun and an expanded filesystem? :slight_smile: I'm guessing the limited memory and CPU will make compiling anything serious impossible, but it should be possible to do simple stuff right?

Seconded on the request for someone to figure this out...

Unix without a native C compiler is pretty limited. The suggestion to cross compile is valid if you're rebuilding the OS, but is very problematic for "normal" people. It only works on one or two specific versions of Linux - No Mac compiling, and definitely no Windows support. The process of building the cross compiler is torturous to say the least. Everyone reports problems.

If there was an easily available, and simple to use cross compiler that shipped with the Arduino IDE then that would be a good start, but currently cross compiling "helloWorld" from scratch is days of work, and would require setting up a VM just of that purpose.

The suggestion that it's impractical to compile natively is bogus. Especially with this upgrade in place, storage is no longer an issue, and 400MHz/64Mb is actually pretty decent (I've compiled GCC on a 16MHz Machine with 4Mb RAM - it took pretty much a whole day, but that was totally OK).

The Linux side of the Yun is currently underused, because there's no easy way to write C programs for it...

This isn't meant to sound ungrateful - I appreciate the progress being made on the Yun. I'm just hoping to get this onto the todo list, as it would radically change the way we could work with the YUN.

dctsystems:
The suggestion that it's impractical to compile natively is bogus. Especially with this upgrade in place, storage is no longer an issue, and 400MHz/64Mb is actually pretty decent (I've compiled GCC on a 16MHz Machine with 4Mb RAM - it took pretty much a whole day, but that was totally OK).

I would love to see an installable gcc on the yun! It would also be a nice contribution to OpenWrt, that (AFAIK) has never had a installable package for gcc in 10 years
Since you've already done that, you may want to contribute with your experience

Fair call... I'll look into it...

I've seen a couple of people say they've had something working, but nothing released. The biggest problem is... there's no simple C compiler for Yun! Need to build the native compiler with a cross compiler, which I need to build on Debian, which is a pain.

Ian