Skip to main content

How can I generate/or edit a grub.cfg on each EFI partition that refers to the ubuntu installation [Resolved]

I have an install of Ubuntu 16.04 server set up on two disks with software raid across two large partitions. The start of each disk contains an EFI partition. I would like to be able to boot from either disk (in case one fails) - one guide I read instructed to simply clone the EFI partition after installation using "dd" - however, I have found that this doesn't work - after reading a little, I think it is because GRUB entries containing a partition UID for the location of the kernel it is supposed to boot. So I think that the cloned grub.cfg contains some kind of UID reference for only one of the disks

My question is: How can I generate or even manually edit grub.cfg on each EFI partition so that it refers to the ubuntu installation on the same physical disk?

$ lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda             8:0    0 953.9G  0 disk  
+-sda1          8:1    0   476M  0 part  /boot/efi
+-sda2          8:2    0 953.4G  0 part  
  +-md0         9:0    0 953.3G  0 raid1 
    +-vg-root 252:0    0 923.5G  0 lvm   /
    +-vg-swap 252:1    0  29.8G  0 lvm   [SWAP]
sdb             8:16   0 953.9G  0 disk  
+-sdb1          8:17   0   476M  0 part  
+-sdb2          8:18   0 953.4G  0 part  
  +-md0         9:0    0 953.3G  0 raid1 
    +-vg-root 252:0    0 923.5G  0 lvm   /
    +-vg-swap 252:1    0  29.8G  0 lvm   [SWAP]

Question Credit: ezekiel
Question Reference
Asked July 13, 2019
Posted Under: Network
33 views
1 Answers

Using your favourite text editor, open /etc/default/grub.cfg and uncomment the line that says GRUB_DISABLE_LINUX_UUID=true

Update grub with the new configuration:

sudo update-grub

Copy the updated grub config to the other EFI partition:

dd if=/dev/sda1 of=/dev/sdb1

Enter the UEFI menu and disable all options (eg. UEFI shell) that are not one of the ubuntu installs.


credit: ezekiel
Answered July 13, 2019
Your Answer
D:\Adnan\Candoerz\CandoProject\vQA