Join the community today
Become a Member

Sysadmin Grub Help?

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

  1. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    10:16 AM
    You should not have to do that every time you reboot. If you do, you didn't do it correctly.

    I've booted my server multiple times.

     
  2. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:16 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    So is it a random issue ?

    I thought that the issue exists on every kernel update and reboot....
     
  3. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    10:16 AM
    It's a one time issue. I did it once, and it hasn't been an issue since.
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,248
    12,117
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,655
    Local Time:
    12:16 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Good to know :) Though I will be canceling my OVH MC-64-OC 7700K @4.7-5.0Ghz 2x450GB NVMe end of month after playing with it as Black Friday discount isn't re-occurring this time :(
     
  5. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:16 PM
    Mainline
    10.2
    I thought the same.
     
  6. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    10:16 AM
    You guys don't understand the root of the problem:
    The reason the server went to the grub prompt is because there was an issue with the grub file (it was missing). The fix puts the grub file back so, since the grub file is back, the server will boot as normal. The server doesn't magically delete the grub file every time the server is rebooted or there is a kernel update.
     
  7. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:16 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    The issue was related to Centos first time image installation or it starts after updating Centos?

    I am trying to figure out if i got a new NVMe server if the latest Centos 7 template from OVH has that issue so i just need to run the above two commands and that's it or if it is something that will come after the first update of a kernel and the first reboot ?
     
  8. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    10:16 AM
    Basically, if you run into the issue, run the command(s) to fix the grub.

    If you want to run the tests and find out when and where it happens, let us know.
     
  9. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:16 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    I thought that you have spot when the issue appear :)

    Ok thank you !
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:16 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Can you please point me to exact location and name of the file that was missing so i can check it after a clean install?

    Thank you !
     
  11. eva2000

    eva2000 Administrator Staff Member

    53,248
    12,117
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,655
    Local Time:
    12:16 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    just did a yum kernel 3.10.0-693.11.1.el7 update on OVH MC-64-OC 7700K with 2x450GB NVMe raid 1 and before reboot checking

    missing /boot/efi/EFI/centos/grub.cfg
    Code (Text):
    ls -lah /boot/efi/EFI/centos/
    total 152K
    drwxr-xr-x. 3 root root 4.0K Nov 27 05:07 .
    drwxr-xr-x. 3 root root 4.0K Nov 27 05:07 ..
    drwxr-xr-x. 2 root root 4.0K Nov 27 05:07 fonts
    -rwxr-xr-x. 1 root root 1.0K Dec 11 06:01 grubenv
    -rwxr-xr-x. 1 root root 135K Nov 27 05:07 grubx64.efi
    

    but grub2-efi-x64 package is meant to provide that file
    Code (Text):
    rpm -ql grub2-efi-x64
    /boot/efi/EFI/centos
    /boot/efi/EFI/centos/fonts
    /boot/efi/EFI/centos/fonts/unicode.pf2
    /boot/efi/EFI/centos/grub.cfg
    /boot/efi/EFI/centos/grubenv
    /boot/efi/EFI/centos/grubx64.efi
    /boot/grub2/grubenv
    /etc/grub2-efi.cfg
    

    Code (Text):
    df -hT
    Filesystem     Type      Size  Used Avail Use% Mounted on
    /dev/md2       ext4      371G  7.7G  345G   3% /
    devtmpfs       devtmpfs   32G  4.0K   32G   1% /dev
    tmpfs          tmpfs      32G     0   32G   0% /dev/shm
    tmpfs          tmpfs      32G  314M   32G   1% /run
    tmpfs          tmpfs      32G     0   32G   0% /sys/fs/cgroup
    /dev/nvme0n1p1 vfat      510M  2.7M  508M   1% /boot/efi
    /dev/md4       ext4       79G   56M   75G   1% /raid0
    tmpfs          tmpfs     6.3G     0  6.3G   0% /run/user/0
    tmpfs          tmpfs      32G  8.0K   32G   1% /tmp
    

    running the solution discussed in this thread
    Code (Text):
    grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-693.11.1.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-693.11.1.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-693.5.2.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-693.5.2.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-a9d4a8570726466ea48f77428123cd7c
    Found initrd image: /boot/initramfs-0-rescue-a9d4a8570726466ea48f77428123cd7c.img
    done
    

    Code (Text):
    locate grub.cfg
    /boot/efi/EFI/centos/grub.cfg
    /boot/grub2/grub.cfg
    

    diff between the 2 files with former being default used for EFI bios based NVMe CentOS 7 systems
    Code (Text):
    diff -u /boot/grub2/grub.cfg /boot/efi/EFI/centos/grub.cfg
    

    diff output https://gist.github.com/centminmod/72fe33469cc12836cad3e7eb7921013f
    rebooting server worked just fine
    Code (Text):
    uname -r
    3.10.0-693.11.1.el7.x86_64
    

    created grub.cfg exists in place where CentOS 7 looks for it for EFI based CentOS 7 systems with NVMe storage
    Code (Text):
    ls -lah /boot/efi/EFI/centos/grub.cfg
    -rwxr-xr-x 1 root root 5.7K Dec 11 06:18 /boot/efi/EFI/centos/grub.cfg
    


    I guess if this is the standard method for CentOS 7 EFI bios based systems and not just for NVMe systems, then I could probably code Centmin Mod initial installs to detect if directory /boot/efi/EFI/centos exists and if /boot/efi/EFI/centos/grub.cfg doesn't exist, then run command
    Code (Text):
    grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
    

    this way the file exists for fresh CentOS 7 EFI bios based systems.

    Also grub2-efi-x64 yum package should provide another file that is missing too
    /etc/grub2-efi.cfg prior to running
    Code (Text):
    grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
    

    but after running that grub2-mkconfig command the /etc/grub2-efi.cfg file exists as a symlink to /boot/efi/EFI/centos/grub.cfg
    Code (Text):
    ls -lah /etc/grub2-efi.cfg
    lrwxrwxrwx. 1 root root 31 Nov 27 05:07 /etc/grub2-efi.cfg -> ../boot/efi/EFI/centos/grub.cfg
    

    hmm does all this apply to CentOS 6.x EFI bios based systems though ?
     
  12. eva2000

    eva2000 Administrator Staff Member

    53,248
    12,117
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,655
    Local Time:
    12:16 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  13. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    5:16 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Just got an NVMe server from OVH and install centminmod / update also kernel and restart with no issues at the moment :)

    Thank you !
     
  14. eva2000

    eva2000 Administrator Staff Member

    53,248
    12,117
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,655
    Local Time:
    12:16 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Great to hear... unfortunately my OVH NVMe server gets canceled this month heh
     
  15. Matt

    Matt Well-Known Member

    925
    414
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +669
    Local Time:
    3:16 PM
    1.5.15
    MariaDB 10.2
    Just been looking into this myself, as all my new servers have NVMe drives, however, aren't provided by OVH.

    Before (file was present)
    Code:
    total 6100
    drwx------. 3 root root    4096 Nov 25 16:27 .
    drwx------. 4 root root    4096 Nov 25 13:20 ..
    -rwx------. 1 root root     134 Aug 31 22:30 BOOT.CSV
    -rwx------. 1 root root     134 Aug 31 22:30 BOOTX64.CSV
    drwx------. 2 root root    4096 Nov 25 13:28 fonts
    -rwx------. 1 root root    5108 Nov 25 16:27 grub.cfg
    -rwx------. 1 root root    1024 Nov 25 13:29 grubenv
    -rwx------. 1 root root 1051520 Oct 21 09:12 grubx64.efi
    -rwx------. 1 root root 1262816 Aug 31 22:30 mmx64.efi
    -rwx------. 1 root root 1296176 Aug 31 22:30 shim.efi
    -rwx------. 1 root root 1297120 Aug 31 22:30 shimx64-centos.efi
    -rwx------. 1 root root 1296176 Aug 31 22:30 shimx64.efi
    
    Update
    Code:
    Installing:
     kernel                             x86_64                             3.10.0-693.11.1.el7                             updates                              43 M
    
    File is still present, and has been updated with the new kernel
    Code:
    total 6100
    drwx------. 3 root root    4096 Dec 28 07:03 .
    drwx------. 4 root root    4096 Nov 25 13:20 ..
    -rwx------. 1 root root     134 Aug 31 22:30 BOOT.CSV
    -rwx------. 1 root root     134 Aug 31 22:30 BOOTX64.CSV
    drwx------. 2 root root    4096 Nov 25 13:28 fonts
    -rwx------. 1 root root    5915 Dec 28 07:03 grub.cfg
    -rwx------. 1 root root    1024 Dec 28 07:03 grubenv
    -rwx------. 1 root root 1051520 Oct 21 09:12 grubx64.efi
    -rwx------. 1 root root 1262816 Aug 31 22:30 mmx64.efi
    -rwx------. 1 root root 1296176 Aug 31 22:30 shim.efi
    -rwx------. 1 root root 1297120 Aug 31 22:30 shimx64-centos.efi
    -rwx------. 1 root root 1296176 Aug 31 22:30 shimx64.efi
    
     
  16. eva2000

    eva2000 Administrator Staff Member

    53,248
    12,117
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,655
    Local Time:
    12:16 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    so issue could be with OVH CentOS 7 images ?
     
  17. Matt

    Matt Well-Known Member

    925
    414
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +669
    Local Time:
    3:16 PM
    1.5.15
    MariaDB 10.2
    It could be, as I know their image certainly isn't standard (I could never even get my old servers to boot from the default CentOS kernel, I always had to use the OVH Network boot).
     
  18. eva2000

    eva2000 Administrator Staff Member

    53,248
    12,117
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,655
    Local Time:
    12:16 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Strange never had problems with my OVH servers kernels myself. Guess folks will get to retest their server reboot procedures with Meltdown and Spectre fixes Intel Processor Flaw 'kernel memory leaking' [Spectre & Meltdown] :)
     
  19. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:16 PM
    Mainline
    10.2
    Thanks again Sir!
    Save me again this time for CentOS 7.6 update issue.
    Same issue with 7.4 before. :banghead:
     
  20. eva2000

    eva2000 Administrator Staff Member

    53,248
    12,117
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,655
    Local Time:
    12:16 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Interesting that it is still a problem for your setup - is it the exact same server too ?