Subject: Move Yun SD Simm from one Yun to another...

Hello,

I have a nicely setup Micro Simm SD in my Arduino Yun.

I would like to be able to move it to another Yun, let's say I fry up my first Yun , I don't want to lose my setups so would LOVE to just take out the SD and move it to a ne Yun device.

However, if I try and move it to a new Yun, it doesn't seem to see it.
I tried to put a blank SD in a new Yun , expand the Linux onto the blank SD, and once it's done, reboot it and replace the SD with my old SD that has my data... but the new Yun doesn't seem to want to mount it...

anybody knows how to move a SD from one Yun to another?

Thanks for reading,

Sean.

anyone? :frowning:

born2net:
I tried to put a blank SD in a new Yun , expand the Linux onto the blank SD, and once it's done, reboot it and replace the SD with my old SD that has my data... but the new Yun doesn't seem to want to mount it...

It sounds like you might be rebooting, and then replacing the SD card? Have you tried putting the card in first and then rebooting? After expanding Linux to the SD card, the system is actually booting from the SD card -- it probably won't like having the card changed out during or after the boot process.

I've not tried this yet. I have four Yuns for a distributed data collection project, and I would love to have a common image for all of them, but I've not tried to expand the disk space yet. So I will be very interested in hearing about the final outcome of this.

PS: it's a Micro SD card, not a SIM (or simm.) A SIM is a special memory device used in cell phones to define their behavior. The Micro SD card is a general purpose storage device. They may look similar, but are very different, and are not interchangeable.

Here is Federico's advice on this from before:
msg1718131
msg1702476

Uhmm it should indeed work. Two advices:

  1. plug and unplug the sd with the yun powered off, just in case
  2. with the sd UNplugged post the contents of file /etc/config/fstab, so we can check if its correctly set up

Hi, ya I can't get it to work....
when I run the Yun with no SD card, this is what my /etc/fstab looks like:

WARNING: this is an auto generated file, please use uci to set defined filesystems

(basically empty)

when I run the same new Yun with the old SD card that used to work (an SD card that has all my data) this is what the /etc/fstab looks like:

/dev/sda2 /overlay ext4 rw,sync,noatime,nodiratime 0 0

now this is the odd thing, if I run the command of:

mount /dev/sda2 /mnt/sda2

manually, it does mount my old sd card to /mnt/sda2

but I don't need it under /mnt, I need it as the / so when I reboot, it will use my SD as the main mount /

:frowning:

but even if I edit the /etc/fstab, and reboot, it always reverts back to the line of:
/dev/sda2 /overlay ext4 rw,sync,noatime,nodiratime 0 0

and does not mount my sd card as /

any help is appreciated,

Sean.

You can't mount the SD card as /.
/ is the root directory and it contains all the operating system files. The OS is booted from the flash memory so what you see under / is the filesystem loaded from the flash memory.

If you want to save your configuration files and move them from a yun to a different one you have to save your files in /mnt/sda and load them from there.

but if I just mount it manually, when I run commands like opkg install xxx it install in / and I will be out of space...

I bascially want it to be setup the way the Sketch the expands the SD to work, so the SD becomes the main storage for all operations, not the internal memory...

but if I run the Sketch to expand the SD again, it will erase the content of my SD which is what I am trying to avoid... basically I would like to be able to move my SD from one Arduino to the next, carrying with it all the data and configs...

born2net:
Hi, ya I can't get it to work....
when I run the Yun with no SD card, this is what my /etc/fstab looks like:

WARNING: this is an auto generated file, please use uci to set defined filesystems

(basically empty)

The key is the warning about the auto generated file. What you need to do is what is mentioned here:

noblepepper:
Here is Federico's advice on this from before:
msg1718131
msg1702476

Note that if you follow the first link, Federico says you basically have to add the lines that the second post says to delete. If you look closely, it's talking about a set of lines in /etc/config/fstab. This is used to build the /etc/fstab file at boot time.

Boot without a card, edit /etc/config/fstab and add these lines:

config mount
 option target '/overlay'
 option device '/dev/sda2'
 option fstype 'ext4'
 option enabled '1'
 option enabled_fsck '0'
 option options 'rw,sync,noatime,nodiratime'

Then insert the card and reboot. It should boot properly off of the external card.

The disk expander script does a lot of work partitioning/formatting/writing to the SD card. But the only thing it does to flash file system is add those lines. So, if you want a single card to work with multiple Yuns, run the script on the first one to set it up and make the card. Then make these changes to additional Yuns to get it to accept the card.

Beware: ALL of the Yuns must be running the same system update version, which must match the version on the card!

thank you for the assistance...
I did exactly as you mentioned.

  1. boot a new yun
  2. install 1.5.2
  3. reboot it with no SD
  4. edit /etc/config/fstab and pasted

config mount
option target '/overlay'
option device '/dev/sda2'
option fstype 'ext4'
option enabled '1'
option enabled_fsck '0'
option options 'rw,sync,noatime,nodiratime'

  1. turn off
  2. insert SD that works good in another yun
  3. turn on

BUT

it mounts the SD as

rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,size=30560k)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
/dev/sda2 on /tmp/overlay-disabled type ext4 (rw,sync,noatime,nodiratime,user_xattr,barrier=1,data=ordered)
overlayfs:/overlay on / type overlayfs (rw,relatime,lowerdir=/,upperdir=/overlay)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda1 on /mnt/sda1 type vfat (rw,sync,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
none on /proc/bus/usb type usbfs (rw,relatime)

as

/dev/sda2 on /tmp/overlay-disabled type ext4 (rw,sync,noatime,nodiratime,user_xattr,barrier=1,data=ordered)

so it is mounted, but not as the main file system, just at some odd /tmp/overlay-disabled dir

does this help

thx for reading,

Sean.

woowoowwo worked!!!!!!!!!!!

one more step needs to be added...

after reboot you need to run:
cp /.extroot.md5sum /tmp/overlay-disabled/etc/extroot.md5sum

to apply the new md5 to the old SD

TX, for all the help!!!!

and if you are looking for a good free sector by sector copy app for windows I used:

just make sure that your source yun micro SD and destination are of the same exact type card, otherwise prob won't work

I am working on a detailed instructions for Arduino Yun and node.js, will post here when done...