Score:0

Grub installation failed during ubuntu 22.04 installation

je flag

When installing Ubuntu 22.04, the installation goes by perfectly until the end, where it says that grub failed to install in /dev/nvme0n1, and the installer crashes. Here is a list of stuff I have done:

  1. Disable windows fast boot(NOT the one in UEFI settings), hibernation
  2. Tried to create a new primary 500MB EFI partition
  3. Boot-repair, which gives the following output:
boot-repair-4ppa2056                                              [20230604_0803]

============================== Boot Info Summary ===============================

 => Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for (hd0,msdos1)/boot/grub. It also embeds following components:
    
    modules
    ---------------------------------------------
    biosdisk fshelp fat exfat ext2 ntfs ntfscomp part_msdos
    ---------------------------------------------

sda1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  MSWIN4.1: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /boot/grub/grub.cfg /efi/boot/bootx64.efi 
                       /efi/boot/grubx64.efi /efi/boot/mmx64.efi

md/imsm0: ______________________________________________________________________

    File system:       
    Boot sector type:  Unknown
    Boot sector info: 

md/imsm1: ______________________________________________________________________

    File system:       
    Boot sector type:  Unknown
    Boot sector info: 


================================ 1 OS detected =================================

OS#1:   Ubuntu 22.04.2 LTS on nvme0n1p7

================================ Host/Hardware =================================

CPU architecture: 64-bit
Video: Iris Plus Graphics G1 (Ice Lake) GP108M [GeForce MX330] from Intel Corporation NVIDIA Corporation
Live-session OS is Ubuntu 64-bit (Ubuntu 22.04.2 LTS, jammy, x86_64)

===================================== UEFI =====================================

BIOS/UEFI firmware: X421JPY.304(5.14) from American Megatrends Inc.
The firmware is EFI-compatible, and is set in EFI-mode for this live-session.
SecureBoot enabled.
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0002,0003,0000,0001
Boot0000* ubuntu    VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....@...............
Boot0002* Windows Boot Manager  HD(1,GPT,aca35eab-217c-4a7f-8ec7-02a8e1ee236a,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0003* UEFI: SanDisk Cruzer Blade 1.27, Partition 1  PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x1bdad,0x800,0x1d1d000)..BO


============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

nvme0n1 : is-GPT,   no-BIOSboot,    has---ESP,  not-usb,    not-mmc, has-os,    no-wind,    2048 sectors * 512 bytes
nvme1n1 : notGPT,   no-BIOSboot,    has-noESP,  not-usb,    not-mmc, no-os, no-wind,    2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

nvme0n1p1   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   not-far
nvme0n1p3   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios
nvme0n1p4   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios
nvme0n1p5   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios
nvme0n1p6   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios
nvme0n1p7   : is-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios

Partitions info (2/3): _________________________________________________________

nvme0n1p1   : is---ESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p3   : isnotESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p4   : isnotESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p5   : isnotESP, part-has-no-fstab,  no-nt,  no-winload, recovery-or-hidden, no-bmgr,    notwinboot
nvme0n1p6   : isnotESP, part-has-no-fstab,  no-nt,  no-winload, recovery-or-hidden, no-bmgr,    notwinboot
nvme0n1p7   : isnotESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot

Partitions info (3/3): _________________________________________________________

nvme0n1p1   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p3   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p4   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p5   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p6   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p7   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1

fdisk -l (filtered): ___________________________________________________________

Disk nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk identifier: 9DE0B63B-E521-4FEF-BAF2-E9D979AE0F0B
              Start        End   Sectors   Size Type
nvme0n1p1      2048     534527    532480   260M EFI System
nvme0n1p2    534528     567295     32768    16M Microsoft reserved
nvme0n1p3    567296  649581198 649013903 309.5G Microsoft basic data
nvme0n1p4 792944640  997744639 204800000  97.7G Microsoft basic data
nvme0n1p5 997746688  999794687   2048000  1000M Windows recovery environment
nvme0n1p6 999794688 1000204287    409600   200M Windows recovery environment
nvme0n1p7 649582592  792944639 143362048  68.4G Linux filesystem
Partition table entries are not in disk order.
Disk nvme1n1: 27.25 GiB, 29260513280 bytes, 57149440 sectors
Disk sda: 14.56 GiB, 15631122432 bytes, 30529536 sectors
Disk identifier: 0x0001bdad
      Boot Start      End  Sectors  Size Id Type
sda1  *     2048 30529535 30527488 14.6G  c W95 FAT32 (LBA)

parted -lm (filtered): _________________________________________________________

sda:15.6GB:scsi:512:512:msdos:SanDisk Cruzer Blade:;
1:1049kB:15.6GB:15.6GB:fat32::boot, lba;
nvme0n1:512GB:nvme:512:512:gpt:INTEL HBRPEKNX0202A:;
1:1049kB:274MB:273MB:fat32:EFI system partition:boot, esp;
2:274MB:290MB:16.8MB::Microsoft reserved partition:msftres;
3:290MB:333GB:332GB:ntfs:Basic data partition:msftdata;
7:333GB:406GB:73.4GB:ext4::;
4:406GB:511GB:105GB:ntfs:Basic data partition:msftdata;
5:511GB:512GB:1049MB:ntfs:Basic data partition:hidden, diag;
6:512GB:512GB:210MB:fat32:Basic data partition:hidden, diag;
nvme1n1:29.3GB:nvme:512:512:unknown:INTEL HBRPEKNX0202AO:;

blkid (filtered): ______________________________________________________________

