How to expand the storage memory on the Yún

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

The MIPS Linux pull request for the 3.14 kernel provides support for the MIPS interAptiv and proAptiv processor cores...

http://www.sniff.org.uk/2014/05/building-gcc-for-yun-in-12-not-easy.html

Done!

It was a torturous process, but I've got a working GCC toolchain running on Yun. It's got a couple of hacks in places and its completely untested, but I've complied a couple of simple test programs with it.

I'm currently making a tar file with a complete toolset in, and I'll add a link to that as soon as its uploaded somewhere. Hopefully my notes can help someone else to a better job, and turn into a proper installable package.

The sketch worked great, but as I noted in a separate thread, for me the 2GB data partition I specified runs around 12 times slower than the ext4 overlay partition. Rebooting without the sd card, inserting and reformatting sda1 as ext4 dropped a 1MB file create from 120 seconds to around 7 seconds.

When I come to the Proceed with partitioning micro SD card ,
I got err. formatting to FAT32.

I use a Kingston 8GB class 10 micro SD card.

Can you change

#define DEBUG 0

to

#define DEBUG 1

and paste the output?

This is the log :

This sketch will format your micro SD card and use it as additional disk space for your Arduino Yun.
Pleaseyou have ONLY your micro SD card plugged in: no pen drives, hard drives or whatever.
Do you wish to proceed (yes/no)? yes

Starting Bridge...

Ready to install utility software. Please ensure your Arduino Yun is connected to internet.
Ready to proceed (yes/no)? yes

Updating software list...

Software list updated. Installing software (this will take a while)...

e2fsprogs mkdosfs fdisk rsync installed

Proceed with partitioning micro SD card (yes/no)? yes

Enter the size of the data partition in MB: 4000

Partitioning (this will take a while)...

mkfs.vfat 3.0.12 (29 Oct 2011)

err. formatting to FAT32


This is the system info :

Firmware Version Linino Barrier Breaker devel / LuCI Trunk (svn-r9877)
Kernel Version 3.8.3


First I try to reinstall the OpenWrt-Yun image by the web panel.
The WLAN keep blinking over 10-15 minutes and don't stop , which I think it is not right.

Then I try to do it using Terminal and I got the following error :
root@MyArduino:~# run-sysupgrade /mnt/sda1/openwrt-ar71xx-generic-yun-16M-squash
fs-sysupgrade.bin
cp: read error: Input/output error

I'd say the sd card is broken

Actually , I bought 2 same SD cards , both of them can not pass the step too.

They run perfectly fine on mac and window, showing that it has around 8 GB free space.

However , when I test it on Arduino UNO with Ethernet shield, running the CardInfo example, I got strange result :

Volume type is FAT32

Volume size (bytes): 3654471680
Volume size (Kbytes): 3568820
Volume size (Mbytes): 3485

Files found on the card (name, date and size in bytes):

It shows only around 4GB space.

Does it mean Arduino has some max limitation on the SD volume ?
or Class 10 card , or Kingston brand card does not work on Arduino ?

Is it the matter of using a Micro SDHC card rather than Micro SD card ?
Have anyone use the Mirco SDHC card can pass the step ?

AFAIK, SDHC are supported Does Arduino Yún support microSDHC or microSDXC cards? - Arduino Yún - Arduino Forum

When the file-system is moved to the SD card (pivot root using:

config mount
        option target        /
        option device        /dev/sda1
        option fstype        ext4
        option options       rw,sync
        option enabled       1
        option enabled_fsck  0

is there a way to access the filesystem that is still on the flash, without removal of the SD card?
E.g. how can I access the /etc/config/fstab file on the Yun flash?

hi ,
when the running the script , i got the following error.

"err formatting fat32"

Please help me to resolve this issue.Size of the micro sd card is 8GB

NewLine:
...
is there a way to access the filesystem that is still on the flash, without removal of the SD card?
E.g. how can I access the /etc/config/fstab file on the Yun flash?

Power off Yun , take out SD card. power on Yun again to access flash.

infotorpk:
hi ,
when the running the script , i got the following error.
"err formatting fat32"
Please help me to resolve this issue.Size of the micro sd card is 8GB

take out SD card, put it into Windows machine to test format.

or

at Yun

fdisk /dev/sda
mkdosfs -F 32 /dev/sda1

partition and format SD card.

Thanks for the script :slight_smile: