Go Down

Topic: How to expand the storage memory on the Yún (Read 44497 times) previous topic - next topic

jotadepicas

After I formatted the SD card, I put it back on the Arduino YUN and kept on going with the following steps.

mkdir -p /mnt/sda1
mount /dev/sda1 /mnt/sda1
mkdir -p /mnt/sda1/arduino/www
mkdir -p /mnt/sda2
mount /dev/sda2 /mnt/sda2
rsync -a --exclude=/mnt/ --exclude=/www/sd /overlay/ /mnt/sda2/
umount /dev/sda1
umount /dev/sda2
uci add fstab mount
uci set fstab.@mount[0].target=/overlay
uci set fstab.@mount[0].device=/dev/sda2
uci set fstab.@mount[0].fstype=ext4
uci set fstab.@mount[0].enabled=1
uci set fstab.@mount[0].enabled_fsck=0
uci set fstab.@mount[0].options=rw,sync,noatime,nodiratime
uci commit

I just used your steps to expand an Arduino Dragino Yun Shield, and they worked, but the first time I tried them they didn't. Not exactly sure, but I suspected maybe I had to disable the already mounted overlay device (which in my case was /dev/mtdblock3). So before entering your uci commands, I did:

uci add fstab mount
uci set fstab.@mount[0].device=/dev/mtdblock3
uci set fstab.@mount[0].enabled=0
uci commit


As I said, not really sure this was an issue, but the second time I tried this and it worked.

Otherwise, your solution worked fine, thanks!

ethanhall9

The SD card expansion procedure for Arduino Yún Rev 2 does not seem to work (for me, at least).

The SD card becomes available, but the Yún does not run Linux from it nor does it let me install packages on it, so I am left with very little space for software.

Also, it seems that the software does not get very frequent updates. Is there an alternative?

I get this error message in the serial console (see log below):

*** Warning - bad CRC, using default environment

The Yún runs LEDEYun 17.11, r6773+1-8dd3a6e (came pre-installed) and I am using a 16 gig SD card from Kingston.

I have followed the guide here:
https://www.arduino.cc/en/Guide/ArduinoYun

The guide states:
"You can use external memory like a microSD card or thumb drive for saving data, or your own scripts, web pages, etc. For the Yún rev. 2 to access and store information on these drives through the 32U4, they need to have a directory named arduino in the root of the volume. If you plan to use a microSD memory card, you can expand the Yun Disk Space following this tutorial."

Said tutorial has a link for the Rev 2 and states that I can install packages and run the system from the SD card.

I followed the tutorial, and used this sketch:
https://github.com/arduino/yun-go-updater/blob/master/YunDiskSpaceExpander/YunDiskSpaceExpander.ino

Here is the entire log from the serial console (redacted for privacy):

This sketch will format your micro SD card and use it as additional disk space for your Arduino Yun.
Please ensure you 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 dosfstools fdisk rsync kmod-fs-ext4 installed

Proceed with partitioning micro SD card (yes/no)? yes
Enter the size of the data partition in MB: 6000
Partitioning (this will take a while)...
Micro SD card correctly partitioned

Creating 'arduino' folder structure...
Copying files from Arduino Yun flash to micro SD card...
Enabling micro SD as additional swap... enabled

Enabling micro SD as additional disk space... enabled

We are done! Yeah! Rebooting to apply the changes.reboot
root@Arduino:~# [ 4329.066125] wlan0: deauthenticating from [Redacted: mac address] by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4332.215945] Removing MTD device #5 (rootfs_data) with use count 1
[ 4332.238119] reboot: Re⸮

U-Boot 1.1.5-linino-g2d891225 (Nov 22 2017 - 09:06:12)

Linino Board (ar9331) U-boot
DRAM:  64 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 218k for U-Boot at: 83fc8000
Reserving 192k for malloc() at: 83f98000
Reserving 44 Bytes for Board Info at: 83f97fd4
Reserving 36 Bytes for Global Data at: 83f97fb0
Reserving 128k for boot params() at: 83f77fb0
Stack Pointer at: 83f77f98
Now running in RAM - U-Boot at: 83fc8000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16777216, sector count = 256
Flash: 16 MB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   eth0: [Redacted: mac address]
eth1: [Redacted: mac address]
eth0, eth1
autoboot in 4 seconds (stop with 'ard')...
## Booting image at 9f050000 ...
  Image Name:   MIPS LEDEYun Linux-4.9.91
  Created:      2018-04-27   9:20:02 UTC
  Image Type:   MIPS Linux Kernel Image (lzma compressed)
  Data Size:    1471362 Bytes =  1.4 MB
  Load Address: 80060000
  Entry Point:  80060000
  Verifying Checksum at 0x9f050040 ...OK
  Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 67108864

Starting kernel ...

[    0.000000] Linux version 4.9.91 (arduino@openwrt-yun) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6773-8dd3a6e) ) #0 Tue Apr 24 17:17:07 2018
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9330 rev 1


... Redacted because of message size restrictions on the forum.

rainiercito

#92
Nov 26, 2019, 03:31 am Last Edit: Nov 26, 2019, 04:11 am by rainiercito
Error Unable to connect: retrying (0)... while following the directions to expand the sd detailed in below link.

https://www.arduino.cc/en/Tutorial/ExpandingYunDiskSpace

I'm trying to use a 2GB SDCard with an Arduino Yun rev2 by using the Arduino 1.18.10 Mac desktop software connected.

The port to which I'm connected is the network port (arduino yun's IP address)

I have this version:

BusyBox v1.28.3 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 LEDEYun 17.11, r6773+1-8dd3a6e

And the file system looks like this:

root@Arduino:/mnt/sda1# df -h / /mnt/sda1
Filesystem                Size      Used Available Use% Mounted on
overlayfs:/overlay        5.6M      1.0M      4.5M  19% /
/dev/sda1                 1.8G      2.4M      1.8G   0% /mnt/sda1

Should I have to perform a "hard-reset" to my Arduino and follow the directions as first thing to do after the reset?

Any suggestion to solve my issue, it will be highly appreciated.

racpra16

Follow the guidelines for How To Expand The YUN DISK SPACE https://www.arduino.cc/en/Tutorial/ExpandingYunDiskSpace

For the reboot, you need to press the YUN RST button. and then, you will see the context msg in the serial monitor.
 
You can press Enter twice or I would recommend you to install PUTTY(Optional) for serial communication and follow the guidelines below after your message in serial monitor:-
Close Serial Monitor.
Open Putty and do the steps below.

​​​
As you can see we have 2.5 GB of free disk space.
As per the link Expanding YUN disk space, you can see the partition at the bottom of the page:-

df -h //mnt/sda1

The output should look like this:

Filesystem       Size    Used Available Use% Mounted on
rootfs              1.2G    51.7M   1.0G   5%/  // This is the overlay partition and your files will be stored under this partitioned memory.
/dev/sda1       698.6M  12.0K   698.6M   0%/mnt/sda1


Try installing one package after the opkg update for instance (*opkg install python-pip* or *opkg install vim*)

Go to the *cd /usr/bin* and type *ls*. You can see the list of installed packages over there plus *python-pip* and *vim also*.

Close the serial communication and remove the SD card, and, open the serial communication again and try searching the packages in *cd /usr/bin* by *ls*.

You won't see it as these packages are installed in the overlay partition i.e the memory card partitioned by Yun disk space expander.

Go Up