0

I have two ubuntu installed in my system, one on the SSD (nvme0n1p1), and one on the Harddrive (sda1).

After upgrade to 17.10, ubuntu on the SSD wont boot, not being able to find file '/boot/vmlinuz-4.13.0-041300-generic', although the files are there. (See error: file '/boot/vmlinuz-4.13.0-041300-generic' not found , how to create?)

I see now on gparted, that the partition containing these files is not mounted correctly, so grub cannot see the files.

enter image description here

Where as for the other OS installed in the harddrive, which is working fine, gparted shows:

enter image description here

On start, grub also complaints that "22ac8da-d6..." partition was not found. This is how the SSD partition is apparently mounted.

I guess I should change the mount settings, so nvme0n1p1 has /boot/efi/ as the mount point, and have nvme0n1p2 on / , in other words, exactly how the partitions are set on the harddrive (sda1, sda2).

Any help on how I can do this?

the content of /etc/fstab shows that /boot/efi/ was previously on nvme0n1p1

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=22ac8da3-d60a-46db-811d-a09ce5538215 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=C1DE-5B29  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

And the output of blkid:

/dev/nvme0n1: PTUUID="eb5c38b1-7f71-4b49-a4e9-9e6ab2c9b6a4" PTTYPE="gpt"
/dev/nvme0n1p1: UUID="C1DE-5B29" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="5b57c19c-750b-457a-89f1-87130509735e"
/dev/nvme0n1p2: UUID="22ac8da3-d60a-46db-811d-a09ce5538215" TYPE="ext4" PARTUUID="2e1b8924-98f4-4821-8f48-8452620182b8"
/dev/sda1: UUID="DF5C-3936" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="2798e3ca-54f4-4528-8753-0b516c1a749c"
/dev/sda2: UUID="d37fc604-163d-4e04-83de-88993c28e419" TYPE="ext4" PARTUUID="a1331af1-a3e0-4f4e-846c-2ae70d53cb26"

Output of lsblk -f , which agrees with display of gparted:

NAME        FSTYPE LABEL UUID                                 MOUNTPOINT
sda                                                           
├─sda1      vfat         DF5C-3936                            /boot/efi
└─sda2      ext4         d37fc604-163d-4e04-83de-88993c28e419 /
sr0                                                           
nvme0n1                                                       
├─nvme0n1p1 vfat         C1DE-5B29                            
└─nvme0n1p2 ext4         22ac8da3-d60a-46db-811d-a09ce5538215 /media/lukas/22ac8da3-d60a-46db-811d-a09ce5538215

In summary: How can I set the Mount Point of /dev/nvme0n1p1 to /boot/efi/ ?

The error message upon booting on 17.10 in nvme0n1p1 is:

error: failure reading sector 0x3b9e12a0 from 'hd2'
error: failure reading sector 0x3b9e1200 from 'hd2'
error: failure reading sector 0x0 from 'hd2'
error: failure reading sector 0x3b9e12a0 from 'hd2'
error: failure reading sector 0x3b9e1200 from 'hd2'
error: failure reading sector 0x0 from 'hd2'
error: no such device: 22ac8da3-d60a-46db-811d-a09ce5538215 
error: file '/boot/vmlinuz-4.13.0-041300-generic' not found
error: you need to load the kernel first

Output of efibootmgr -v

BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0001,0002,0008,0009
Boot0000* ubuntu    HD(1,GPT,2798e3ca-54f4-4528-8753-0b516c1a749c,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* grub  HD(1,GPT,2798e3ca-54f4-4528-8753-0b516c1a749c,0x800,0x100000)/File(\EFI\ubuntu\grubx64.efi)
Boot0002* boot  HD(1,GPT,2798e3ca-54f4-4528-8753-0b516c1a749c,0x800,0x100000)/File(\EFI\Boot\bootx64.efi)
Boot0008  Onboard NIC (IPV4)    PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(14b31f18c7f5,0)/IPv4(0.0.0.0:0<->0.0.0.0:0,0,0)..BO
Boot0009  Onboard NIC (IPV6)    PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(14b31f18c7f5,0)/IPv6([::]:<->[::]:,0,0)..BO

Boot-Info summary:

http://paste.ubuntu.com/p/bG54zn47VZ/

boot/efi/EFI/ubuntu/grub.cfg on both the SSD and HD are the same:

search.fs_uuid d37fc604-163d-4e04-83de-88993c28e419 root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

UPDATES from suggestions of Oldfred:

Current output of efibootmgr -v

BootOrder: 0003,0000,0001,0002,0008,0009
Boot0000* ubuntu    HD(1,GPT,2798e3ca-54f4-4528-8753-0b516c1a749c,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* grub  HD(1,GPT,2798e3ca-54f4-4528-8753-0b516c1a749c,0x800,0x100000)/File(\EFI\ubuntu\grubx64.efi)
Boot0002* boot  HD(1,GPT,2798e3ca-54f4-4528-8753-0b516c1a749c,0x800,0x100000)/File(\EFI\Boot\bootx64.efi)
Boot0003* Ubuntu-NVMe   HD(1,GPT,5b57c19c-750b-457a-89f1-87130509735e,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0008  Onboard NIC (IPV4)    PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(14b31f18c7f5,0)/IPv4(0.0.0.0:0<->0.0.0.0:0,0,0)..BO
Boot0009  Onboard NIC (IPV6)    PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(14b31f18c7f5,0)/IPv6([::]:<->[::]:,0,0)..BO

/boot/efi/EFI/ubuntu/grub.cfg on NVMe:

search.fs_uuid 22ac8da3-d60a-46db-811d-a09ce5538215 root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

/boot/efi/EFI/ubuntu/grub.cfg on HDD:

search.fs_uuid d37fc604-163d-4e04-83de-88993c28e419 root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
  • @mook765 thank for looking into this issue. I ran sudo update-grub from the harddrive installed ubuntu, but sadly it did not change anything. I am concerned too why lsblk -f and geparted do not agree on the content of /etc/fstab on showing the SSD as /boot/efi... – hirschme Jun 4 '18 at 15:22
  • You are confused with two instances of Grub installed on different ESP's. Your mount points look good, only the currently used ESP and /-partition are mounted at /boot/efi and /, the other ESP is not mounted at all (not used in this moment) and the second install mounted under /media, totally correct. Did you try to reboot after running sudo update-grub? – mook765 Jun 4 '18 at 15:40
  • 1
    Please add the output of efibootmgr -v to your question. Please don't post screenshots of plain text, copy and paste from terminal into question make things better readable and text-processing possible. – mook765 Jun 4 '18 at 15:51
  • 1
    You use the instance of Grub installed on sda1 at the moment. I don't understand the error no such device: 22ac8da3-d60a-46db-811d-a09ce5538215, lsblk and blkid show the correct UUID for this partition, it should be found, that's quite mystic. – mook765 Jun 4 '18 at 16:19
  • 1
    With UEFI, only one ESP and one /EFI/ubuntu folder is used. Usually the install finds the first ESP often sda's, but with NVMe drives it usually finds it as first drive. Better to see all details at once. Post the link to the Create BootInfo summary report. Is part of Boot-Repair: help.ubuntu.com/community/Boot-Info Drive order can make a difference on booting, and whether I have my flash drive plugged in or not can make a difference. – oldfred Jun 4 '18 at 17:01
2

See if this adds an entry in UEFI to boot from NVMe drive. See man efibootmgr for details on parameters.

sudo efibootmgr -c -L "Ubuntu-NVMe" -l "\EFI\ubuntu\shimx64.efi" -d /dev/nvme0n1 -p 1

But whenever I use a -L label different than Ubuntu, it still boots from the /EFI/ubuntu/grub.cfg, so make sure you have that also and it is correct. It used to not even have a 3 line grub.cfg in other labels, now it does, but something internally is still coded to only use /EFI/ubuntu/grub.cfg.

Script has not been updated to fully show NVMe drives. Your grub.cfg in it should be:

search.fs_uuid 22ac8da3-d60a-46db-811d-a09ce5538215 root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

And the one in sda, should have UUID of install in sda, but probably hd1,gpt2, UUID should override device setting. Not sure how UEFI and grub see drives. I plug in external SSD and it becomes hd0 even though sdc in Ubuntu. And then grub/UEFI bumps up all my other drives one number. And if I also have flash drive plugged in I have to change hd0 to hd2 to find install in sda.

  • I ran the efibootmgr command and rebooted the system. Selecting ubuntu on NVMe actually worked this time, however after inspection I found out it loaded the ubuntu on the harddrive. Seems a step closer though... – hirschme Jun 4 '18 at 19:36
  • 1
    Does the NVMe drive's /EFI/ubuntu/grub.cfg in the ESP have the UUID of the ubuntu install on the HDD, not the UUID of the install on the NVMe drive? It may have correct grub.cfg in /EFI/Ubuntu-NVMe folder in ESP. The efibootmgr -v for the new ubuntu-nvme entry will have the GUID/PartUUID of the NVMe drive's ESP. And the grub.cfg in /EFI/ubuntu on NVMe should have UUID of install partition on NVMe drive. The ubuntu entry in efibootmgr -v should still be GUID of ESP on sda and its grub.cfg should have UUID of install partition on HDD. – oldfred Jun 4 '18 at 19:38
  • the efibootmgr -v for the new ubuntu-nvme entry does have the GUID/PARTUUID of the NVMe's drive, that is correct. BUT, the grub.cfg in NVMe's /EFI/ubuntu does NOT have the UUID of the NVMe drive, and still has the UUID of the HDD, which may explain why is it still booting the HDD ubuntu – hirschme Jun 4 '18 at 19:41
  • Change that to correct UUID, you may just need to copy from /EFI/Ubuntu-NVMe/grub.cfg or manually edit with correct UUID. It will not use the grub.cfg in the new entry (but it should), it only wants to use /EFI/ubuntu/grub.cfg. – oldfred Jun 4 '18 at 19:43
  • 1
    The shimx64.efi is a version of grub for UEFI Secure Boot and should work whether Secure boot is on or off. The grubx64.efi is only for UEFI with Secure boot off. Or it should not matter which you use if Secure Boot is off. I would think UUID would override HD0 if not correct. But then what does fstab show? Some have copied fstab, so it boots incorrect install? Compare fstabs on NVMe and HDD. Boot-Repair report only shows fstab from HDD. – oldfred Jun 4 '18 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.