Discover Centmin Mod today
Register Now

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:
    5:20 AM
    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 Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
  3. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    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 Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    Entering linux to start the second line gives me an error: "can't find the command 'linux'"
     
  5. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    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 Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    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 Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
  8. eva2000

    eva2000 Administrator Staff Member

    53,149
    12,110
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,645
    Local Time:
    7:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    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.
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    12:20 PM
    Nginx-1.25.x
    MariaDB 10.3.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 Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    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

    53,149
    12,110
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,645
    Local Time:
    7:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    output for
    Code (Text):
    awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
    
     
  13. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    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 Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    12:20 PM
    Nginx-1.25.x
    MariaDB 10.3.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

    53,149
    12,110
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,645
    Local Time:
    7:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
  17. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    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

    53,149
    12,110
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,645
    Local Time:
    7:20 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    try rebooting now
     
  19. Jimmy

    Jimmy Well-Known Member

    1,778
    388
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +987
    Local Time:
    5:20 AM
    Nope. Grub command prompt.
     
  20. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    5:20 PM
    Mainline
    10.2
    Yay so many issues with CentOS 7.4 :/.