Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: Multiversion/multidistro management

  1. #1
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

    Default Multiversion/multidistro management

    Hello,

    Lately I've been experimenting with multiversion/multidistro management on my laptop. This is somewhat of a follow up to my post (https://forums.opensuse.org/showthre...ot-Linus-stick) but instead of "rotating" OS external drive, I have turned the boot SSD into a "rotating" boot system.

    Following some of the suggestions made at this forums the partition table looks something like this (all gpt and efi boots):
    Code:
    nvme0n1
    nvme0n1p1 = 300MB Linux EFI
    nvme0n1p2 = 100MB W10 EFI
    nvme0n1p3 = 16MB W10 system reserved
    nvme0n1p4 = 300GB W10 system
    nvme0n1p5 = 500MB W10 system reserved
    nvme0n1p6 = 55 GB LEAP 15.2 system EXT4
    nvme0n1p7 = 55 GB LEAP 15.1 system EXT4
    nvme0n1p8 = 55 GB LEAP TW system BTRFS
    and my HDD
    Code:
    sda
    sda1 = 500GB W10 dedicated NTFS
    sda2 = 900GB Shared data NTFS
    sda3 = 500GB Linux /home EXT4
    and my /home in sda3 has the following "users"
    Code:
    SJLPHI_15.1
    SJLPHI_15.2
    SJLPHI_TW
    common
    each distro only has respective user available for the respective system.
    However all of the non-hidden directories at ~/ (or $HOME) are actually locaated in /home/common and symbolically linked to each user.

    The purpose of this system is to always have one up-to-date stable distro (for now both 15.1 and 15.2), and one rolling distro (TW for now). This is so that I will have at least one up-to-date and working linux system at all times while being able to test a new one, and have the bleeding edge.

    As soon as I am done testing 15.2, I will be wiping out 15.1 and I will probably testing some other OS in its place. Some questions that I would like to ask.

    1. Is there a better way to manage files/data in between users than to use a /home/common and symbollically linking to respective user for respective OS?
    2. Are there any consequences of sharing all of the non-hidden directories at $HOME?
    3. Are there any configuration files and directories such as .thunderbird that can be shared between without any issues?
    4. Say, when I delete the LEAP 15.1 partition, will there be any consequences to the grub? For example, if I boot from LEAP 15.2, and wipe the partition for 15.1, then use bootloader to reconfigure /boot/grub2/grub.cfg, will the os-prober do its job properly and delete any entries that used to belong to LEAP 15.1?

  2. #2
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    554

    Default Re: Multiversion/multidistro management

    Quote Originally Posted by SJLPHI View Post
    As soon as I am done testing 15.2, I will be wiping out 15.1 and I will probably testing some other OS in its place. Some questions that I would like to ask.

    1. Is there a better way to manage files/data in between users than to use a /home/common and symbollically linking to respective user for respective OS?
    My setup is close to yours (openSUSE Tumbleweed, openSUSE Leap 15.2, openSUSE Leap 15.1, MS WIN10) but i use three separate HOME-partitions. However i think that is just another way to do it but not a "better" one.
    Quote Originally Posted by SJLPHI View Post
    4. Say, when I delete the LEAP 15.1 partition, will there be any consequences to the grub? For example, if I boot from LEAP 15.2, and wipe the partition for 15.1, then use bootloader to reconfigure /boot/grub2/grub.cfg, will the os-prober do its job properly and delete any entries that used to belong to LEAP 15.1?
    Does your ESP (nvme0n1p1) contain a separate directory for each OS (i.e. a separate bootloader for each OS) ?

    Regards

    susejunky

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,858
    Blog Entries
    15

    Default Re: Multiversion/multidistro management

    Hi
    If it's one device then I would normally just use one ESP (/boot/efi) if they don't conflict, like Tumbleweed and Leap since the name is always opensuse, likewise for Windows for the directory, but for the likes of SLE, they use sles and sled so easy to remain on one ESP. Across multiple partitions means if using the likes of efibootmgr you need to ensure you use the -d option. Likewise they are all going to the same place on the hardware NVRAM, so need to ensure this is capable of holding the entries you wish to add....

    For me I use /data rather than $HOME and simlinks to the common areas.

    If removing old releases, I normally just use efibootmgr to remove the entry and let the fresh install create the new one.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

    Default Re: Multiversion/multidistro management

    Quote Originally Posted by susejunky View Post
    Does your ESP (nvme0n1p1) contain a separate directory for each OS (i.e. a separate bootloader for each OS) ?

    Regards

    susejunky
    It doesn't seem so:
    Code:
    ls /boot/efi/
    EFI$RECYCLE.BINSystem Volume Information
    ls /boot/efi/EFI/
    bootopensuse
    ls /boot/efi/EFI/opensuse/
    boot.csvfwfwupdx64.efigrub.cfggrub.efigrubx64.efiMokManager.efishim.efi
    ls /boot/efi/EFI/boot/
    bootx64.efifallback.efi
    

  5. #5
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

    Default Re: Multiversion/multidistro management

    Quote Originally Posted by malcolmlewis View Post
    Hi
    If it's one device then I would normally just use one ESP (/boot/efi) if they don't conflict, like Tumbleweed and Leap since the name is always opensuse, likewise for Windows for the directory, but for the likes of SLE, they use sles and sled so easy to remain on one ESP. Across multiple partitions means if using the likes of efibootmgr you need to ensure you use the -d option. Likewise they are all going to the same place on the hardware NVRAM, so need to ensure this is capable of holding the entries you wish to add....

    For me I use /data rather than $HOME and simlinks to the common areas.

    If removing old releases, I normally just use efibootmgr to remove the entry and let the fresh install create the new one.
    In terms of /data partition, I did consider that, but I already have a shared data partition, but /home/common holds things like Desktop, Downloads and etc... basically a common directory to be used at each of the $HOMEs.

    For now I am going to try to keep Linux ESP and W10 ESP separately. I am afraid of W10 overwriting grub some day...

  6. #6
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    554

    Default Re: Multiversion/multidistro management

    Quote Originally Posted by SJLPHI View Post
    ... As soon as I am done testing 15.2, I will be wiping out 15.1 and I will probably testing some other OS in its place. Some questions that I would like to ask.

    1. ...
    2. ...
    3. ...
    4. Say, when I delete the LEAP 15.1 partition, will there be any consequences to the grub? For example, if I boot from LEAP 15.2, and wipe the partition for 15.1, then use bootloader to reconfigure /boot/grub2/grub.cfg, will the os-prober do its job properly and delete any entries that used to belong to LEAP 15.1?
    Quote Originally Posted by SJLPHI View Post
    ...
    Code:
    ls /boot/efi/
    EFI$RECYCLE.BINSystem Volume Information
    ls /boot/efi/EFI/
    bootopensuse
    ls /boot/efi/EFI/opensuse/
    boot.csvfwfwupdx64.efigrub.cfggrub.efigrubx64.efiMokManager.efishim.efi
    ls /boot/efi/EFI/boot/
    bootx64.efifallback.efi
    
    If you have only one UEFI bootloader installed on your ESP but three openSUSE systems then it depends on which of your openSUSE systems is currently managing the bootloader.

    Let's assume your openSUSE Leap 15.1 is managing your GRUB2 (i.e. Leap 15.1 was used to install and later to update the GRUB2 files) then the boot goes like this:


    1. The UEFI NVRAM entry points either to your /EFI/opensuse/shim.efi (for secure boot) or to grubx64.efi.
    2. shim.efi has build-in to look for /boot/grub2/grub.cfg on your openSUSE Leap 15.1 partition.
    3. grub64.efi will read /EFI/opensuse/grub.cfg which will tell it (by UUID) to look on the openSUSE Leap 15.1 partition for /boot/grub2/grub.cfg


    If you delete your openSUSE Leap 15.1 installation the next boot will fail. And i guess the fallbacks (/EFI/boot/bootx64.efi, /EFI/boot/fallback.efi) will not work either because generated by openSuSE Leap 15.1 they will try to boot openSUSE Leap 15.1 as well.

    Deleting openSUSE Leap 15.2 or openSUSE Tumbleweed should not cause any boot problems (given the assumption openSUSE Leap 15.1 is managing the GRUB).

    Because you only have one /EFI/opensuse directory on your ESP it can be hard to tell which of your three openSUSE systems is managing GRUB. For this reason i have every openSUSE system creating its own EFI boot directory (/EFI/opensuse1 and /EFI/opensuse2 and /EFI/opensuset). This has another advantage : If one bootloader fails i can easily use the UEFI boot selection to boot one of the two remaining ones.

    Regards

    susejunky

  7. #7
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

    Default Re: Multiversion/multidistro management

    Okay if I understood correctly, if I want to delete 15.1 safely I should do the following:
    1. Boot from TW or 15.2
    2. Use the Bootloader from TW or 15.2 to generate boot entries.
    3. Possibly modify and delete 15.1 entries from /boot/grub2/grub.cfg

    Alternatively I should create seperate boot entries in the ESP, one for each distro. Do you have a suggestion on how to set that up safely?

  8. #8
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    554

    Default Re: Multiversion/multidistro management

    Quote Originally Posted by SJLPHI View Post
    Okay if I understood correctly, if I want to delete 15.1 safely I should do the following:
    1. Boot from TW or 15.2
    2. Use the Bootloader from TW or 15.2 to generate boot entries.
    3. Possibly modify and delete 15.1 entries from /boot/grub2/grub.cfg

    Alternatively I should create seperate boot entries in the ESP, one for each distro. Do you have a suggestion on how to set that up safely?
    Hmmm, i'm not quite sure if i understand correctly what you mean by "Use the Bootloader from ...".

    My understanding of GRUB is:

    In /etc/default/grub there is a definition GRUB_DISTRIBUTOR="opensuse". That "opensuse" is used by grub2-install to create a directory /EFI/opensuse and place the bootloader file (grubx64.efi or shim.efi) there.

    As far as i understand grub2-install will

    • when secure boot is selected, create /EFI/opensuse/shim.efi which is self-contained (i.e. it has build-in on which partition to look for /boot/grub2/grub.cfg and will not use any other files from /boot/grub2)
    • when secure boot is NOT selected, create /EFI/opensuse/grubx64.efi and /EFI/opensuse/grub.cfg which will be read by /EFI/opensuse/grubx64.efi and point to the partition where /boot/grub2/grub.cfg can be found. Later in the boot process /EFI/opensuse/grubx64.efi will use modules from /boot/grub2/x86_64-efi.
    • in both cases create an entry in the NVRAM of the UEFI


    /boot/grub2/grub.cfg
    is the menu displayed on boot which will allow the user to choose which OS GRUB will finally start. This file can be kept up-to-date with grub2-mkconfig -o /boot/grub2/grub.cfg.

    So here is what i do:

    • I define different GRUB_DISTRIBUTOR= (like "opensuse1, opensuse2, opensuset) on each openSUSE system.
    • Then i boot in every system and do grub2-install and grub2-mkconfig -o /boot/grub2/grub.cfg. Everytime an entry in the NVRAM is created and the NVRAM boot order is changed to boot the last created entry first.
    • If all systems are set up i use efibootmgr -o nnnn to define which NVRAM entry is used first to boot.


    However all this needs some care when GRUB gets updates or if kernel updates arrive.

    So it might be easier to select one openSUSE system to handle the bootloader and set the other openSUSE systems to have no bootloader.

    Regards

    susejunky

  9. #9
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

    Default Re: Multiversion/multidistro management

    By bootloader, I am referring to Yast bootloader.

    I am also a bit puzzld looking at /etc/default/grub,
    the grub distributor variable is left blank.

    Also, I tried to google this, but what is the syntax for listing all of the systems for efibootmgr?

  10. #10
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    554

    Default Re: Multiversion/multidistro management

    Quote Originally Posted by SJLPHI View Post
    ... I am also a bit puzzld looking at /etc/default/grub,
    the grub distributor variable is left blank.
    I forgot to mention that all what i described is based on the usage of ext4 filesystems. If btrfs filesystems are used you probably will need a different approach.

    Here some links which might be helpful

    https://doc.opensuse.org/documentati...html#cha-grub2
    https://www.gnu.org/software/grub/manual/grub/grub.html
    https://www.rodsbooks.com/efi-bootloaders/


    Quote Originally Posted by SJLPHI View Post
    ... Also, I tried to google this, but what is the syntax for listing all of the systems for efibootmgr?
    Code:
    # efibootmgr -v
    and see
    Code:
    > man efibootmgr
    for more information.

    Regards

    susejunky

Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •