Clone Root Partiton on Multiboot PC and upgrade it

I’ve my laptop with Leap 15.2 (the running system) & the old Leap 15.1, I want

  1. to clone 15.2 (root & home partitions) on 15.1 (root & home partitions)
  2. add to bootloader the new 15.2 system
  3. boot the new 15.2 system then change repository to 15.3 and upgrade to 15.3

I’m not sure if I can proceed in this way especially for step 2 and 3.
I try to give the more info that I can.


**HPMax:/home/massimo #** efibootmgr -v 
BootCurrent: 0000 
Timeout: 5 seconds 
BootOrder: 0000,0001,2001,2002,2004 
Boot0000* openSUSE      HD(1,GPT,56f78eb2-ca4a-4876-8a9f-ab265bc7fedc,0x800,0x94800)/File(\EFI\opensuse\grubx64.efi)RC 
Boot0001* opensuse-secureboot   HD(1,GPT,56f78eb2-ca4a-4876-8a9f-ab265bc7fedc,0x800,0x94800)/File(\EFI\opensuse\shim.efi) 
Boot2001* EFI USB Device        RC 
Boot2002* EFI DVD/CDROM RC 
Boot3000* Internal Hard Disk or Solid State Disk        RC


**HPMax:/home/massimo #** lsblk 
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT 
sda      8:0    0   1,8T  0 disk  
├─sda1   8:1    0     8G  0 part  
├─sda2   8:2    0    60G  0 part /MyManual 
├─sda3   8:3    0    68G  0 part /MyMMedia 
├─sda4   8:4    0   100G  0 part /MyBackup 
├─sda5   8:5    0   1,6T  0 part /VM 
└─sda6   8:6    0    30G  0 part /MyDB 
sdb      8:16   0 931,5G  0 disk  
├─sdb1   8:17   0   297M  0 part /boot/efi 
├─sdb2   8:18   0    40G  0 part / 
├─sdb3   8:19   0    40G  0 part  
├─sdb4   8:20   0    20G  0 part [SWAP] 
├─sdb5   8:21   0    15G  0 part /home 
├─sdb6   8:22   0    15G  0 part  
├─sdb7   8:23   0    50G  0 part /Scambio 
├─sdb8   8:24   0    50G  0 part /DatiLinux 
└─sdb9   8:25   0   680G  0 part /KVM


**HPMax:/home/massimo #** blkid 
/dev/sda1: LABEL="tmp" UUID="d660cb9e-cc84-4ecd-bb5b-425354740af9" TYPE="ext4" PARTUUID="12ff344f-2f26-41f1-add3-03b2b00c2137" 
/dev/sda2: LABEL="Manuali" UUID="a0cb98d5-5bb6-4f61-91b0-451e87a36297" TYPE="ext4" PARTUUID="657d1a53-2ee8-44ed-8c3b-fc7a612e8f44" 
/dev/sda3: LABEL="Multimedia" UUID="40cde77a-13c9-41e4-b85e-f57baafe7a00" TYPE="ext4" PARTUUID="394568e6-b27e-447e-b0a6-a5bb5a56cc3e" 
/dev/sda4: LABEL="Backup" UUID="e17fbead-3467-49d2-95cd-cb7d64f77448" TYPE="ext4" PARTUUID="6bd4cf52-66af-4a43-8a72-4cb47de5dbd7" 
/dev/sda5: LABEL="VM" UUID="1a88ffeb-dd93-49d6-8e16-e70fff9f6a92" TYPE="ext4" PARTUUID="f2edc317-7029-4682-9a0a-9761ef707624" 
/dev/sda6: LABEL="DBData" UUID="60cf007d-b8f7-449f-b02d-4940936621e1" TYPE="ext4" PARTUUID="2d8de1df-1582-479a-9c36-ec45877bddd5" 
/dev/sdb1: SEC_TYPE="msdos" LABEL_FATBOOT="UEFISSD" LABEL="UEFISSD" UUID="65EF-3907" TYPE="vfat" PARTUUID="56f78eb2-ca4a-4876-8a9f-ab265bc7fedc" 
/dev/sdb2: LABEL="Leap152" UUID="653010a4-18e4-4d88-8c4b-5ca903198732" TYPE="ext4" PARTUUID="8e31c4a1-907f-4c99-8749-eeee653ee8ca" 
/dev/sdb3: LABEL="Leap151" UUID="3cc50061-ac02-4ccf-94c2-7c6937aec7ca" TYPE="ext4" PARTUUID="f0548db0-9a52-4d4b-80bc-e5799b0e683c" 
/dev/sdb4: LABEL="swap" UUID="4b6f5467-7873-46bb-8aeb-5412c36cdf8d" TYPE="swap" PARTUUID="85029fc3-16f0-40fd-a789-526ed014cb4e" 
/dev/sdb5: LABEL="homeLP152" UUID="9f3ac2fd-269a-42ef-8b4a-c6729845ce6d" TYPE="ext4" PARTUUID="32a97f0a-00de-412c-9997-443fd3ef41df" 
/dev/sdb6: LABEL="homeLP151" UUID="8a7387f2-2e4b-4f06-99be-c8ddfd6f0292" TYPE="ext4" PARTUUID="26e39be2-1fdf-4007-8bdc-0e0a2b4dc41f" 
/dev/sdb7: LABEL="Scambio" UUID="8b23e790-d878-489d-ab3c-8ad8b3d14d26" TYPE="ext4" PARTUUID="a3b0bb16-a9f9-4884-af7e-c7f3cbdd1ca4" 
/dev/sdb8: LABEL="MyLinux" UUID="26df30ae-5ba9-48ae-9cde-5e7421adf64f" TYPE="ext4" PARTUUID="b826a9d7-7fed-4a5e-8e57-663e7be060cb" 
/dev/sdb9: LABEL="KVM" UUID="f3f604b8-686b-4952-8b83-59f5b52e3c08" TYPE="ext4" PARTUUID="af1543c0-45f0-4d07-b1a8-281b81c274c1"

