Hello everybody.
The situation is the following.
There are 2 systems installed on pc1. Alma Linux 9.2 and Windows 10.
Here is the partition scheme.
sda 8:0 0 931,5G 0 disk
├─sda1 8:1 0 300M 0 part
├─sda2 8:2 0 600M 0 part /boot/efi
├─sda3 8:3 0 1G 0 part /boot
├─sda4 8:4 0 98,9G 0 part
├─sda5 8:5 0 323,3G 0 part /home
├─sda6 8:6 0 390,6G 0 part
├─sda7 8:7 0 100G 0 part /
└─sda8 8:8 0 16G 0 part [SWAP]
It’s the content of the EFI directory
drwx------ 7 root root 4096 июн 2 14:41 .
drwx------ 5 root root 4096 дек 31 1969 …
drwx------ 2 root root 4096 мая 16 10:11 almalinux
drwx------ 2 root root 4096 мая 16 10:11 BOOT
drwx------ 4 root root 4096 апр 14 11:27 Microsoft
drwx------ 7 root root 4096 июн 2 14:41 refind
drwx------ 2 root root 4096 апр 14 14:27 tools
Pc 2 is same hardware as pc1. I copied /dev/sda pc1 to /dev/sda2 with the dd command. The copy was successful.
But when I tryed to boot into the system on pc2 - for some reason it booted into Windows 10.
I checked Bios (UEFI), it turned out that for some reason pc2 does not see the entries for almalinux and refind.
Next, I booted from the livecd of the almalinux image. I saw that all sections are in place. Mounted /, mounted /boot/, /boot/efi
And with chroot tried update grub.conf
sudo mount /dev/sda7 /mnt
sudo mount /dev/sda3 /boot/
cd /mnt/
sudo mount -t proc /proc proc
sudo mount --rbind /sys sys
sudo mount --make-rslave sys
sudo mount --rbind /dev dev
sudo mount --make-rslave dev
sudo mount -t tmpfs tmpfs tmp
grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
Restart pc and it didn’t help.
I’v tried to reinstall grub in chroot
dnf reinstall grub2* shim
Restart pc and it didn’t help.
Tried to use sudo grub2-install /dev/sda command but get
“this utility cannot be used for EFI platforms because it does not support UEFI Secure Boot.” Error.
Then I just set hhd from pc2 on pc1 - and there refind and almalinux boot works OK, and OK shearchs in BIOS(uefi)
I tried set hdd form pc1 to pc2 and again BIOS(UEFI) can’t find alma and refind.
What should I do? What I done wrong? I need copy this doal boot system to 9 identical PCs.
THX for your help.