Go Down

Topic: Upgrade from LininoOS to OpenWRT-Yun (Read 1 time) previous topic - next topic

aabm01

May 25, 2015, 12:59 pm Last Edit: May 26, 2015, 06:11 pm by aabm01
Hello

I have an Arduino Yun and I Upgraded from the OpenWRT-Yun to LininoOS, and then reflashed the U-boot, Kernel and rootfs for LininoOS.

Now I want to revert and reinstall the original version of linux that came with Arduino Yun, OpenWRT-Yun. But I'm not sure what would be the best and safe way to do it, considering that I reflashed the the U-boot, Kernel and rootfs for the LininoOS.

Would it be correct this order?

Reflashing the OpenWrt-Yun image on the Yún
Upgrading the OpenWrt-Yun image on the Yún


Thanks

aabm01

The only thing I have done has been Reflash.

Reflashing the OpenWrt-Yun image on the Yún

And everything seemed Ok, but...

I didn't say that with the LininoOs I had expanded my Yun with a 8GB microSD Card (4GB data, 4GB Linux) following the steps How to expand the Yún disk space.

Now, when I have done the reflash, the microSD Card was in the board. I thought that the reflashing of the OpenWrt-Yun image would be in the flash memory and that I would have to expand again in the microSD Card.

So after reflash, I tried to expand, this time (5GB data, 3GB Linux) and the process stopped at this point:

"Partitioning (this will take a while)"

I just thought it didn't work, and after a while I decided to unplug the board, take off the microSD Card to format it, and try again, but when I plugged the Yun again,  I couln't see the COM port, so I thought that probably part of the linux still was in the microSD Card, so I placed the card in the Yun and then I could see the COM port.
Then I checked the space on the card was:

root@Arduino:/# df -h / /mnt/sda1
Filesystem                Size      Used Available Use% Mounted on
rootfs                       6.9M    356.0K      6.6M   5% /
/dev/sda1                 4.9G     12.0K      4.9G   0% /mnt/sda1
root@Arduino:/#

Where the rootfs 6.9M doesn't has sense, it must be 3GB.

So:
Are there a way to reflash the OpenWrt-Yun image only in the flash memory, to be able to format the microSD Card and try to expand again?
Or something else...

It looks that I can't access the serial port COM without the microSD card.



Thanks

Wuerfel_21

I dont think the serial port not being there has to do with that...
I sometimes need to unplug and replug the yun a few times unti my PC finds the COM port...
also it sometimes helps double-clicking the reset button.

aabm01

#3
May 26, 2015, 07:17 am Last Edit: May 26, 2015, 07:19 am by aabm01
You were right Wuerfel_21

I got the COM port back (without microSD card) after double-clicking the MCU reset button.

The conclusion would be that, if you have your Yun expanded with a microSD card, after reflash the OpenWrt-Yun image (U-boot, kernel and rootfs), and before expand again you would have to:

1- Format you card. I used https://www.sdcard.org/downloads/formatter_4/

2- Expand http://www.arduino.cc/en/Tutorial/ExpandingYunDiskSpace

Thanks

ShapeShifter

The conclusion would be that, if you have your Yun expanded with a microSD card, after reflash the OpenWrt-Yun image (U-boot, kernel and rootfs), and before expand again you would have to:

1- Format you card. I used https://www.sdcard.org/downloads/formatter_4/

2- Expand http://www.arduino.cc/en/Tutorial/ExpandingYunDiskSpace
Correct. When you expand onto the SD card, it copies the system files over to the card, but the Yun still boots from the internal flash memory (at least initially.) After the initial boot steps are over, and the kernel has been loaded into memory, it finally maps the system to the SD card and continues to boot from there. This happens at every boot.

What this means is that the kernel comes from internal flash, but all of the other processes that interact with the kernel come from the SD card. It's imperative that the kernel and the SD card image be a matched set. If you upgrade one without upgrading the other, unpredictable things could happen.

There may be more efficient ways to handle it, but the safest way to upgrade the system is to remove and format the SD card, upgrade the system, then re-expand onto the card.

aabm01

#5
May 26, 2015, 06:10 pm Last Edit: May 26, 2015, 06:31 pm by aabm01
Very good and clear explanation. thanks

Now I am stuck in the next step and do not understand why!!

After I have expanded my Yun with a 8GB microSD card and installed node.js and node-serialport.js, everything was OK.

The next step was to edit the /etc/inittab, and before doing it I wanted to check whether unplugging the microSD card, I could access SSH via serial port COM with the root file system that is in the flash memory.

Once I was checked that it was Ok. I wanted to plug the microSD card again to work with my Yun expanded, so I unplugged my Yun, plug the microSD card and plug the Yun again and when I enter via SSH and typed:

root@ofcyun:/# df -h / /mnt/sda1
Filesystem                Size      Used Available Use% Mounted on
rootfs                    6.9M      1.3M      5.7M  19% /
df: /mnt/sda1: can't find mount point
root@ofcyun:/#

So it doesn't recognize the microSD card, I don't get errors , and I didn't edit the /etc/config/fstab.

Once I have plugged the microSD card I reboot both the Linux and Arduino parts.

So, Are there something that i have missed?  

Thanks

ShapeShifter

