Change Boot Devices Grub/Win Configs UEFI Boot Environment

Kernels & Hardware, configuring network, installing services

Change Boot Devices Grub/Win Configs UEFI Boot Environment

Postby Loci.Cantos » 2021-03-03 20:53

I'd like to change OS Boot Devices and Grub Configuration in a UEFI Boot Environment

Present configuration: three boot devices managed by grub2 (debian) in a uefi boot environment:
1) ubuntu 20.10 on /dev/nvme0n1p1
2) windows 10 on /dev/nvme1n1p1
3) debian 10.8 on /dev/sdd3
I installed them as recommended: windows first, ubuntu second, and debian last. They all boot fine.

I want to move (basically exchange these, one for the other):
The windows 10 build from ssd: /dev/nvme1n1p1, to the Debian 10.8 hdd /dev/sdd3
The debian 10.8 build from hdd /dev/sdd3, to ssd: /dev/nvme1n1p1
I have a spare disk available for block copying.

I thought I would do the following:
A) Block Copy (raw write) the Windows build to the spare disk.
B) Reformat ssd: /dev/nvme1n1p1 to ext4 to prep it for debian
(I don’t think formatting is necessary if block copying, is that correct?)
C) Block Copy (raw write) debian to ssd: /dev/nvme1n1p1
D) Reformat hdd: /dev/sdd3 to ntfs to prep it for debian
(again, I don’t think formatting is necessary if block copying but It’s been a while)
E) Block copy windows from spare to hdd /dev/sdd3
F) Fix grub2 such that it recognizes the new overall boot configuration
G) Set UEFI (if necessary) to ensure it does not reject the changes due to its security protocols
H) Boot into windows and fix the windows boot manager such that it recognizes the new windows boot configuration. Or, better yet, edit the windows boot manager from debian before I reboot the system

So, here are my questions:
*Question 1: I don’t think it is necessary to reformat the destination disks first, if one is executing a block copy. Is this correct?

*Question 2: Presently grub2 kicks off the windows boot loader, and the windows boot loader manages the windows boot process.
Note: The windows boot partition is on a different disk than the ssd (as is the windows recovery partition), and the Windows Boot Manager needs to be modified once the changes are made. Does anyone remember the process for editing the windows bootloader? I will recognize the syntax once I’m there but I can’t remember it’s location or the tool used to modify it. It used to be just a text file (long ago), but I think it’s now incorporated into the advanced system configuration dialog, which requires being logged into the operating system. I could use some advice here. Does the Windows Boot Loader still refer to a file that is editable from outside the OS, such as from debian?

*Question 3: How to make grub2 boot loader, as th master boot loader, incorporate the changes. I seem to recall there is a fix grub2 command or something like this. Again, it’s been a while.

Does this seem like a workable solution for swapping these builds? If not, do you have better suggestions? Or, if this is a good approach, can you offer some advice on the questions I’ve asked, please? Thank you for your assistance.

lc
User avatar
Loci.Cantos
 
Posts: 49
Joined: 2018-08-03 15:39

Re: Change Boot Devices Grub/Win Configs UEFI Boot Environme

Postby Loci.Cantos » 2021-03-05 02:50

Okay, well I've formulated a good dd command that will transfer the raw data, block by block, which is good. I tested it with the windows disk then booted into windows. Windows won't mount the new disk because it's identical to the boot disk and it conflicts with the boot disk, which means it's a good dd copy command. Now, when I'm ready, I can use this command for either disk (debian or windows).

It looks like the windows efi partition is going to be the next issue. The uefi bios points to the windows efi boot partition, then the efi partition points to the windows build. But I don't know how to modify that efi pointer -yet, such that it points to the new disk, with the new ID (I don't think windows will allow cloning of the ID). If I can modify the pointer to point to the new cloned disk (with the new disk ID), then the windows part of the boot process ought to be resolved.

I'll report back as I progress.

lc
User avatar
Loci.Cantos
 
Posts: 49
Joined: 2018-08-03 15:39


Return to System configuration

Who is online

Users browsing this forum: No registered users and 18 guests

fashionable