site  news  contact

Easy version upgrade and downgrade

December 19, 2018 — BarryK

A significant feature of EasyOS is the ease of upgrading to new versions, and rollback to older versions and snapshots, and roll-forward again.

A fully-automatic GUI could be created for this, for now it is partially-GUI with some manual steps -- very easy steps though, and possibly more personally satisfying to have that personal input that have everything done automatically.

Any installation of EasyOS can be upgraded and downgraded, whether running off a USB-stick or an internal drive.

The exception is the live-CD, which is only provided for those people with computers that will not boot from a USB-stick, as a means to perform an installation to internal drive.

The case study in this tutorial is the installation to Kingston 240GB SSD that the Author performed on his Mele PCG35 Apo mini-PC, see that tutorial here:

https://easyos.org/install/how-to-install-easyos-on-a-new-ssd.html

The Mele PCG35 Apo has 32GB SSD on-board, with interfaces for 2.5inch SATA3 HDD/SSD and M.2 SSD. It is a nice unit, passively-cooled and with snappy performance. A snapshot taken soon after it arrived, booting up Easy from a USB-stick:

image0

Here, in a nutshell, is how to upgrade:

How to upgrade
Replace the three files
vmlinuz, initrd and easy.sfs in the boot-partition, with those of the new version.
Click on
initrd to automatically "fix" the BOOT_SPECS file inside it.
Reboot, and you have upgraded.

...that's it, you have upgraded! It is easy-peasy. We don't really need a tutorial, however it is useful to read through the rest of this tutorial to get clear confirmation of the steps and some explanation of how-and-why.

In the case study, Easy is installed to drive sda. The Author set the boot-partition as sda1, vfat filesystem, and sda2 is the working-partition, ext4 filesystem. He also set WKG_DIR='easy' in the BOOT_SPECS file, so that Easy will do its "thing" in /mnt/sda2/easy, keeping everything clear of the rest of the partition, making it simpler to use the rest of sda2 for anything else.

Here is a view of the content of the "easy" folder, showing folders that Easy has created:

image1

...if you would like to read some more about those folders, see here:

https://easyos.org/tech/how-easy-works-part-2.html 

Now for the great part, the actual upgrade...

Upgrading the boot-partition

You need to obtain the new version of EasyOS. This could be the .img.gz image-file, live-CD .iso file, or you may already have written to a CD or USB-stick.

Whatever, it will have inside it, the files vmlinuz, initrd and easy.sfs. if it is the *.img.gz file, all that you have to do is click on it twice -- first time will uncompress it, second time will open it up -- in practice, you will find that is quite simple. Ditto for the *.iso file, just click on it to open it up.

For the case-study, the Author has the new version on a USB-stick. When plugged-in it showed up as drive sdb. So, upgrading simply consists of replacing those files in the boot-partition, by dragging, as shown:

image2

...sda1 is the boot-partition, in the Kingston SSD, and the files have been upgraded by dragging across.

There is just one more teensy thing to do. File initrd has inside it a file named BOOT_SPECS, that has some variables needed at bootup. Those variables are OK for initrd in the USB-stick, but need to be fixed in the new location.

Fortunately, this fix is automated. Just click on initrd, and this pops up:

image3

...it is quite safe to choose "Yes" here, despite that caution. Then, another window pops up:

image4

You do need to look carefully at those variables, make sure they are correct. Auto-fixing was not quite right in versions prior to 0.9.14, but now it is looking good.

They are pretty self-explanatory. "BOOT_DISKID" and "WKG_DISKID" is explained elsewhere:

https://easyos.org/install/how-to-install-easyos-on-your-hard-drive.html

Notice WKG_DIR='easy/', which, as mentioned early in this tutorial, was the Author's decision. The trailing "/" is required, but if you leave it off, no problem, as the scripts that read this file will append it if missing.

If you had left WKG_DIR='', then Easy would create all those working folders "containers", "home", "releases", "sfs", etc., at the top-level of the working-partition.

Those variables in the above snapshot look good, so click "Yes", and installation is done. Next, reboot...

Version management

After rebooting, you will be running version 0.9.14, in the case study, the Author upgraded from 0.9.13. It is fruitful to have a look around in those "releases" and "sfs" folders -- you will see that the older version is still there.

Which means that you can roll back to it if desired, or to any earlier snapshot. There is a really great GUI to handle this, via the Filesystem menu:

image5

And here is Easy Version Control:

image6

...in this case-study, the Author had created one snapshot, "Snapshot 201812172141". The other one, "Release 0.9.13" is the status at first startup of version 0.9.13.

"Release 0.9.14" is the status at first startup of version 0.9.14.

The really great thing is, you can roll forwards and backwards to any of these "Release*" and "Snapshot*" status captures.

Technically, what is being referred here as the "status" is the content of the /mnt/wkg/.session folder, which is the read-write folder in the aufs/overlay layered filesystem.

Note the little button with picture of a page -- click on that to see commentary on snapshots, which makes it easier to decided what snapshot you might like to roll back/forward to.

Note also, the "Depth" parameter, set to "3". This means that the history is set to only three versions. When you make the fourth version upgrade, the oldest one is deleted. This is to save space.

In the Author's case, having the 240GB SSD to play in, he will probably increase that depth. Not that most users would want to roll back many versions, but it is something that develops might want to do.

Post-amble

As you can see from the above GUI snapshot, it does a lot more, such as snapshots and rollback for containers. That is pretty much self-explanatory when you play with it.

The secret of such easy upgrading and downgrading is, of course, due to everything being in a squashfs file, easy.sfs. Unlike many other distributions that have to do a per-package upgrade. 


(c) Copyright Barry Kauler, December 2018, all reproduction rights reserved.
A disclaimer: Barry Kauler has provided these instructions in good faith, however there is a disclaimer of all responsibility if something does go wrong. It shouldn't, but if you type in something incorrectly and wipe your C: drive, that is entirely your own responsibility. If in doubt, find a Linux-knowledgeable guy to help. 

Tags: user