I'm not sure what you're saying. If you expanded onto the SD card, you need to boot with the SD card in place, and keep it in place: if you pull it out while booted, you will run into trouble, and putting it back in while booted probably won't work properly.

It sounds like you pulled the card out and tried to put it in while already booted up? Don't do that.

aabm01

#7
May 26, 2015, 07:00 pm Last Edit: May 26, 2015, 07:43 pm by aabm01
Sorry. I didn't explain it very well.

I got my Yun expanded as I explained in the post above, and installed node.js and node-portserial.

I want to use Johnny-five and to get it running I have to edit the /etc/inittab file commenting the last line:

::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
#ttyATH0::askfirst:/bin/ash --login

And before editing the file /etc/inittab (supposedly placed in the microSD)  I wanted to be sure If I could run the Yun without the microSD, with the /etc/inittab that is in the flash memory so.

Unplug the Yun from the laptop
Pull the microSD out
Plug the Yun to the laptop

The Yun worked Ok. I could access SHH via Serial port COM, Ethernet, and Wifi. So once made the checking. I wanted to put the microSD in again, so:

Unplug the Yun from the laptop
Put the microSD in
Plug the Yun to the laptop

An after a couple a minutes I checked via SSH if the Yun recognized the microSD and it didn't

root@ofcyun:/# df -h / /mnt/sda1
Filesystem                Size      Used Available Use% Mounted on
rootfs                    6.9M      1.3M      5.7M  19% /
df: /mnt/sda1: can't find mount point
root@ofcyun:/#

And I don't know Why, probably I have missed something.

Thanks

ShapeShifter

n after a couple a minutes I checked via SSH if the Yun recognized the microSD and it didn't

root@ofcyun:/# df -h / /mnt/sda1
Filesystem                Size      Used Available Use% Mounted on
rootfs                    6.9M      1.3M      5.7M  19% /
df: /mnt/sda1: can't find mount point
root@ofcyun:/#
Interesting. It's recognizing the system partition on root, but not the data partition on /mnt/sda1.

Are you sure the data partition was working properly after you expanded the disk space?

aabm01

Yes, the data partition was working properly after I expanded the disk space

He hasn't recognized either the root, it had to be something like:

Filesystem                Size      Used Available Use% Mounted on
rootfs                       3.2G    356.0K      3.2G   0% /
/dev/sda1                 4.0G     12.0K      4.0G   0% /mnt/sda1
root@Arduino:/#

Because the microSD was 8GB, and the data partition was 4GB.

I did check the data partition  under /usr/lib/node_modules/ we have the libraries, node, node-portserial, etc
And I tested node.js working.

So, for your response I understand that, when I put in the microSD again, the Yun should have mounted the microSD and worked as expanded. Am I right?

ShapeShifter

He hasn't recognized either the root, it had to be something like:
Yes, you're right, that 6.9M root partition is the built in flash. I misread it as GB and assumed that was your SD card.

Quote
So, for your response I understand that, when I put in the microSD again, the Yun should have mounted the microSD and worked as expanded. Am I right?
Yes, that should've worked.

I just took one of my Yuns, on which I had expanded the file system onto the SD card: Ipulled out the SD card, booted it up, and ran df -h on it:
Code: [Select]
Filesystem                Size      Used Available Use% Mounted on
rootfs                    6.9M      1.3M      5.7M  18% /
/dev/root                 7.5M      7.5M         0 100% /rom
tmpfs                    29.8M    100.0K     29.7M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3            6.9M      1.3M      5.7M  18% /overlay
overlayfs:/overlay        6.9M      1.3M      5.7M  18% /


Then I put the Sd card back in, cycled power, and ran df -h again:
Code: [Select]
Filesystem                Size      Used Available Use% Mounted on
rootfs                    5.7G    219.6M      5.2G   4% /
/dev/root                 7.5M      7.5M         0 100% /rom
tmpfs                    29.8M    108.0K     29.7M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda2                 5.7G    219.6M      5.2G   4% /overlay
overlayfs:/overlay        5.7G    219.6M      5.2G   4% /
/dev/sda1                24.0G      5.8M     24.0G   0% /mnt/sda1


On my 32 GB SD card, it properly recognized the 5.7 GB root partition, and the 24 GB data partition.

Perhaps you didn't seat the SD card properly? Maybe a problem with the SD card? Maybe you have some bad contacts in the SD card socket? (If you look at the socket, some people have had problems where the small brass fingers that are the card detect contacts don't make contact properly.)

aabm01

#11
May 27, 2015, 07:59 am Last Edit: May 27, 2015, 08:02 am by aabm01
I can't believe it, after read your message I cleaned the microSD's contacts, plugged it again and voila. It was a new card !!!

I typed df -h and:

Code: [Select]
root@ofcyun:/# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    3.2G    354.7M      2.7G  11% /
/dev/root                 7.5M      7.5M         0 100% /rom
tmpfs                    29.8M    148.0K     29.7M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda2                 3.2G    354.7M      2.7G  11% /overlay
overlayfs:/overlay        3.2G    354.7M      2.7G  11% /
/dev/sda1                 4.0G     12.0K      4.0G   0% /mnt/sda1


It's this kind of things that sometimes you don't think on it

Thanks

Go Up