How to boot from an EUFI original or clone Linux partition

User discussion and information resource forum for BootIt Bare Metal and BootIt UEFI
Post Reply
brucebne
Posts: 159
Joined: Sat Jan 19, 2019 11:01 am

How to boot from an EUFI original or clone Linux partition

Post by brucebne »

Goal :
To copy a Linux Mint OS partition to the same ssd, then boot from either the original or copied OS.

I've done this on a Dell Latitude 5289 with no apparent BIOS issues with Linux.



The steps:

1.
The copy operation of the Mint original partition to free space using BootIt EUFI began painfully slowly...and was unlikely to finish under 20 minutes.
I therefore made an image, then did a restore operation to free space (30 seconds to image, and 30secs to restore. I will have to investigate why the parition copy operation was so slow.)

2.
Before rebooting the computer into either Mint partition, it is necessary to change the UUID of the clone.
On one trial, I did boot before doing this, thinking I was booting into the Mint original....however it booted me into Mint clone. The interwebs say results are unpredictable when there's OS partitions with same UUIDs.

Procedure for changing UUID
- Boot using any bootable Linux USB.
- do not mount Mint clone.
- determine the /dev/ of Mint clone by running 'disks' software, or in terminal - blkid = /dev/nvme0n1p8
- run a file check on Mint clone from terminal using sudo e2fsck -f /dev/nvme0n1p8
- now the uuid of Mint clone can be changed with sudo tune2fs -U random /dev/nvme0n1p8
- confirm the uuid change has occurred by running 'disks' again ..... the change will not be picked up with blkid at this point.

3.
Before a Mint clone boot is possible, it is also necessary to change the UUID in /etc/fstab and /boot/grub/grub/cfg on the Mint clone file system.
Actually, it may not be necessary to change grub.cfg on Mint clone, at least on my system.
Why?
because the grub menu I am persistently presented with at boot is that of Mint original. This needs to be changed as well, so as to create an menu item for Mint clone (which I do later).

So, mount Mint clone
- open /etc/fstab, and replace the old uuid with new, and save.
- open /boot/grub/grub.cfg, and do a find and replace operation to replace all occurences of the old uuid with the new. (don't worry that this is overkill. This is just to help boot into Mint clone one time....Once Mint clone is booted, then you can run a sudo update-grub which will correct Mint clone grub.cfg.

- now I reboot the laptop, and am presented with grub menu installed by Mint original. but Mint clone still does not have a boot entry.....so I choose to boot into Mint original
- I then check in 'disks' which Mint partition is root, ensuring it is Mint original.
- then run sudo update-grub to get a grub menu entry for Mint clone.

- then reboot to test...and menu entry is there. select it. once in, check in 'disks' to ensure Mint clone is mounted and root....and mint original is not mounted.
- now run sudo update-grub in Mint clone.

- I also change the desktop wallpaper of Mint clone to help confirm which parition I am booting into.

That's the process.

--------------------------------

However, the only bug I have is on booting of Mint clone, I get a quick error message soon after choosing Mint clone from the grub menu.

"[ 1.2985921 Couldn't get size; 0x0000000000000000E"

I did fsck operations on this but nothing changed.
I presume it might be due to the image restore operation....maybe due to incongruence in the cloned partition parameters relative to the original's.

------------------------------

why bother doing this?
Over the years, I got into a habit of setting up systems with a bootable clone of the primary OS, usually Windows XP.

This way, if a client had OS issues, they could simply select from the boot menu to boot up the clone OS. If there was no issue, then they could stay productive until I arrived to investigate whether the issue was software or hardware.

In general, having a clone OS to boot from, is a quick way to help determine whether an OS issue is hardware or software.
brucebne
Posts: 159
Joined: Sat Jan 19, 2019 11:01 am

Re: How to boot from an EUFI original or clone Linux partiti

Post by brucebne »

OK, to resolve the error message I mentioned above, I just deleted the retored image, and used BootIt UEFI to copy a Linux Mint parition to free space on the ssd.
As I speculated, once I went through the clone partition boot procedure above, I did not get the error message.

So finally I've shown it is possible in UEFI to boot from a partition clone without errors.

However for whatever reason, BootIt UEFI took around 40 minutes to copy a 15GB partition with 8GB of data.
I'll have to look more closely at the default copy settings.
Imaging the same takes 30 seconds.
Brian K
Posts: 2214
Joined: Fri Aug 12, 2011 1:11 am
Location: NSW, Australia

Re: How to boot from an EUFI original or clone Linux partiti

Post by Brian K »

Bruce, was BIU installed?
brucebne
Posts: 159
Joined: Sat Jan 19, 2019 11:01 am

Re: How to boot from an EUFI original or clone Linux partiti

Post by brucebne »

Brian K wrote:
> Bruce, was BIU installed?

yes
Brian K
Posts: 2214
Joined: Fri Aug 12, 2011 1:11 am
Location: NSW, Australia

Re: How to boot from an EUFI original or clone Linux partiti

Post by Brian K »

Nice work. How did the UUID in ubuntu.xxx folder get updated? Do you have two ubuntu.xxx folders?
brucebne
Posts: 159
Joined: Sat Jan 19, 2019 11:01 am

Re: How to boot from an EUFI original or clone Linux partiti

Post by brucebne »

Brian K wrote:
> Nice work. How did the UUID in ubuntu.xxx folder get updated? Do you have
> two ubuntu.xxx folders?

I only have one ubuntu boot loader folder on ESP.

It's grub.cfg file has this:

search.fs_uuid 65c07f45-1d10-4cd1-83ea-8657e7486970 root
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

That uuid is the original Mint partiion's.


I am booting into the clone, not directly via BootIt UEFI"s menu.....I select Mint original's BIU entry which passes me to the grub menu created by Mint original.
After doing sudo update-grub from within Mint original, a new grub menu item was added for Mint clone.


On the Mint clone partition, in the folder /boot/efi/EFI/ubuntu
grub.cfg has the following text

search.fs_uuid 65c07f45-1d10-4cd1-83ea-8657e7486970 root
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

which is same as in grub.cfg of Mint original.

I don't know what would happen if I change this uuid to the clone uuid, then did sudo update-grub.
Would that trigger the creation of a new ubuntu.xxx folder on ESP? which would then be picked up by BIU (which would then add a direct clone boot menu item?)
Brian K
Posts: 2214
Joined: Fri Aug 12, 2011 1:11 am
Location: NSW, Australia

Re: How to boot from an EUFI original or clone Linux partiti

Post by Brian K »

brucebne wrote:

>
> I don't know what would happen if I change this uuid to the clone uuid, then did sudo
> update-grub.
> Would that trigger the creation of a new ubuntu.xxx folder on ESP? which would then
> be picked up by BIU (which would then add a direct clone boot menu item?)

Beyond my pay grade.
brucebne
Posts: 159
Joined: Sat Jan 19, 2019 11:01 am

Re: How to boot from an EUFI original or clone Linux partiti

Post by brucebne »

will experiment after lunch when I have time.

I don't know what update-grub actually updates in entirety, nor the update algo of BIU.
Brian K
Posts: 2214
Joined: Fri Aug 12, 2011 1:11 am
Location: NSW, Australia

Re: How to boot from an EUFI original or clone Linux partiti

Post by Brian K »

You can create ubuntu.002 and edit grub.cfg (thanks to Paul for the lines). From Scripting...

cd \EFI
dir
...(you should see ubuntu.001 folder here)
md ubuntu.002
cd ubuntu.002
copy ..\ubuntu.001\*.* /s

Does the ubuntu.002 item boot?
brucebne
Posts: 159
Joined: Sat Jan 19, 2019 11:01 am

Re: How to boot from an EUFI original or clone Linux partiti

Post by brucebne »

Brian K wrote:
> You can create ubuntu.002 and edit grub.cfg (thanks to Paul for the lines).
> From Scripting...
>
> cd \EFI
> dir
> ...(you should see ubuntu.001 folder here)
> md ubuntu.002
> cd ubuntu.002
> copy ..\ubuntu.001\*.* /s
>
> Does the ubuntu.002 item boot?


OK, will do that....and update /EFI/ubuntu.002/grub.cfg with the clone's UUID.
Post Reply