Score:0

Clone ubuntu for dual boot of same base system

tr flag
mtp

I have a rather complicated 18.04 LTS system for development purposes - I would like to clone the system and make it dual bootable so I can have version a for production and version b for test.

I have cloned (copied) my ubuntu partition using gparted - but update-grub and os-probe only find the initial ubuntu - not the cloned version - any ideas on how to boot into the clone?

Thanks for your help

fstab for the original: mark@7920X:~$ cat /etc/fstab

/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).

/ was on /dev/nvme1n1p2 during installation

UUID=1d0a2e13-43b7-4c19-a9d5-3960ad41f591 / ext4 errors=remount-ro 0 1

/boot/efi was on /dev/nvme1n1p1 during installation

UUID=1791-5C78 /boot/efi vfat umask=0077 0 1 /swapfile none swap sw 0 0 /dev/disk/by-uuid/6fe46b4c-e591-4c5f-b61c-df72eb1e44e2 /speed auto nosuid,nodev,nofail,x-gvfs-show 0 0 /speed2/swapfile swap swap defaults 0 0 /dev/mapper/rust-00 /rust auto nosuid,nodev,nofail,x-gvfs-show 0 0 /dev/disk/by-id/wwn-0x5000c500be069709-part1 /mount/Backup auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-symbolic-icon=Backup 0 0 /dev/disk/by-uuid/d7afae12-4047-4174-99db-0fc8ba352cfb /speed2 auto nosuid,nodev,nofail,x-gvfs-show 0 0 /dev/disk/by-uuid/2A389D97389D629D /mnt/2A389D97389D629D ntfs nosuid,nodev,nofail,x-gvfs-show,noauto 0 0 tmpfs /dev/shm tmpfs defaults,size=40g 0 0

fstab for the clone

/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).

/ was on /dev/nvme1n1p2 during installation

UUID=af289d61-976b-4672-8bf5-8ca4ae62848d / ext4 errors=remount-ro 0 1

/boot/efi was on /dev/nvme1n1p1 during installation

UUID=1791-5C78 /boot/efi vfat umask=0077 0 1 /swapfile none swap sw 0 0 /dev/disk/by-uuid/6fe46b4c-e591-4c5f-b61c-df72eb1e44e2 /speed auto nosuid,nodev,nofail,x-gvfs-show 0 0 /speed2/swapfile swap swap defaults 0 0 /dev/mapper/rust-00 /rust auto nosuid,nodev,nofail,x-gvfs-show 0 0 /dev/disk/by-id/wwn-0x5000c500be069709-part1 /mount/Backup auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-symbolic-icon=Backup 0 0 /dev/disk/by-uuid/d7afae12-4047-4174-99db-0fc8ba352cfb /speed2 auto nosuid,nodev,nofail,x-gvfs-show 0 0 /dev/disk/by-uuid/2A389D97389D629D /mnt/2A389D97389D629D ntfs nosuid,nodev,nofail,x-gvfs-show,noauto 0 0 tmpfs /dev/shm tmpfs defaults,size=40g 0 0

The uuids - are different(and I think correct)

blkid 
/dev/nvme2n1p1: UUID="1791-5C78" TYPE="vfat" PARTUUID="56021e2e-d093-4d2c-a1be-53fc7645dfff" 
/dev/nvme2n1p2: UUID="1d0a2e13-43b7-4c19-a9d5-3960ad41f591" TYPE="ext4" PARTUUID="e3b10f5e-9c0a-4db5-98b2-d93a6676cf54" 
/dev/nvme2n1p3: UUID="af289d61-976b-4672-8bf5-8ca4ae62848d" TYPE="ext4" PARTUUID="46932591-1ca9-44e4-8515-556ef146b384"

lsblk 
nvme2n1 259:1 0 953.9G 0 disk 
├─nvme2n1p1 259:2 0 953M 0 part /boot/efi 
├─nvme2n1p2 259:3 0 463.1G 0 part /
└─nvme2n1p3 259:4 0 463.1G 0 part
PonJar avatar
in flag
Where did you clone your system to? Have you changed the UUID of the clone and have you changed the /etc/fstab file to match the new UUID?
mtp avatar
tr flag
mtp
I created a new partition in unallocated space on the same drive - I did not change the UUID
PonJar avatar
in flag
If you need help add the output of “blkid” and “cat /etc/fstab” to your question
mtp avatar
tr flag
mtp
I am getting closer - thanks to your help @Ponjar , os-prober and update grub both seem to find the new partition, but always I boot into the old partition. grub.cfg seems to properly indicate both
mtp avatar
tr flag
mtp
do you want the blkid and fstab of the new partition or the old one?
mtp avatar
tr flag
mtp
Thank you for your help
PonJar avatar
in flag
If you run blkid in a terminal it will show the UUID for all partitions as a list. If you haven’t changed fstab at all they will be the same. If you also do lsblk we can see which partition is booted. By cloning it’s easy to get confused which is booting as they will start out identical. Once things are working change the wallpaper so you can see where you are.
mtp avatar
tr flag
mtp
/dev/nvme2n1p1: UUID="1791-5C78" TYPE="vfat" PARTUUID="56021e2e-d093-4d2c-a1be-53fc7645dfff" /dev/nvme2n1p2: UUID="1d0a2e13-43b7-4c19-a9d5-3960ad41f591" TYPE="ext4" PARTUUID="e3b10f5e-9c0a-4db5-98b2-d93a6676cf54" /dev/nvme2n1p3: UUID="af289d61-976b-4672-8bf5-8ca4ae62848d" TYPE="ext4" PARTUUID="46932591-1ca9-44e4-8515-556ef146b384"
mtp avatar
tr flag
mtp
p1 is boot, p2 and p3 are the original and cloned ubuntu
mtp avatar
tr flag
mtp
from lsblk nvme2n1 259:1 0 953.9G 0 disk ├─nvme2n1p1 259:2 0 953M 0 part /boot/efi ├─nvme2n1p2 259:3 0 463.1G 0 part / └─nvme2n1p3 259:4 0 463.1G 0 part
mtp avatar
tr flag
mtp
I thought I had booted into p3, but I arrive at p2
PonJar avatar
in flag
It can be hard to tell which partition you are booting from the grub menu. Which ever installation ran update grub last will be the first entry (Ubuntu 18.04) You will also have something like Ubuntu 18.04 on /dev/nvme2p# where # is the partition number. Can you boot both now? I guess you can but it will be confusing until you make one clearly different from the other
mtp avatar
tr flag
mtp
grub.cfg seems to have both, and both show up on the reboot menu - but I always reboot into p2
PonJar avatar
in flag
Unless you have changed the UUID in the fstab file on the cloned partition I’d expect that to happen. It will be telling the boot process to boot p2
mtp avatar
tr flag
mtp
I did change it in the cloned partition ...
PonJar avatar
in flag
I suggest you add your two fstab files to the question above, formatted as code. The most likely explanation is that you are still confusing them. Add a line like this “# This is on partition 2” and then look at the other. The # as the first character in the line makes that line a comment which will not be processed
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.