Welcome to Centmin Mod Community
Register Now

Sysadmin Grub Help?

Discussion in 'System Administration' started by Jimmy, Sep 15, 2017.

  1. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    Actually, looking closer, I don't think it would, because it's looking for a different file

    Code:
    HD(1,GPT,050ee7d4-35c8-453b-98be-dc1136ec1b7d,0x800,0xff800)/File(\EFI\centos\grubx64.efi)
    Which does exist
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    interesting
    Code (Text):
    efibootmgr -v
    BootCurrent: 0003
    Timeout: 0 seconds
    BootOrder: 0003,0009,0008,0006,0004,0005,0007,0000,0001,0002
    Boot0000* Enter Setup    FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
    Boot0001  Boot Device List    FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(eec25bdc-67f2-4d95-b1d5-f81b2039d11d)$.I.B.T...
    Boot0002  Network Boot    FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9e09e6fd-4e16-6468-9b78-bdaeaf609cff)$.I.B.T...
    Boot0003* UEFI IPv4: Intel I210 Network 00 at Baseboard    /Pci(0x1d,0x2)/Pci(0x0,0x0)/MAC(a4bf012063f2,0)/IPv4(0.0.0.00.0.0.0,0,0)N.....YM....R,Y.
    Boot0004* UEFI IPv6: Intel I210 Network 00 at Baseboard    /Pci(0x1d,0x3)/Pci(0x0,0x0)/MAC(a4bf012063f3,0)/IPv6([::]:<->[::]:,0,0)N.....YM....R,Y.
    Boot0005* Launch EFI Shell    FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)
    Boot0006* UEFI IPv4: Intel I210 Network 00 at Baseboard 2    /Pci(0x1d,0x3)/Pci(0x0,0x0)/MAC(a4bf012063f3,0)/IPv4(0.0.0.00.0.0.0,0,0)N.....YM....R,Y.
    Boot0007* UEFI IPv6: Intel I210 Network 00 at Baseboard 2    /Pci(0x1d,0x2)/Pci(0x0,0x0)/MAC(a4bf012063f2,0)/IPv6([::]:<->[::]:,0,0)N.....YM....R,Y.
    Boot0008* centos    HD(1,GPT,050ee7d4-35c8-453b-98be-dc1136ec1b7d,0x800,0xff800)/File(\EFI\centos\grubx64.efi)
    Boot0009* centos7_64 (GRUB) (first drive nvme0n1)    HD(1,GPT,050ee7d4-35c8-453b-98be-dc1136ec1b7d,0x800,0xff800)/File(\EFI\centos\grubx64.efi)
    Boot000A* UEFI Misc Device    /Pci(0x1,0x1)/Pci(0x0,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)N.....YM....R,Y.
    

    that file is part of grub2-efi yum package
    Code (Text):
    yum -q provides */grubx64.efi
    1:grub2-efi-x64-2.02-0.76.el7.centos.x86_64 : GRUB for EFI systems.
    Repo        : base
    Matched from:
    Filename    : /boot/efi/EFI/centos/grubx64.efi
    1:grub2-efi-x64-2.02-0.76.el7.centos.1.x86_64 : GRUB for EFI systems.
    Repo        : updates
    Matched from:
    Filename    : /boot/efi/EFI/centos/grubx64.efi
    

    but is /boot/efi/EFI/centos/grubx64.efi enough for a UEFI bios + nvme /boot/efi setup to safely reboot or do you still require /boot/efi/EFI/centos/grub.cfg ? Guess only time to tell is with actual eventual server reboot :)
     
  3. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    For £60, I'm going to get one of the rise servers to test with next week
     
    • Like Like x 1
    • Winner Winner x 1
  4. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Nice let us know how you do. The NVMe servers I am testing for Centmin Mod related benchmark comparisons aren't from OVH so seem to have a different configuration setup for NVMe disks - will be testing AMD Ryzen 3600 6CT/12T vs AMD Ryzen 3800X 8C/16T vs Intel Xeon E-2276G 6C/12T :) Plan is to do benchmarks twice, once with CentOS 7 3.10 default kernel and once with updated 5.2+ Linux Kernels which would in theory boost AMD Ryzen and Intel Xeon performance - so updating kernel and being able to properly reboot on NVMe based disks is important :)
     
    • Like Like x 1
  5. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    Just noticed this while looking again

    Code:
    [18:42][[email protected]*]# efibootmgr
    BootCurrent: 0003
    Timeout: 1 seconds
    BootOrder: 0003,0004,0005,0006,0008,0007
    Boot0002  UEFI: Built-in EFI Shell
    Boot0003* UEFI: PXE IP4 Intel(R) Ethernet Controller X540-AT2
    Boot0004* UEFI: PXE IP4 Intel(R) Ethernet Controller X540-AT2
    Boot0005* UEFI: PXE IP4 Broadcom NetXtreme Gigabit Ethernet (BCM5720)
    Boot0006* UEFI: PXE IP4 Broadcom NetXtreme Gigabit Ethernet (BCM5720)
    Boot0007  USB
    Boot0008  UEFI: Built-in EFI Shell
    That server isn't even looking for a drive. All the OVH servers I've seen recently have efibootmgr booting to device 0003 (which is the IP4 Intel NIC) first, and that is also the current booted device.
     
    • Informative Informative x 2
  6. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    Installing my new server now with the OVH OS template for C7 with NVMe drives, and will document as much as possible.
     
    • Like Like x 1
    • Informative Informative x 1
  7. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    Code:
    [[email protected] ~]# efibootmgr -v
    BootCurrent: 0009
    Timeout: 0 seconds
    BootOrder: 0009,0008,0003,0006,0004,0005,0007,0000,0001,0002
    Boot0000* Enter Setup   FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
    Boot0001  Boot Device List      FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(eec25bdc-67f2-4d95-b1d5-f81b2039d11d)$.I.B.T...
    Boot0002  Network Boot  FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9e09e6fd-4e16-6468-9b78-bdaeaf609cff)$.I.B.T...
    Boot0003* UEFI IPv4: Intel I210 Network 00 at Baseboard /Pci(0x1d,0x2)/Pci(0x0,0x0)/MAC(a4bf01203a82,0)/IPv4(0.0.0.00.0.0.0,0,0)N.....YM....R,Y.
    Boot0004* UEFI IPv6: Intel I210 Network 00 at Baseboard /Pci(0x1d,0x3)/Pci(0x0,0x0)/MAC(a4bf01203a83,0)/IPv6([::]:<->[::]:,0,0)N.....YM....R,Y.
    Boot0005* Launch EFI Shell      FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)
    Boot0006* UEFI IPv4: Intel I210 Network 00 at Baseboard 2       /Pci(0x1d,0x3)/Pci(0x0,0x0)/MAC(a4bf01203a83,0)/IPv4(0.0.0.00.0.0.0,0,0)N.....YM....R,Y.
    Boot0007* UEFI IPv6: Intel I210 Network 00 at Baseboard 2       /Pci(0x1d,0x2)/Pci(0x0,0x0)/MAC(a4bf01203a82,0)/IPv6([::]:<->[::]:,0,0)N.....YM....R,Y.
    Boot0008* centos        HD(1,GPT,594ae280-8e22-4d8a-bf7e-089a97442db5,0x800,0xff800)/File(\EFI\centos\grubx64.efi)
    Boot0009* centos7_64 (GRUB) (first drive nvme0n1)       HD(1,GPT,594ae280-8e22-4d8a-bf7e-089a97442db5,0x800,0xff800)/File(\EFI\centos\grubx64.efi)
    Code:
    [[email protected] etc]# ls -al grub2*
    lrwxrwxrwx. 1 root root 22 Aug  1 01:06 grub2.cfg -> ../boot/grub2/grub.cfg
    lrwxrwxrwx. 1 root root 31 Aug  1 01:10 grub2-efi.cfg -> ../boot/efi/EFI/centos/grub.cfg
    Broken symlink back to /boot/efi/EFI/centos/grub.cfg

    Code:
    [[email protected] etc]# ls -hl /boot/efi/EFI/centos/
    total 136K
    -rwxr-xr-x. 1 root root 136K Sep 16 14:00 grubx64.efi
    efibootmgr shows

    Boot0009* centos7_64 (GRUB) (first drive nvme0n1) HD(1,GPT,594ae280-8e22-4d8a-bf7e-089a97442db5,0x800,0xff800)/File(\EFI\centos\grubx64.efi)

    as the booted device

    Code:
    [[email protected] ~]# efibootmgr -v
    BootCurrent: 0009
    
    [[email protected] etc]# uname -r
    3.10.0-957.27.2.el7.x86_64
    Testing installing mainline kernel

    Code:
    Warning: RPMDB altered outside of yum.
      Installing : kernel-ml-5.2.14-1.el7.elrepo.x86_64                                                                                                                                                                                                         1/1
      Verifying  : kernel-ml-5.2.14-1.el7.elrepo.x86_64                                                                                                                                                                                                         1/1
    
    Installed:
      kernel-ml.x86_64 0:5.2.14-1.el7.elrepo                                                                                                                                                                                                                      
    
    Complete!
    [[email protected] ~]# sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
    0 : CentOS Linux (5.2.14-1.el7.elrepo.x86_64) 7 (Core)
    1 : CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)
    2 : CentOS Linux (0-rescue-1095c072513627b05522c4975d7f86e0) 7 (Core)
    [[email protected] ~]# grub2-set-default 0
    [[email protected] ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-5.2.14-1.el7.elrepo.x86_64
    Found initrd image: /boot/initramfs-5.2.14-1.el7.elrepo.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-957.27.2.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-957.27.2.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-1095c072513627b05522c4975d7f86e0
    Found initrd image: /boot/initramfs-0-rescue-1095c072513627b05522c4975d7f86e0.img
    done
    [[email protected] ~]# cd /etc/
    [[email protected] etc]# ls -al grub2*
    lrwxrwxrwx. 1 root root 22 Aug  1 01:06 grub2.cfg -> ../boot/grub2/grub.cfg
    lrwxrwxrwx. 1 root root 31 Aug  1 01:10 grub2-efi.cfg -> ../boot/efi/EFI/centos/grub.cfg
    [[email protected] etc]#
    
    /boot/efi/EFI/centos/grub.cfg is still missing
    
    [[email protected] etc]# ls -hl /boot/efi/EFI/centos/grub.cfg
    ls: cannot access /boot/efi/EFI/centos/grub.cfg: No such file or directory
    
    
    [[email protected] ~]# efibootmgr -v
    BootCurrent: 0009
    Timeout: 0 seconds
    BootOrder: 0009,0008,0003,0006,0004,0005,0007,0000,0001,0002
    Boot0000* Enter Setup   FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
    Boot0001  Boot Device List      FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(eec25bdc-67f2-4d95-b1d5-f81b2039d11d)$.I.B.T...
    Boot0002  Network Boot  FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9e09e6fd-4e16-6468-9b78-bdaeaf609cff)$.I.B.T...
    Boot0003* UEFI IPv4: Intel I210 Network 00 at Baseboard /Pci(0x1d,0x2)/Pci(0x0,0x0)/MAC(a4bf01203a82,0)/IPv4(0.0.0.00.0.0.0,0,0)N.....YM....R,Y.
    Boot0004* UEFI IPv6: Intel I210 Network 00 at Baseboard /Pci(0x1d,0x3)/Pci(0x0,0x0)/MAC(a4bf01203a83,0)/IPv6([::]:<->[::]:,0,0)N.....YM....R,Y.
    Boot0005* Launch EFI Shell      FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)
    Boot0006* UEFI IPv4: Intel I210 Network 00 at Baseboard 2       /Pci(0x1d,0x3)/Pci(0x0,0x0)/MAC(a4bf01203a83,0)/IPv4(0.0.0.00.0.0.0,0,0)N.....YM....R,Y.
    Boot0007* UEFI IPv6: Intel I210 Network 00 at Baseboard 2       /Pci(0x1d,0x2)/Pci(0x0,0x0)/MAC(a4bf01203a82,0)/IPv6([::]:<->[::]:,0,0)N.....YM....R,Y.
    Boot0008* centos        HD(1,GPT,594ae280-8e22-4d8a-bf7e-089a97442db5,0x800,0xff800)/File(\EFI\centos\grubx64.efi)
    Boot0009* centos7_64 (GRUB) (first drive nvme0n1)       HD(1,GPT,594ae280-8e22-4d8a-bf7e-089a97442db5,0x800,0xff800)/File(\EFI\centos\grubx64.efi)
    
    
    Still booting to \EFI\centos\grubx64.efi

    1568640441346.png
     
    • Informative Informative x 1
  8. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    so with missing /boot/efi/EFI/centos/grub.cfg, did the mainline kernel successfully reboot the OVH NVMe server while still looking for \EFI\centos\grubx64.efi ?
     
  9. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    Yep
     
    • Like Like x 1
  10. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Interesting thanks Matt for all this info, so something has changed in OVH CentOS 7 templates to allow NVMe setups to boot properly without /boot/efi/EFI/centos/grub.cfg
     
  11. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    It looks that way yeah, which is a good thing considering the rollout of NVMe on all their offerings.

    The only real difference in the one I have which doesn't even reference the HD but that's an AMD server, so not sure if that's different with the motherboard compared to the Intel ones.
     
    • Informative Informative x 1
  12. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Interesting, goes against everything I have read that UEFI booting NVMe boot devices need working /boot/efi/EFI/centos/grub.cfg to boot properly - but then it also doesn't explain why the initial CentOS 7 install boots without /boot/efi/EFI/centos/grub.cfg ? Or could that be because initial boot on OVH CentOS 7 images goes to that IP4 Intel NIC boot device ?

    FYI, for OVH NVMe + UEFI boot bios setups I have updated centmin mod 123.09beta01 to automatically generate if /boot/efi/EFI/centos/grub.cfg is missing Beta Branch - update grub_efi_fix for OVH detected servers in 123.09beta01 which would be detected when you run centmin.sh

    So will be interesting to see after centmin.sh run, on your next linux mainline kernel yum update without regenerating /boot/grub2/grub.cfg or /boot/efi/EFI/centos/grub.cfg, what a server reboot would boot to which linux kernel version - updated yum kernel (/boot/grub2/grub.cfg) or previously generated one (/boot/efi/EFI/centos/grub.cfg)
     
    Last edited: Sep 17, 2019
    • Like Like x 2
  13. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    FYI, for my DigitalOcean 1-Click APP marketplace preparation work for Centmin Mod preinstalled CentOS 7 image DigitalOcean - DigitalOcean Marketplace For 1 Click Applications, I also thought about installing ELREPO linux mainline kernels by default and as such for these Centmin Mod installs prepared a kernel-update.sh script which gets a prompt at centmin.sh menu 24 exit if there's yum updates, to also run kernel-update.sh for linux mainline kernel updates which can now also detect if UEFI/NVMe is setup on CentOS 7 - not needed for DigitalOcean VPSes but I also use this kernel-update.sh script for other servers I have setup with CentOS 7 and linux mainline kernel updates. You can see kernel-update.sh at centminmod/centminmod-digitalocean-marketplace. So kernel-update.sh might be useful on OVH NVMe UEFI setups when generated /boot/efi/EFI/centos/grub.cfg is the one that takes priority over /boot/grub2/grub.cfg if both exist to ensure ELREPO yum updated linux mainline kernel reboots to the proper updated kernel version
     
    • Informative Informative x 1
  14. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    I've got a month left on my existing server before I plan to switch my site over to the new one, so I'll keep testing and let you know what happens on the next kernel update
     
    • Like Like x 1
  15. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    Updated to 7.7 just now, and the files have all been updated following the new kernel release
    Screenshot_20190918-074537_Termius.jpg
     
    • Informative Informative x 1
  16. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    nice, so /boot/efi/EFI/centos/grub.cfg was generated by you ? hard to tell from color scheme for your ssh client if symlink to grub2-efi.cfg is broken or working ?
     
  17. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    I manually created it yesterday, but the file was correctly updated this morning during the update.

    It's correctly working, it flashes red when it's a broken symlink
     
    • Informative Informative x 1
  18. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Ah good to know. Thanks Matt for sharing your findings :D
     
  19. Matt

    Matt Moderator Staff Member

    848
    372
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +579
    Local Time:
    2:46 AM
    1.5.15
    MariaDB 10.2
    EDIT on the above, actually, I didn't manually create it, I was looking at the command history.

    Code:
        3  [18.09.19] 06:55:03   ls -al grub*
        4  [18.09.19] 06:55:03   ls -al grub2*
       21  [18.09.19] 06:55:03   sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
       22  [18.09.19] 06:55:03   grub2-set-default 0
       23  [18.09.19] 06:55:03   grub2-mkconfig -o /boot/grub2/grub.cfg
    That was me setting up the mainline kernel, I didn't create /boot/efi/EFI/centos/grub.cfg
     
    • Informative Informative x 1
  20. eva2000

    eva2000 Administrator Staff Member

    41,648
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    11:46 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    oh if you ran centmin mod 123.09beta01's centmin.sh it would of automatically generated /boot/efi/EFI/centos/grub.cfg if centmin.sh detects, OVH server with NVMe on /boot/efi boot mount with UEFI bios/kernel loaded from linuxefi instead of linux16 etc

    from
    you can check when you last ran centmin.sh as each run is logged in date timestamp at /etc/centminmod-versionlog

    i.e.
    Code (Text):
    tail -5 /etc/centminmod-versionlog   
    123.09beta01.b267 #Thu Sep 12 02:21:01 UTC 2019
    123.09beta01.b267 #Thu Sep 12 02:45:25 UTC 2019
    123.09beta01.b270 #Sat Sep 14 22:40:16 UTC 2019
    123.09beta01.b271 #Mon Sep 16 00:13:01 UTC 2019
    123.09beta01.b271 #Mon Sep 16 00:16:24 UTC 2019