Minimal BASH like line editing is supported. Boot error on Fedora
You can get back fedora.
I encountered this issue on my laptop computer each time when the grub2-efi package updated/reinstalled (including system upgraded to next release). It will caused grub2 boot into some kinds of rescue mode like yours.
The grub2-efi package from Fedora seems can't install correctly on my laptop (ASUS TX300, Fedora x86_64, version 18 to 23).
Manual boot
You can boot Fedora manually from this grub2 rescue mode, then fix this issue by reinstalling grub2 to disk. To do it:
Use
ls
command to list all partitions-
Use
linuxefi
(for EFI) orlinux16
(for BIOS) command to specify the linux kernel file, and then specify the root patition usingroot=
parameter, like:-
root=/dev/sdXN
if your root partition is a simple partition - or
root=/dev/mapper/THE_ROOT_LOGICAL_VOLUME
if your root partition is a LVM logical volume - or
root=/dev/mdN
if your root partition is a RAID array - or
root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
- though this is a universal form, since the UUID string is long, it's the easiest to mistype.
Example one:
linuxefi (hd2,gpt6)/vmlinuz-4.4.2-300.fc23.x86_64 root=/dev/sda8
.
Example two:linux16 (hd0,msdos1)/vmlinuz-4.4.2-300.fc23.x86_64 root=/dev/mapper/fedora-root
You can use TAB to auto-complete the
vmlinuz
part. -
-
Use
initrdefi
(for EFI) orinitrd16
(for BIOS) command to specify the initial ramdisk file.Example one:
initrdefi (hd2,gpt6)/initramfs-4.4.2-300.fc23.x86_64.img
Example two:initrd16 (hd0,msdos1)/initramfs-4.4.2-300.fc23.x86_64.img
Type
boot
to boot Fedora, this will bring your Fedora alive.Finally, fix
grub2-install
issue by specifying--target x86_64-efi
parameter ingrub2-install
command
Example:grub2-install --target x86_64-efi
Then, reboot to see if this issue is fixed.
Don't forget to repeat step 5 when grub2-efi
package updated/reinstalled next time
Other information
I still can't figure out why this happened on my laptop, while it works fine on my desktop machine (EFI, x86_64). Maybe it's related to the MicroSD/TF card, but I'm not sure. When TF card is in the internal card reader, it often caused the block device name not fixed: sometimes it's /dev/sdb
(HDD is /dev/sdc
, SSD is /de/sda
), sometimes it's /dev/sdc
(HDD is /dev/sdb
, SSD is /de/sda
).
A little deeper analysis shows that /boot/efi/EFI/fedora/grubx64.efi
file does not contain root (partition) information. In the following hexdump (copied from hexedit actually) of /boot/efi/EFI/fedora/grubx64.efi
file, "(,gpt6)/grub2" string in 0001D2B0
line does not exists when grub2-efi package updated/reinstalled.
0001D290 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................
0001D2A0 00 00 00 00 00 00 00 00 03 00 00 00 18 00 00 00 ................
0001D2B0 28 2C 67 70 74 36 29 2F 67 72 75 62 32 00 00 00 (,gpt6)/grub2...
0001D2C0 01 00 00 00 00 00 5A 5B 5D C3 41 56 41 55 41 54 ......Z[].AVAUAT
0001D2D0 55 48 89 F5 53 49 89 FC 48 8B 76 08 FF 55 00 85 UH..SI..H.v..U..
0001D2E0 C0 BB 01 00 00 00 0F 85 BC 00 00 00 4C 89 E7 89 ........L...L...
Related videos on Youtube
mayautobot
Updated on September 18, 2022Comments
-
mayautobot over 1 year
I am using fedora 22 and windows 8 on my laptop. Recently I updated fedora using
yum update
command. When I restarted fedora, boot menu is not coming. Instead a black screen is coming with following message:Minimal BASH like line editing is supported. For the first word, TAB lists possible command completions. anywhere else TAB lists possible device or file completions.
Can I get back fedora or I have to reinstall it.
-
Admin over 8 yearsDoes your machine use EFI?
-
Admin over 8 yearsYes, my system uses UEFI.
-
Admin over 8 yearsI encountered same issue each time I updated/reinstalled grub2-efi package or reinstalled grub2-efi via
grub2-install
command
-
-
mattdm over 8 yearsOuch. Thanks for the analysis. Have you filed a bug for this?
-
mayautobot over 8 yearsI followed your @LiuYan instructions, but I am stuck on step2. I ran following commands:
grub> ls (lvm/fedora-root) (lvm/fedora-home) (lvm/fedora-swap) (hd0) (hd0, gpt12) (hd0, gpt12) (hd0, gpt11) (hd0, gpt10) (hd0, gpt9) (hd0, gpt8) (hd0, gpt7) (hd0, gpt6) (hd0, gpt5) (hd0, gpt4) (hd0, gpt3) (hd0, gpt2) (hd0, gpt1) (cd0) error: failure reading sector 0x0 from 'cd0' grub> ls (hd0,gpt1) (hd0,gpt1): Filesystem is unknown grub> echo $root hd0, gpt2
-
LiuYan εη over 8 years@mayautobot, you're listing
(hd0,gpt1)/
, but your $root said it's(hd0,gpt2)/
, you need to check which partition is your/boot
partition, if there's no dedicated/boot
partition, it may be just a directory in(lvm/fedora-root)
. -
LiuYan εη over 8 years@mattdm, I haven't file a bug yet, I'll file it now. One reason I haven't file it is I can't 100% reproduce this issue -- it works ok on my another PC machine, another reason is I'm focusing on other bugs now (can't suspend laptop in 1 shot, i must suspend twice to actually suspend it. this issue started from kernel 4.0 to kernel 4.1.3, kernel 4.1.4-200.fc22 fixed this, but after upgraded to fedora 23, it occurs again).
-
LiuYan εη over 8 years@mattdm, bug filed. https://bugzilla.redhat.com/show_bug.cgi?id=1298127
-
Shadab Faiz almost 6 yearswhat worked for was set root=(hd0,gpt2), set prefix=(hd0,gpt8)/grub2, insmod normal, normal. But everytime i reboot i have to do this task.