PINE64
OS upgrades using alternate boot environments - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: Linux on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=114)
+--- Thread: OS upgrades using alternate boot environments (/showthread.php?tid=7829)



OS upgrades using alternate boot environments - Arwen - 08-10-2019

On thing I have been doing on my Linux computers at home for more than 8 years, is use ABEs, (aka Alternate Boot Environments).

Let's say you have a perfectly functional OS load. A few weeks later you want to update. Do you over-write the working OS load? (Even if you have backups...) Or would you prefer to keep your cake, (aka OS load), and eat it too, (update to an alternate location)?

Here is a description of the ABEs possible with Linux. I've actualy used 1, 3 & 4, and tested that 2 works.

 - Separate root partitions. Copy the existing one to the off-line one before update. Boot off the new copy to make sure it's botable, then update. Keep your home partition, (and anything else un-related to the OS), separate from root partition to reduce the amount of duplicated storage. Dis-advantage is that you have to have 2 full root partitions, (like 20GB per root).

 - Use Linux LVM with 2 root partitions. Same as above, but you can also perform R/O snapshots if you leave free space in the volume group.

 - Use BTRFS. Have a separate tree for root. Make R/W snapshots when updating. Still keep non-root / OS data out of the root / OS tree. Each extra BE takes up only as much as had been changed, (it's copy on write).

 - Use ZFS. Have separate tree for root. Make snapshot & clones when updating. Still keep non-root / OS data out of the root / OS tree. Each extra BE takes up only as much as had been changed, (it's copy on write).

This methodology is also good for a new kernel. You may have to update drivers and support software, which if it goes badly, that BE, (aka Boot environment), may become un-bootable. Having an ABE with the old funtional kernel can save you from headaches.

My Grub entries become a bit more complex. Basically at least 1 per BE, and 1 per kernel update. Plus, I have little incentive to delete too many. I generally keep perhaps 5 or 6 BEs. They also act as on-line backup.

If there is interest, I can describe them in more detail. I am most familar with 1 & 4. But have used 3, just not recently.


RE: OS upgrades using alternate boot environments - aleksei - 08-10-2019

There is at least one more: transactional state snapshotting/rollbacks by functional distros like Guix and NixOS.
https://guix.gnu.org/blog/2018/multi-dimensional-transactions-and-rollbacks-oh-my/