Welcome to Centmin Mod Community
Become a Member

Sysadmin Grub Help?

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

  1. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    I just upgraded to centos 7.4 and not the server hangs on the grub command and won't boot. Anyone good at working with Grub or know how to get my system working again?

    If this thread is in the wrong forum, please move it.

    Thanks!
     
  2. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
  3. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    This is what the doc uses

    Code:
    grub> set root=(hd0,1)
    grub> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
    grub> initrd /boot/initrd.img-3.13.0-29-generic
    grub> boot
    I got the first line:
    Code:
    grub> set root=(md/md2)
    Not sure about the second line. All my files are on (md/md2) so not sure if I would need root again???
    Code:
    grub> linux /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64 root=????
    Third line: don't see any initrd on the list? I only see initramfs. Would the line be:
    Code:
    grub> initramfs /boot/initramfs-3.10.0-514.26.2.el7.x86_64.img
     
  4. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    Entering linux to start the second line gives me an error: "can't find the command 'linux'"
     
  5. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    What ended up working:

    Code:
    grub> set prefix=(md/md2)/boot/grub2
    grub> set root=(md/md2)
    grub> insmod linux
    grub> normal
    Once the system restarted I ran:
    Code:
    grub2-mkconfig
    Haven't rebooted yet, so not sure if the make config command works.
     
  6. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    So, I rebooted and still getting the grub prompt.

    I guess grub2-mkconfig didn't work.

    Any ideas? How to get the grub to work on boot?
     
  7. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
  8. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    2:26 PM
    Nginx 1.13.x
    MariaDB 5.5
    what type of server ? virtualisation ? which web host ?

    got access to out of band console/kvm console ? using distro default kernel or custom kernels ?
     
  9. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    This is on my dedicated server at OVH.

    Using default kernel. Yea, I have IPMI access.

    I can get system booted with the hack above from Grub. Can't seem to get the grub to update or don't know what I need to do to get the grub working again. Always boots to the grub prompt.
     
    • Informative Informative x 1
  10. pamamolf

    pamamolf Well-Known Member

    2,670
    240
    63
    May 31, 2014
    Ratings:
    +425
    Local Time:
    7:26 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Isn't there a way to log the kernel issue to a log file on the system so you can check what the issue is?
     
  11. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    I'm not super savvy with the grub stuff, but I think it's something in the grub config that's the issue. I don't think anything will log if the grub prompt is as far as the system gets booting. I could be totally wrong though.
     
  12. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    2:26 PM
    Nginx 1.13.x
    MariaDB 5.5
    output for
    Code (Text):
    awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
    
     
  13. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    Code:
    # awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
    CentOS Linux (3.10.0-693.2.2.el7.x86_64) 7 (Core)
    CentOS Linux (3.10.0-514.26.2.el7.x86_64) 7 (Core)
    CentOS Linux (3.10.0-514.26.1.el7.x86_64) 7 (Core)
    CentOS Linux (3.10.0-514.21.2.el7.x86_64) 7 (Core)
    CentOS Linux (3.10.0-514.21.1.el7.x86_64) 7 (Core)
    CentOS Linux (0-rescue-1e98a4cc1263468b9f9a12e365316b95) 7 (Core)
     
  14. pamamolf

    pamamolf Well-Known Member

    2,670
    240
    63
    May 31, 2014
    Ratings:
    +425
    Local Time:
    7:26 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Some related info:

    HowTos/Grub2 - CentOS Wiki

    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    I think that should rebuild and fix your issue....
     
  15. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    2:26 PM
    Nginx 1.13.x
    MariaDB 5.5
    Updated my OVH server fine
    Code (Text):
    uname -r
    3.10.0-693.2.2.el7.x86_64
    

    @Jimmy what's output for
    Code (Text):
    grub2-set-default 0
    grub2-mkconfig -o /boot/grub2/grub.cfg
    

    that should rebuild and then do reboot
     
  16. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
  17. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    Code:
    # grub2-set-default 0
    # grub2-mkconfig -o /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-693.2.2.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-514.26.2.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-514.26.2.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-514.26.1.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-514.26.1.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-514.21.2.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-514.21.2.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-514.21.1.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-514.21.1.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-1e98a4cc1263468b9f9a12e365316b95
    Found initrd image: /boot/initramfs-0-rescue-1e98a4cc1263468b9f9a12e365316b95.img
    done
    I'll try the reboot now.
     
  18. eva2000

    eva2000 Administrator Staff Member

    29,720
    6,711
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,015
    Local Time:
    2:26 PM
    Nginx 1.13.x
    MariaDB 5.5
    try rebooting now
     
  19. Jimmy

    Jimmy Premium Member Premium Member

    1,081
    242
    63
    Oct 24, 2015
    East Coast USA
    Ratings:
    +579
    Local Time:
    12:26 AM
    1.13.x
    MariaDB 10.1.x
    Nope. Grub command prompt.
     
  20. RoldanLT

    RoldanLT Well-Known Member

    3,875
    946
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,290
    Local Time:
    12:26 PM
    1.11
    10.2
    Yay so many issues with CentOS 7.4 :/.
     
    • Agree Agree x 1