For step 1 it should be enough to clone with clonezilla root partiton /dev/sdb2 to /dev/sdb3 and home partition /dev/sdb5 to /dev/sdb6.

My doubts are on step 2 :
After cloning process, I think it should be possible to boot the PC and it should boot to ‘old’ 152.
With Yast I can rebuilt the bootloader, it should replace the old 15.1 entry and add the new 15.2 (the cloned one)
After that, I think that I must change the fstab on the new 15.2 for changing the UUID of home partiton.
This operation can be done mounting into the old 15.2 the new 15.2 root partition or even safely using a live system … but I’m not sure of that.

For step 3 I think to proceed in this way :
reboot the PC, chose the new 15.2 and if it boots change the repository from 15.2 to 15.3.
update the system with zypper dup
reboot the new 15.2 … now 15.3
If everything is ok rebuilt with yast the bootloader for having as primary and default boot Leap 15.3

If you need more info ask me and thanks in advance to whom will reply.

I’m not entirely sure I follow through all the data provided. It would have helped me immensely to see lsblk include UUIDs & LABELs. All my booting and mounting is done via user memorable LABELs, leaving Grub to do whatever it wants with UUIDs. I boot from custom.cfg entries, which due to my configuration in /etc/grub.d/, is shown in its entirety in the Grub boot menu before any autogenerated entries are shown. This explains how I do it.

Before doing anything, put something in between the quotes in GRUB_DISTRIBUTOR="" in /etc/default/grub, e.g. opensuse152. Those empty quotes translate to a boot directory named opensuse in /boot/efi/EFI on the ESP partition. If you don’t, every time Grub is updated on either installation, it usurps control from the other if the other was in control of Grub, because absent that change, neither is uniquely identified in /boot/efi/EFI/. An example of how /boot/efi/EFI/ looks on one of mine is:

# ls -1 /boot/efi/EFI/
BOOT
debian11
fedora35
opensuse153
opensuse154
opensusetw
tubuntu

I do a lot of cloning. On my UEFI systems, I only allow one Linux installation access to the ESP partition. On the rest, I simply omit a fstab entry for it, or I don’t have any bootloader installed. Typically I do mount it on the others, just not to /boot/efi/. Thus, only one of the entries in the sample list above actually is in use for booting normally.

What I would do with your plan is keep the clone installation isolated from the boot process until ready to zypper dup to 15.3. Right before starting that dup, I would add the ESP to fstab, enabling Grub’s and YaST’s normal use of it. After booting it normally following the upgrade, and ensuring confidence the process is complete to your satisfaction, I’d remove ESP access from the old 15.2, keeping unqualified control with 15.3.

Check the consistency of /etc/fstab and the kernel command line in /etc/default/grub. Skipping these steps may cause frustration.

My doubts are on step 2 :
After cloning process, I think it should be possible to boot the PC and it should boot to ‘old’ 152.
With Yast I can rebuilt the bootloader, it should replace the old 15.1 entry and add the new 15.2 (the cloned one)
After that, I think that I must change the fstab on the new 15.2 for changing the UUID of home partition.
This operation can be done mounting into the old 15.2 the new 15.2 root partition or even safely using a live system … but I’m not sure of that.

Just in case something goes wrong prepare and test a rescue or live system. You may always install grub on the new system as follows: Grub – EFI – Btrfs | Karl Mistelberger You can boot into the old system and have grub creating an entry for the new one. Check “detect foreign OS”.

For step 3 I think to proceed in this way :
reboot the PC, chose the new 15.2 and if it boots change the repository from 15.2 to 15.3.
update the system with zypper dup
reboot the new 15.2 … now 15.3
If everything is ok rebuilt with yast the bootloader for having as primary and default boot Leap 15.3

Sure. Be aware: All openSUSE distributions install grub into directory opensuse causing the boot loaders to overwrite each other. You can change this:

**erlangen:~ #** grep DISTRIBUTOR /etc/default/grub 
**GRUB_**DISTRIBUTOR**=Tumbleweed-nvme0n1p3 **
**erlangen:~ #**
[FONT=monospace]**erlangen:~ #** efibootmgr  
BootCurrent: 0004 
Timeout: 1 seconds 
BootOrder: 0004,0005,0002,0019,0001,0000,0003,0013,0010,0018 
Boot0000* Windows Boot Manager 
Boot0001* tw-new 
Boot0002* tw-btrfs 
Boot0003* ubuntu 
**Boot0004* tumbleweed-nvme0n1p3 **
Boot0005* leap-15.3 
Boot0010* Fedora 
Boot0013* manjaro 
Boot0018* UEFI OS 
Boot0019* Fedora 
**erlangen:~ #**
[/FONT]

https://forums.opensuse.org/showthread.php/541321-Upgrading-the-Hardware?p=3086058#post3086058

Hi mrmazda & Karl thanks for your suggestions,
especially for pointing me to the possibility of separate the bootloaders acting on GRUB_DISTRIBUTOR. I didn’t know that.
Just speaking about Grub_distributor, do you know if during a fresh installation is it possible to modify it?
Sincerely I’ve never saw this option (but I’ve never searched for it).

In the next days I’ll try all the process and keep you informed about the results.

Happy new year to all

No, it was exposed in YaST bootloader module in the past, but support was removed.

Beware: Any new install of Leap or Tumbleweed will overwrite /boot/efi/EFI/grubx64.efi. Therefore I rename all installed boot loaders.

I think you meant “/boot/efi/EFI/opensuse/grubx64.efi”.

Yep. :slight_smile: