I am installing Ubuntu 22 in efi mode with the below curtin partition scheme;
storage:
config:
- grub_device: true
id: sda
path: /dev/nvme0n1
ptable: gpt
type: disk
wipe: superblock-recursive
- device: sda
flag: bios_grub
id: bios_boot_partition
number: 1
size: 1MB
type: partition
- device: sda
flag: boot
grub_device: true
id: boot_efi_part
number: 2
path: /dev/nvme0n1p2
preserve: false
size: 6GB
type: partition
wipe: superblock-recursive
- device: sda
flag: boot
id: rootvg_part
number: 3
path: /dev/nvme0n1p3
size: 720GB
type: partition
wipe: superblock-recursive
- fstype: ext3
id: fs-root
label: rootfs
preserve: false
type: format
volume: rootvg_part
- fstype: vfat
id: boot_efi_fs
preserve: false
type: format
volume: boot_efi_part
- device: fs-root
id: mount-root
path: /
type: mount
- device: boot_efi_fs
id: boot_efi_mount
path: /boot/efi
type: mount
I have disabled secure boot in Bios.
When the Ubuntu22 install completed, the os get struck at first booting and entering into the Grub rescue mode. After a lot of research, I was able to load the os using below commands in grub rescue mode;
grub> ls
(hd0) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3)
grub> set root=(hd0,gpt3)
grub> linux /boot/vmlinuz-4.15.0-45-generic root=/dev/nvme0n1p3
grub> initrd /boot/initrd.img-3.13.0-29-generic
grub> boot
However, in each reboot I have to run the above commands to load the OS. In my further research I do see the below link;
Bootloader path for a permanently installed OS
----------------------------------------------
For Ubuntu, the pathname should be \EFI\Ubuntu\grubx64.efi if you don't need Secure Boot support, or \EFI\Ubuntu\shimx64.efi if the Secure Boot shim is used. The descriptive name is simply "ubuntu" and the optional data is not used.
However, in my installation the path '\EFI\Ubuntu' is not created with the files generated inside it. I don't know why?
Later, I tried an Ubuntu 18 installation on the same hardware with the above partition scheme, and I successfully installed ubuntu 18. And I can see that the /EFI/ubuntu folder is created with required boot files;
$ ls -l /boot/efi/EFI/ubuntu/
total 4328
-rwxr-xr-x 1 root root 108 Apr 30 01:53 BOOTX64.CSV
-rwxr-xr-x 1 root root 117 Apr 30 01:53 grub.cfg
-rwxr-xr-x 1 root root 2594696 Apr 30 01:53 grubx64.efi
-rwxr-xr-x 1 root root 860824 Apr 30 01:53 mmx64.efi
-rwxr-xr-x 1 root root 960472 Apr 30 01:53 shimx64.efi
As a try, I copied the files under /EFI/ubuntu of the 18 installation to my Ubuntu 22 installation after I loaded 22 OS with the grub rescue commands. And when I rebooting the ubuntu22 installation then, it is loading the OS and not entering to Grub rescue mode.
Why the /EFI/ubuntu files are not generating in my Ubuntu 22 installation?
root
(as inset root=(hd0,gpt3)
), where its modules and cfg file resides. As for/EFI/ubuntu
is missing, either you are looking at the wrong / not really looking at the EFI system partition (e.g./boot/efi
is not mounted or not mounted with the correct filesystem), or that you have installed Ubuntu/grub in BIOS/CSM/legacy mode instead of UEFI mode (which is likely the case given that you seem to have abios_grub
partition).