Win + Ubuntu on M2 SSD. By default it would boot into Ubuntu, if F11 (bios' boot menu) press right after PC turn on then it would ask me where to boot (Win or Ubuntu). All fine.
Then I temporarily installed an additional SSD, just for the sake of installing an Ubuntu on it. After completing this installation I removed this additional SSD. Now I can still go to boot menu with F11, and booting into Win works, but the Ubuntu doesn't load anymore.
I got presented with the GRUB terminal. I determined that:
- on (hd4,gpt1)/efi/, I have there /Ubuntu and /Boot folders, among a third one that I don't remember the name right now.
- my Ubuntu install is on (hd4,gpt5)
- under Windows Disk Management I can see, that my Ubuntu install is on the 3rd partition, which would mean /dev/sda2 (it is zero-indexed isn't it?)
After a lot of trial and error, it looks like to me that these commands lead to the most promising results:
set root=(hd4,gpt5)
linux (hd4,gpt5)/boot/vmlinuz-5.15.0-18-generic root=/dev/nvme0n1p5
initrd (hd4,gpt5)/boot/initrd.img-5.15.0-18-generic
boot
After triggering that boot command, it writes in the GRUB console:
You are in emergency mode. After loggin in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" or "exit" to boot in to default mode.
Press Enter for maintenance.
(or press Control=D to continue):
After that, I can get logged in as root and put into /snap
directory or it writes:
Reloading system manager configuration
Starting default target
Failed to start default target: Transaction for graphical.target/start is destructive (emergency.target has 'start' job queued, but 'stop' is included in the transaction
Under (hd4,gpt5)/boot/
directory, there are many different vmlinuz
and initrd
files, but to date, all of them yield the same result (except once it loaded the graphical environment and I was able to log in and also use the computer normally for like 2 minutes, then suddenly it dropped to a shell again).
How can I fix this?