Installing Ubuntu 18.04.3 LTS alongside Windows 10 (Dual Boot) causes grub install to fail with fatal error

Bug #1839894 reported by Rohan Paul
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
grub-installer (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

1. Installing Ubuntu 18.04.3 LTS on HP Spectre x360 Convertible laptop alongside pre-installed Windows 10 (Dual Boot)
2. Windows installed in UEFI mode
3. Ubuntu installation fails towards the end when attempting to install grub2

Expected:
Install to be successful

Actual:
Install failed when trying to install grub

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: ubiquity 18.04.14.12
ProcVersionSignature: Ubuntu 5.0.0-23.24~18.04.1-generic 5.0.15
Uname: Linux 5.0.0-23-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
CasperVersion: 1.394
CurrentDesktop: ubuntu:GNOME
Date: Mon Aug 12 16:54:19 2019
InstallCmdLine: BOOT_IMAGE=/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash ---
LiveMediaBuild: Ubuntu 18.04.3 LTS "Bionic Beaver" - Release amd64 (20190805)
ProcEnviron:
 LANGUAGE=en_US.UTF-8
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 LC_NUMERIC=C.UTF-8
SourcePackage: grub-installer
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Rohan Paul (rohanpaul11) wrote :
Revision history for this message
Chris Guiver (guiverc) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

I note the following messages

Aug 12 23:47:46 ubuntu kernel: [ 356.482177] FAT-fs (nvme0n1p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
Aug 12 23:47:47 ubuntu grub-installer: grub-install: error: cannot open `/boot/efi/EFI/ubuntu/grubx64.efi': Input/output error.

I would suggest `fsck` (ie. performing a file system check) or `badblocks` of your EFI partition, or ensuring 'fastboot' is disabled in windows 10 to ensure the EFI partition is left in a clean state.

Revision history for this message
Rohan Paul (rohanpaul11) wrote :

Thanks for your reply.

I had already disabled Fastboot in Windows.

I ran `chkdsk /f /r` from Windows on the EFI partition and then tried installing Ubuntu. The installation succeeded but I was not able to boot into Ubuntu. I used bcdedit to add grubx64.efi to the boot path but even that did not help. To make matters worse, when I tried reinstalling Ubuntu, I started getting the same error again - "grub-install failed...this is a fatal error". Unfortunately this time, even `chkdsk` from Windows failed to resolve the issue. So I used `Try Ubuntu` option from the live usb stick and ran the commands you suggested for my EFI partition:

sudo fsck /dev/nvme0n1p1
sudo badblocks /dev/nvme0n1p1 -v

There were no errors reported.

I have spent over a day now on this and am really not sure what is wrong here.
I would really appreciate some help/insight.
Let me know if any more info is required.
Thanks.

Revision history for this message
Rohan Paul (rohanpaul11) wrote :

I have now managed to get rid of this error. I had to manually delete the directory "/EFI/ubuntu". However, I had to delete the folder both from windows and ubuntu (booted using live usb). I find that weird since both OSs refer to the same EFI partition and hence the ubuntu folder once deleted from windows should not have been visisble from ubuntu.

Unfortunately, I am still unable to boot ubuntu after I restart once the installation completes successfully. I tried running boot-repair, tried mounting the linux partition and the EFI partition in a live usb session and reinstalled grub in a chroot environment, I even booted into windows and set the bootmgr path to /EFI/ubuntu/gubx64.efi. Nothing worked.

Something weird that I noticed is: after I install linux, if I run a terminal and mount the EFI partition, I can see the /EFI/ubuntu folder with all the files (mmx, grubx, shimx). But as soon as I restart and go to the boot options, I don't see any entry for ubuntu. When I select "Boot from EFI file", I am unable to see any ubuntu directory in the EFI dir which is weird since just moments ago I saw its existence from the live USB. Naturally, I am unable to boot into Ubuntu and can only boot into Windows. I tried every possible solution here (https://ubuntuforums.org/showthread.php?t=2147295) and nothing seems to be working.

Revision history for this message
Rohan Paul (rohanpaul11) wrote :

I managed to finally solve this by reinstalling Windows and then installing Ubuntu 18.04.3 again. I don't know what the difference was when I installed Windows myself(as opposed to the preinstalled version) but doing this certainly solved the issue. I was able to dual boot after that.

Changed in grub-installer (Ubuntu):
status: New → Invalid
Revision history for this message
Alexander Mescheryakov (alexander-s-m) wrote :

I've encountered the same issue while installing Kubuntu 20.04.

In my case it was resolved by checking FS with dosfsck.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.