Monthly Archives: April 2017

Linux cannot boot, only shows grub prompt

Today, after a reboot, my laptop (Fedora 25) cannot boot and only shows grub prompt. I have no idea what happened or what changes I made to the system.

Here is how I fixed it:

1. use ls command to find the partition that has kernel images,

for example,
ls (hd0,gpt5)

shows something like:
vmlinuz-4.10.5-200.fc25.x86_64
initramfs-4.10.5-200.fc25.x86_64.img

2. select kernel image and boot

(I have UEFI enabled and use lvm partition)

Because of lvm partitionm, I need to specify where the root is. My root partition is mapped as /dev/fedora/root.

set root=(hd0,gpt5)
linuxefi /vmlinuz-4.10.5-200.fc25.x86_64 root=/dev/fedora/root ro
initrdefi /initramfs-4.10.5-200.fc25.x86_64.img
boot

After successfully login, we need regenerate grub.cfg. (for unknown reason, my grub.cfg was an empty file…)

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

That’s all and everything looks good now.

Reference:
[http://www.terminalinflection.com/manual-grub-boot/]