NAME        FSTYPE          UUID                                 PARTUUID                             LABEL       PARTLABEL
sda                                                                                                               
└─sda1      vfat            E6A5-B05E                            0001bdad-01                          UBUNTU 22_0 
nvme0n1     isw_raid_member                                                                                       
├─md127                                                                                                           
├─nvme0n1p1                                                                                                       
├─nvme0n1p2                                                                                                       
├─nvme0n1p3                                                                                                       
├─nvme0n1p4                                                                                                       
├─nvme0n1p5                                                                                                       
├─nvme0n1p6                                                                                                       
└─nvme0n1p7                                                                                                       
nvme1n1     isw_raid_member                                                                                       
└─md126                                                                                                           

Mount points (filtered): _______________________________________________________

                          Avail Use% Mounted on
/dev/sda1                   10G  32% /cdrom

Mount options (filtered): ______________________________________________________


====================== sda1/boot/grub/grub.cfg (filtered) ======================

Try or Install Ubuntu
Ubuntu (safe graphics)
OEM install (for manufacturers)
Boot from next volume
UEFI Firmware Settings
Test memory

==================== sda1: Location of files loaded by Grub ====================

           GiB - GB             File                                 Fragment(s)
            ?? = ??             boot/grub/grub.cfg                             1

======================== Unknown MBRs/Boot Sectors/etc =========================

Unknown BootLoader on md/imsm0

Unknown BootLoader on md/imsm1



=================== blkid (filtered) before raid activation ====================

/dev/nvme0n1p1: LABEL_FATBOOT="SYSTEM" LABEL="SYSTEM" UUID="B0D6-0531" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="aca35eab-217c-4a7f-8ec7-02a8e1ee236a"
/dev/nvme0n1p3: LABEL="OS" BLOCK_SIZE="512" UUID="7626D7F226D7B0FB" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="4e5d47d9-b8b3-4bb2-ac11-944f7ae4b7c8"
/dev/nvme0n1p4: LABEL="New Volume" BLOCK_SIZE="512" UUID="985A57C35A579D36" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="fdf8e83c-7d7f-4470-991e-75e94189993e"
/dev/nvme0n1p5: LABEL="RECOVERY" BLOCK_SIZE="512" UUID="589C699E9C697780" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="672707d6-6761-4ffb-8a36-2e746b16fbb9"
/dev/nvme0n1p6: LABEL="MYASUS" UUID="889C-FE90" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="4f0a7fc1-5dd8-4747-b698-45bebef57c5a"
/dev/nvme0n1p7: UUID="9ea5eaf8-6925-492f-b992-0e5f23607a1f" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="02fc1985-2c15-40a3-b66c-30614013a2b0"
/dev/nvme1n1: TYPE="isw_raid_member"
/dev/sda1: LABEL="UBUNTU 22_0" UUID="E6A5-B05E" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="0001bdad-01"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="910011b7-95aa-4962-b178-7ef5ae9f1571"


==================================== dmraid ====================================

dmraid -si -c
no block devices found
dmraid -ay:
no block devices found
dmraid -sa -c:
no block devices found


==================================== mdadm =====================================
mdadm --assemble --scan

mdadm --detail --scan
ARRAY /dev/md/imsm0 metadata=imsm UUID=af6c8bf5:a28d97be:258a3619:a6114dc2
ARRAY /dev/md/imsm1 metadata=imsm UUID=42ca00db:1a8c1a71:77047fef:31f2dc9a
mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p3 /mnt/boot-sav/nvme0n1p3 
mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p4 /mnt/boot-sav/nvme0n1p4 
mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p5 /mnt/boot-sav/nvme0n1p5 
mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p3 /mnt/boot-sav/nvme0n1p3 
mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p4 /mnt/boot-sav/nvme0n1p4 
mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p5 /mnt/boot-sav/nvme0n1p5 


Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would not act on the boot.

I had tried to manually install grub through chroot, which ended up giving the same error. I am on an ASUS laptop.

Edit: I tried using demsg in the EFI folder. It shows invalid cluster chain errors in nvme0n1p1. There's an Ubuntu folder in the EFI folder, it shows input/output error. Maybe this folder was damaged when I was trying to install Ubuntu? Can someone tell me how to fix it?

oldfred avatar
cn flag
You have UEFI Secure boot on. And at some point installed grub to MBR for old BIOS boot which you do not want. Only one ESP per drive, Ubuntu installer will use ESP on first drive whatever UEFI says is first drive. Did you update UEFI and NVMe firmware. And turn off Windows bitlocker? So you really want Secure Boot, many do not use it, but Ubuntu should work with it, but has to be installed in that mode, so kernel, drivers, & grub are all signed.
Manan Garg avatar
je flag
I do not want secure boot, and have turned it off now. I have turned bitlocker off, as Ubuntu installation cannot take place without it. You said that I had previously installed grub, but till now have not been able to boot to it. What are my options to proceed?
Manan Garg avatar
je flag
Also I beleive that the Grub2 installation it mentions is the one on my flash drive, the one I'm using for a live Ubuntu session
cc flag
Did you try to repair the EFI partition with dosfsck or a Windows tool? Might have to run several times. Might be left with missing files. Might have to reinstall all bootloaders from scratch. Copy all files off, then try the repair, so you can restore if necessary. Remember, the bootloaders are just files and may be copied around.
oldfred avatar
cn flag
You said you turned off Windows fast startup, but then report should not have shown issues with NTFS hiberfile. And MD RAID issues are often from Optane. One Asus user posted :After setting the fast boot option to Auto, it worked!" Others used a UEFI setting to turn off optane. Some had to use a Windows/Intel app to turn off Optane.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.