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:

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

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.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s