Happy holidays. This is our final challenge of the year.
You reboot the main application server after a kernel update. Instead of a clean menu, the screen drops you into this:
grub>
No kernel list. No countdown. No safety net. The GRUB configuration is gone or corrupted, and production is waiting.
You cannot reinstall the OS. The data matters. The clock is ticking.
Your task is to manually guide the system from the grub> prompt all the way into a running Linux system so you can repair it properly.
At the GRUB prompt, you are not in Linux. You are talking directly to the bootloader. Different rules apply.
(hd0,msdos1).You have identified the boot partition as (hd0,msdos1). To recover the system, you must issue the correct commands in the correct order.
linux command, including the required argument that tells the kernel where the root filesystem lives?initramfs so the kernel can actually access disks?grub.cfg so the next reboot works normally?If you can recover a system from this prompt, you earn serious sysadmin credibility. Let’s see how you’d bring it back.
I'll take a crack at this!
#1) We will need to use the linux command available from the normal module and direct to our vmlinuz <kernel-version>, in addition we should include our root filesystem location. It's important to pass the ro parameter so it's initially booted in read-only. This looks something like:
linux /boot/vmlinuz-<x.x.x> root=(hd0/msdos1) ro
#2) initrd : Initial ram disk, this is how we will load the additional drivers needed to run the kernel on our hardware.
initrd /boot/initramfs.image
#3) boot : With our configuration prepared, the system should allow to boot normally. We should be able to simply invoke this command and begin startup into the appropriate run-level.
#4) grub-mkconfig : This is the utility that we can use to restore the grub configuration on our machine, right?
Maybe off-base just a little bit here, would appreciate any further correction or insight of course!
Its really critical issue.
at first Lists all disks and check which partition has /boot and here is (hd0,msdos1)
grub> ls
grub> ls (hd0,msdos1)/
Look for boot/ folder and List kernels and initramfs and find kernel (vmlinuz-*) and RAM disk (initrd.img-*) filenames.
grub> ls (hd0,msdos1)/boot/
then load the kernel
grub> linux (hd0,msdos1)/boot/vmlinuz-<version> root=/dev/sda1 ro
and replace <version> with your actual kernel filename.
root= points to your root filesystem partition.
ro = mount root read-only initially.
Load the initramfs then boot
grub> initrd (hd0,msdos1)/boot/initrd.img-<version>
grub> boot
here the system should start normally.
Finally fix GRUB for next boot
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.