(U)EFI

# check if EFI is enabled
ll /sys/firmware/efi
 
# install efibootmgr
sudo apt-get install -y efibootmgr
 
# list entries
efibootmgr -v
 
# create entry
efibootmgr --create --disk /dev/nvme0n1 --part 1 --label Ubuntu --loader \\EFI\\ubuntu\\grubx64.efi
 
# delete entry
sudo efibootmgr --delete-bootnum -b 0006
 
# delete all non default entry
for BOOT_ID in $(efibootmgr | grep Boot0 | egrep -v "Built-in|PXE" | cut -d" " -f1 | awk '{print substr($0,5,4)}'); do
    efibootmgr -b ${BOOT_ID} -B
done
 
# set boot order
efibootmgr --bootorder 0,1,2,9,A,B,C
efibootmgr | grep ubuntu | tr -cd '[:digit:]' | xargs efibootmgr --bootorder
 
# install grup
grub-install --efi-directory=/boot/efi
 
# mount efivarfs
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
 
# 32 bit
apt install grub-efi-ia32-bin 
grub-install -v --target=i386-efi --efi-directory=/boot/efi /dev/sda

Boot from first disk

fs0:
cd EFI
cd BOOT
BOOTX64.EFI

Boot from first disk

mount /dev/sda1 /mnt
mkdir -p /mnt/boot/efi
mount /dev/sda3 /mnt/boot/efi
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /run /mnt/run
modprobe efivars
chroot /mnt
apt-get install grub-efi-amd64
sudo apt install mokutil
mokutil --sb-state

Links
https://wiki.archlinux.de/title/UEFI_Installation
https://www.gnu.org/software/parted/manual/html_node/set.html
https://www.systutorials.com/docs/linux/man/8-grub-install/