Score:1

Persistent fix to 'minimal BASH like line editing is supported'

mt flag

Yesterday I updated my OS version from Kubuntu 20.04 to 22.04, Unfortunately it came with a slew of problems (primarily with Grub 2.06)

Today, I encountered the following error upon booting Grub:

minimal BASH like line editing is supported (...).

Instead of being directed towards the usual graphical interface, I was presented with a CLI, asking me for input. I have, with success, temporarily solved the issue with advice given in on this post at geeksforgeeks.org.

by executing the following commands:

set root=(hd1,gpt2)
set prefix=(hd1,gpt2)/boot/grub
insmod normal
normal

and

sudo grub-install /dev/sdXY (in my case, /boot/efi is located on sdb3)
sudo update-grub

upon booting my OS. However, upon rebooting the problem persists, and I am once again sent to the CLI.

Output from

sudo update-grub

is as follows:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-52-generic
Found initrd image: /boot/initrd.img-5.15.0-52-generic
Found linux image: /boot/vmlinuz-5.4.0-131-generic
Found initrd image: /boot/initrd.img-5.4.0-131-generic
Found linux image: /boot/vmlinuz-5.4.0-56-generic
Found initrd image: /boot/initrd.img-5.4.0-56-generic
Found linux image: /boot/vmlinuz-5.15.0-52-generic
Found initrd image: /boot/initrd.img-5.15.0-52-generic
Found linux image: /boot/vmlinuz-5.4.0-131-generic
Found initrd image: /boot/initrd.img-5.4.0-131-generic
Found linux image: /boot/vmlinuz-5.4.0-56-generic
Found initrd image: /boot/initrd.img-5.4.0-56-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/sdb3@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
Found linux image: /boot/vmlinuz-5.15.0-52-generic
Found initrd image: /boot/initrd.img-5.15.0-52-generic
Found linux image: /boot/vmlinuz-5.4.0-131-generic
Found initrd image: /boot/initrd.img-5.4.0-131-generic
Found linux image: /boot/vmlinuz-5.4.0-56-generic
Found initrd image: /boot/initrd.img-5.4.0-56-generic
Found Windows Boot Manager on /dev/sdb3@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings

Output of grub-install:

Installing for x86_64-efi platform.
Installation finished. No error reported.

Output of df

Filesystem     1K-blocks      Used Available Use% Mounted on
tmpfs            1629800      1972   1627828   1% /run
/dev/sdb2      205377444  77481204 117390824  40% /
tmpfs            8148984       512   8148472   1% /dev/shm
tmpfs               5120         4      5116   1% /run/lock
/dev/sdb3         998480     37892    960588   4% /boot/efi
/dev/sda1      557135192 205411480 323349288  39% /media/User/Linux HDD
tmpfs            1629796        84   1629712   1% /run/user/1000
/dev/sdb4      277079036  24608052 252470984   9% /media/User/Windows_10
/dev/sdc1      976758780 504811472 471947308  52% /media/User/Seagate

Output of fdisk -l

Device     Start        End    Sectors   Size Type
/dev/sda1   2048 1134323711 1134321664 540,9G Linux filesystem

Disk /dev/sdb: 465,76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: CT500MX500SSD1  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 9592ABCA-3C53-4225-B388-FDF8B09DF156

Device         Start       End   Sectors   Size Type
/dev/sdb1       2048     34815     32768    16M Microsoft reserved
/dev/sdb2    1052672 420614143 419561472 200,1G Linux filesystem
/dev/sdb3  420614144 422615039   2000896   977M EFI System
/dev/sdb4  422615040 976773119 554158080 264,2G Microsoft basic data

How do I get past this?

cc flag
With multiple disks, you likely have multiple EFI partitions, so the one you fixed, may not be the one you boot from. Cut and paste the actual grub-install and the output. Include more information like df and the non-loop output of sudo fdisk -l
Kaprice avatar
mt flag
@ubfan1 There's only one EFI partition: on sdb3 for me. In any case, i added the requested outputs in the edit.
cc flag
Track down the disconnect on grub finding its menus. cat the /boot/efi/EFI/ubuntu/grub.cfg file, and compare the UUID there against the UUID of /dev/sdb2 (sudo blkid will list them). They should match. The configfile command then uses the UUID to import the /boot/grub/grub.cfg file for the grub menu -- does it exist?
Kaprice avatar
mt flag
@ubfan1 Thank you! The issue is now solved. The problem indeed seemed to be the fact that /boot/efi/EFI/ubuntu/grub.cfg referenced the wrong partition (it pointed to /dev/sdb1, instead). Through the nano command i edited it to reflect the proper path (UUID and hdx/gptx), and now the GRUB menu loads as intended.
Score:0
cc flag

Track down the disconnect on grub finding its menus. cat the /boot/efi/EFI/ubuntu/grub.cfg file, and compare the UUID there against the UUID of /dev/sdb2 (sudo blkid will list them). They should match. The configfile command then uses the UUID to import the /boot/grub/grub.cfg file for the grub menu -- does it exist?

Score:0
ms flag

If you're using pop os (or potentially other distros) like me, it appears that the partitions configured in /boot/efi/EFI/pop/grub.cfg did not match what i saw when i used echo $prefix and echo $root.

Turns out that GRUB defaults to the bun/boot/efi/EFI/ubuntu/grub.cfg and if it doesn't exist somehow (got deleted or something), it uses some default values.

Short answer is to copy your distro's grub.cfg into the '/boot/efi/EFI/ubuntu/grub.cfg'

See Grub only in shell mode, wrong root and prefix set

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.