2

Introduction

I have kubuntu 20 on my oc. I created a backup of kubuntu(22 gb) using Kbackup in form of tar

file image of my kde drive(sda2)

What I want

I wish to test this backup on the same computer by creating an empty ext4 partition on the same pc(sda5)

What Happened I successfully created a second ext4 partition. After editing fstab file by adjusting the right UUID and applying bootloader, my boot menu simply does not show the twin kde. I even copied the partition table found in /root of parent kde. This partition has now bootflag too.

Here are the boot-repair paste-bin and other info: https://paste.ubuntu.com/p/Zbp74KWn3R/ (Note that Partition info recognizes sda2 as having boot but a no kernel with sda5) I already have kernels copied in usr/src of /dev/sda5.

Output of blkid

/dev/sda5: UUID="a8bc0529-436e-48eb-9100-b64d24bb493d" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="88989976-f24a-b145-822e-9582051b94e

fstab file of new /sda5 partition:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=a8bc0529-436e-48eb-9100-b64d24bb493d /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
#UUID=D492-A6EC  /boot/efi       vfat    umask=0077      0       1
#UUID=D492-A6EC  /boot/efi       vfat    defaults      0       1
#UUID=D492-A6EC  /boot/efi       vfat    defaults      0       1
#UUID=D492-A6EC  /boot/efi       vfat    defaults      0       1
#UUID=D492-A6EC  /boot/efi       vfat    defaults      0       1
#UUID=D492-A6EC  /boot/efi       vfat    defaults      0       1
UUID=D492-A6EC  /boot/efi       vfat    defaults      0       1

Kindly guide me on this issue.

Edit

I excluded following directories from backup

--exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found" 

Edit2 I have discovered that i have also excluded "/boot". Currently my /sda5 has a lonely "efi" folder in it.

Edit3 After copying the /boot folder, the grub and paste-bin successfully integrates /sda5.

I selected /sda5 and OOPS!, I was booted back to /sda2. It appears that the copied boot file loop me back to sda2 instead of entrance to sda5.

Kindly guide me how to regenerate boot files of /sda5 so that i can log on to it to test it on my own system.

  • FYI: Kubuntu (along with all Ubuntu) uses a year.month format for releases, so there is no 2020. It looks like you're using 20.10, or the 2020-October release. (Ubuntu does have a different product range that uses year only, eg. Ubuntu Core 20, but it's for specialist purposes and year only releases are snap only). – guiverc Feb 01 '21 at 00:44

1 Answers1

0

I finally accomplished testing my cloned system in the partiton of the same computer as was original one. In my case I created a tar backup of linux filesystem with excluding --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/mnt/","/media/*","/lost+found","/boot") using kbackup.

One must never forget to include Root as it contains the partition table without which, entire backup is simply useless. Boot must be backed up separately, because it redirects the system to load exact location i.e /dev/sdaX as i learned from my experience. You may have to generate boot grub files separately if you are using a different location other than original one for cloning linux file-system.

Then I created an inetrnal ext4 partiton to test the tar as I do not have another laptop and do not intend to guinea pig my own system. I edited fstab file in routine. Creating swap file is easy.

On my system it was named as /dev/sda5(test drive).

Then instead of using livecd I used my own root system, which was intended to be cloned

First I mounted the test drive on /mnt/Test(say)

sudo mount /dev/sda5 /mnt/Test

And untar my entire linux filesystem to that folder Test

Following, I created following empty directories that were excluded from tar backup

sudo mkdir temp && sudo mkdir proc && sudo mkdir sys && sudo mkdir dev && sudo mkdir boot

Then i copied following boot files from my own boot system to the cloned system as

sudo cp -r /boot/vmlinuz-5.8.0-25-generic /mnt/Test/boot

sudo cp -r /boot/vmlinuz-5.8.0-41-generic /mnt/Test/boot

sudo cp -r /boot/vmlinuz /mnt/Test/boot

sudo cp -r /lib/modules/5.8.0-25-generic /mnt/Test/lib/modules/

sudo cp -r /lib/modules/5.8.0-41-generic /mnt/Test/lib/modules/

Then I follwed advice from How to restore deleted files in /boot? (vmlinuz missing, system does not boot)

for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt/Test$i"; done

chroot /mnt/Test

mkinitramfs -o /boot/initrd.img-5.8.0-25-generic 5.8.0-25-generic

mkinitramfs -o /boot/initrd.img-5.8.0-41-generic 5.8.0-41-generic

Then i updated grub both inside cloned system and my original system. sudo update-grub

Create mnt directory if missing

sudo mkdir -m 755 /mnt

In order to be sure if you have indeed landed in cloned system as it is hard to tell the difference from the original one, make a text file in $HOME directory of cloned system from original one listing some text"(Big Brother is watching)".