I was having a perfectly working installation of an Ubuntu 24.04 on a Lenovo laptop.
I tried to make it dual-boot with Win11 (same hard-drive, no external hard-drives involved in any part of the below process).
I resized the home partition to have some empty space for Win11 using a live-USB-drive of Ubuntu 24.04. I then created a flash-USB with Win11 and proceeded to install it on the empty space.
This worked fine, Win11 started up.
When I wanted to restart in order to access the Ubuntu distribution, disaster.
grub> terminal waiting for a command and on top of it the message: Minimal BASH-like editing is supported. For the first word ....
I tried searching for the internet for what I did wrong. The youtube tutorial for installing dual-boot (Win alongside an existing Linux install) I was following simply logged-in into its Linux distro. I cannot do it.
What I tried
I tried to change the boot order inside BIOS, to no avail.
I tried to use in a live-session of Ubuntu 24.04 (using an USB-flash-drive with the Ubuntu 24.04 iso) the boot-repair utility, but that produced NO recommended actions. The pastebin I got is: https://paste.ubuntu.com/p/cwfQCXCHNt/
And copied here:
boot-repair-4ppa2081 [20241023_2114]
============================== Boot Info Summary ===============================
=> No boot loader is installed in the MBR of /dev/nvme0n1.
sda: ___________________________________________________________________________
File system: iso9660
Boot sector type: Grub2 (v1.99-2.00)
Boot sector info: Grub2 (v1.99-2.00) is installed in the boot sector of
sda and looks at sector 0 of the same hard drive for
core.img, but core.img can not be found at this
location.
Mounting failed: mount: /mnt/BootInfo/FD/sda: /dev/sda already mounted or mount point busy.
dmesg(1) may have more information after failed mount system call.
================================ 0 OS detected =================================
================================ Host/Hardware =================================
CPU architecture: 64-bit
Video: AD107M [GeForce RTX 4060 Max-Q / Mobile] Phoenix3 from NVIDIA Corporation Advanced Micro Devices, Inc. [AMD/ATI]
Live-session OS is Ubuntu 64-bit (Ubuntu 24.04.1 LTS, noble, x86_64)
===================================== UEFI =====================================
BIOS/UEFI firmware: NRCN15WW(1.15) from LENOVO
The firmware is EFI-compatible, and is set in EFI-mode for this live-session.
SecureBoot disabled (confirmed by mokutil).
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0004,0002,0006,2002,2001,2003
Boot0000* EFI PXE 0 for IPv4 (40-C2-BA-45-61-F6) PciRoot(0x0)/Pci(0x2,0x1)/Pci(0x0,0x0)/MAC(40c2ba4561f6,0)/IPv4(0.0.0.00.0.0.0,0,0)RC
Boot0001* EFI PXE 0 for IPv6 (40-C2-BA-45-61-F6) PciRoot(0x0)/Pci(0x2,0x1)/Pci(0x0,0x0)/MAC(40c2ba4561f6,0)/IPv6([::]:<->[::]:,0,0)RC
Boot0002* Windows Boot Manager HD(1,GPT,ccbef867-5269-4962-b764-8316a27b12a2,0x800,0x219800)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC
Boot0003* EFI USB Device (VendorCoProductCode) UsbWwid(ffff,5678,0,9207057C0849452056)/HD(2,GPT,eed3de8a-acd3-4541-ba17-9014c007d874,0xb8b5a0,0x27a0)RC
Boot0004* ubuntu HD(1,GPT,ccbef867-5269-4962-b764-8316a27b12a2,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䥗䑎坏S)
Boot0006* ubuntu HD(1,GPT,ccbef867-5269-4962-b764-8316a27b12a2,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi)
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
Partitions info (1/3): _________________________________________________________
Partitions info (2/3): _________________________________________________________
Partitions info (3/3): _________________________________________________________
fdisk -l (filtered): ___________________________________________________________
Disk nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk identifier: 4BA87BBF-AF82-48D5-858E-77C9EF5334FE
Start End Sectors Size Type
nvme0n1p1 2048 2203647 2201600 1G EFI System
nvme0n1p2 2203648 1065248767 1063045120 506.9G Linux filesystem
nvme0n1p3 1065248768 1065281535 32768 16M Microsoft reserved
nvme0n1p4 1065281536 1999087615 933806080 445.3G Microsoft basic data
nvme0n1p5 1999087616 2000406527 1318912 644M Windows recovery environment
Disk sda: 7.54 GiB, 8095006720 bytes, 15810560 sectors
Disk identifier: EED3DE8A-ACD3-4541-BA15-9014C007D874
Start End Sectors Size Type
sda1 64 12105119 12105056 5.8G Microsoft basic data
sda2 12105120 12115263 10144 5M EFI System
sda3 12115264 12115863 600 300K Microsoft basic data
sda4 12115968 15808511 3692544 1.8G Linux filesystem
parted -lm (filtered): _________________________________________________________
sda:8095MB:scsi:512:512:gpt:VendorCo ProductCode:;
1:32.8kB:6198MB:6198MB::ISO9660:hidden, msftdata;
2:6198MB:6203MB:5194kB::Appended2:boot, esp;
3:6203MB:6203MB:307kB::Gap1:hidden, msftdata;
4:6203MB:8094MB:1891MB:ext4::;
nvme0n1:1024GB:nvme:512:512:gpt:KXG80ZNV1T02 LS KIOXIA:;
1:1049kB:1128MB:1127MB:fat32::boot, esp;
2:1128MB:545GB:544GB:ext4::;
3:545GB:545GB:16.8MB::Microsoft reserved partition:msftres, no_automount;
4:545GB:1024GB:478GB:ntfs:Basic data partition:msftdata, no_automount;
5:1024GB:1024GB:675MB:ntfs::hidden, diag, no_automount;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda iso9660 2024-08-27-16-23-26-00 Ubuntu 24.04.1 LTS amd64
├─sda1 iso9660 2024-08-27-16-23-26-00 eed3de8a-acd3-4541-ba14-9014c007d874 Ubuntu 24.04.1 LTS amd64 ISO9660
├─sda2 vfat 3C53-CAEB eed3de8a-acd3-4541-ba17-9014c007d874 ESP Appended2
├─sda3 eed3de8a-acd3-4541-ba16-9014c007d874 Gap1
└─sda4 ext4 17871899-7ba7-4a70-95ec-874805d8fbbd 3ff734fd-1ef9-4328-bcc2-160d58e7cde3 writable
nvme0n1
Mount points (filtered): _______________________________________________________
Avail Use% Mounted on
/dev/sda1 0 100% /cdrom
efivarfs 30.6K 76% /sys/firmware/efi/efivars
Mount options (filtered): ______________________________________________________
/dev/sda1 iso9660 ro,noatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would not act on the boot.
I cannot mount (using $ sudo mount ...) any nvme0* partition listed (in a live Ubuntu 24.04 session) with $ sudo fdisk -l. When I write: $ mkdir -p foo && sudo mount /dev/nvme0n1p2 foo/, I get the following error:
mount: /home/ubuntu/foo: special device /dev/nvme0n1p2 does not exist.
Inside the Win11 install, I went to see if Fast-Startup is enabled, and it is ENABLED, and I turned it OFF. However, as I installed Win11 AFTER having Ubuntu 24.04 working, I understand this makes no difference whatsoever. Tested in practice, the Ubuntu 24.04 installation still does not load and the $grub> ... command-line appears.
Inside the Win11 install, I opened the Win cmd and wrote:
$ bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi and later,
$ bcdedit /set "{bootmgr}" path \EFI\ubuntu\shimx64.efi, both produced the output: operation completed successfully, but they create in the (windows?)-grub no Ubuntu entry, but only in the BIOS-grub two Ubuntu entries, both of them showing the grub> ... black-screen-of-death output when accessed ... The (windows?)-grub does show Windows11, but that's it, no Ubuntu at all.
I am lost and I do not know how to proceed. Do you see any way forward? Thank you very much!
EDIT: W.r.t. duplicate question: the answers there assume one can mount partitions, I cannot do that -- see above the error message I get. Also, they suggest using the utility, I did that, and I got no useful commands to type in the live-terminal. So it's very much a different situation.
EDIT WITH NEW INFO:
The output of $ sudo parted -l in a live Ubuntu 24.04 session is:
Model: VendorCo ProductCode (scsi)
Disk /dev/sda: 8095MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 32.8kB 6198MB 6198MB ISO9660 hidden, msftdata
2 6198MB 6203MB 5194kB Appended2 boot, esp
3 6203MB 6203MB 307kB Gap1 hidden, msftdata
4 6203MB 8094MB 1891MB ext4
Error: The primary GPT table is corrupt, but the backup appears OK, so that will
be used.
OK/Cancel?
I type OK and press enter
Model: KXG80ZNV1T02 LS KIOXIA (nvme)
Disk /dev/nvme0n1: 1024GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 1128MB 1127MB fat32 boot, esp
2 1128MB 545GB 544GB ext4
3 545GB 545GB 16.8MB Microsoft reserved partition msftres, no_automount
4 545GB 1024GB 478GB ntfs Basic data partition msftdata, no_automount
5 1024GB 1024GB 675MB ntfs hidden, diag, no_automount
LATER EDIT: I have now clean-installed Win11 from scratch, deleting all the partitions I previously had. I will then later try to install dual-boot Ubuntu 24.04. So I abandoned trying to save what I had as a working Ubuntu 24.04 installation.
Thus, this question is no longer relevant for me, but if anyone fancies answering it, I leave it as it is.