PDA

View Full Version : Failing to write grub when reinstalling system



william104
April 9th, 2017, 03:13 PM
Running grub-install from recovery mode fails with "/boot/efi doesn't look like an EFI partition" even though the partition is formatted as vfat.

History
I have a Dell XPS 15 9550 Windows dual-boot system and tried to upgrade from 16.10 to the new Ubuntu Gnome 17.04 beta to maybe get the headphones working consistently in Linux, but something went wrong during the install and grub never got upgraded. I still got the old boot menu and when I try to boot with the old 4.8 kernels I end up in recovery mode.

I have an encrypted / partition so when the initial upgrade failed I tried to run the USB stick installer, decrypted my partition and tried to install 17.04 on there. The installer failed with the error grub-efi-amd64-signed failed to install into /target/.

I've run boot-repair after booting into the USB stick but it didn't help either.

Now I'm booting into recovery mode and the new kernels seem to be available on /boot and get written to the menu when I run update-grub, so I think I might just need to reinstall grub, but grub-install --efi-directory /boot/efi /dev/nvme0n1 fails with the error above.

oldfred
April 9th, 2017, 03:26 PM
I do not know LVM & encryption. But those that do may need more info.

May be best to see details, you can run from Ubuntu live installer or any working install:
Post the link to the Create BootInfo summary report. Is part of Boot-Repair:
https://help.ubuntu.com/community/Boot-Info and:
https://sourceforge.net/p/boot-repair/home/Home/

Sometimes you need to run fsck fix on the ESP or chkdsk from Windows.

dosfstools - dosfsck (aka fsck.msdos and fsck.vfat) utilities
Must be unmounted change to your ESP/FAT32 partition if not sdb1 as in example:
sudo dosfsck -t -a -w /dev/sdb1
The -a seems to help in clearing dirty bit
https://bbs.archlinux.org/viewtopic.php?id=164185

william104
April 9th, 2017, 03:42 PM
The BootInfo summary generated by boot-repair is http://paste2.org/1fctHxDE

william104
April 9th, 2017, 04:11 PM
fsck.vfat -a /dev/nvme0n1p2 did not help. Afterwards, running boot-repair says it succeeded, but still booting into old menu and grub-install still says /boot/efi doesn't look like an EFI partition

oldfred
April 9th, 2017, 04:21 PM
For whatever reason, older 16.04 version has worked better.
Have you updated UEFI and SSD firmware?

Dell XPS 13 9360
https://ubuntuforums.org/showthread.php?t=2353288
Dell XPS 13 9560 install without issues
https://ubuntuforums.org/showthread.php?t=2357321
Dell XPS 13 9360 16.04 worked after nvme firmware & BIOS update, 16.10 did not, new rEFInd for NVMe
http://askubuntu.com/questions/884991/ubuntu-16-10-dual-boot-error-grub-efi-amd64-signed-package-failed-to-install
Dell XPS 13 9360 Dualboot Windows 10 and Ubuntu 16.04 AHCI NVMe
http://askubuntu.com/questions/867488/dell-xps-13-9360-dualboot-windows-10-and-ubuntu-16-04?noredirect=1#comment1344306_867488
Ubuntu 16 on the DELL XPS15 9550 Tutorial
https://ubuntuforums.org/showthread.php?t=2345444

william104
April 10th, 2017, 10:28 PM
Tried to reinstall 16.04.2, but got the same result. Not seeing the fatal errors during grub-install that some of the other users get, only that the partition does not look like an EFI partition.

There's no new firmware for the Samsung SSD in the XPS 15 (the other poster had a Toshiba drive in the XPS 13) and I have the latest BIOS.

oldfred
April 10th, 2017, 11:40 PM
This says it is an ESP - efi system partition.

/dev/nvme0n1p2 923648 1128447 204800 100M EFI System

Did you turn off RAID and turn on ACHI for drives?
Otherwise Dells seem to usually work.

william104
April 11th, 2017, 08:21 PM
Yes, AHCI has been on since I first installed Ubuntu.

So, this is a bug in grub-install? That it gives the "doesn't look like an EFI partition" error message when other tools tell it is clearly acting on an EFI partition (I also tried the --force --recheck parameters and the one to skip file system check).

oldfred
April 11th, 2017, 08:39 PM
Do not know if a bug or not.
Others have had issues, but after various updates or Boot-Repair then most seem to have got it to work.

Support for NVMe in grub-mkdevicemap fixed in 2014
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1275162
spec entry for nvme devices (UEFI v2.4A 9.3.5.22)
https://ubuntuforums.org/archive/index.php/t-2292993.html
finally got my 2 SM951's dual booting Win10 and Ubuntu 15.10....and what a pain it was.

william104
April 11th, 2017, 10:31 PM
It might be related to the encrypted partition. When I run boot-repair in advanced mode with the partition mounted, it asks me paste a number of commands into the terminal for installing grub. It fails with "error: attempt to install to encrypted disk without cryptdisk enabled. Set ` GRUB_ENABLE_CRYPTODISK=1` in file `/etc/default /grub`." and fails again with the same message even when I have added GRUB_ENABLE_CRYPTODISK=1 (or GRUB_ENABLE_CRYPTODISK=y) to /etc/default/grub

oldfred
April 12th, 2017, 12:21 AM
I do not know encryption, but you do have to have it mounted so it can see / (root) to reinstall grub.
Boot-Repair obviously cannot auto mount the encrypted, so you have to do that yourself.

william104
April 13th, 2017, 11:38 PM
Ok, think I solved it. When I tried recreating the encrypted partition during installation of 17.04, the installer warned that an encrypted partition required a separate unencrypted /boot partition. Once I specified a separate partition as a /boot mount point, the installation went through fine. The issue was maybe that grub-install was not able to identify the unencrypted /boot partition and thought it lived on the encrypted partition.