1

I tried to dual boot windows to my 20.04 ubuntu machine. After successfully installing windows I found I can no longer access ubuntu.

The state right now:

  • I enter the bios and choose the ubuntu boot.
  • After choosing ubuntu the grub2 command line is prompted.
  • If I run grub> exit I exit the grub and the windows os is loaded.
  • after roaming the internet I found that there is a way to boot through the grub2.
  • if I run the suggested command :
grunb> set root=(hd1,msdos5)
grunb> linux /boot/vmlinuz-5.13.0-39-generic root=/dev/nvme1n1p5 ro
grunb> initrd /boot/inintrd.img-5.13.0-39-generic
grunb> boot
  • Next, it seems like ubuntu start to load but got stuck at (initramfs) and there are some notable error lines before:
Begin: running /script/int-bottom ... mount: mounting /dev on /root/dev
Mounting: mounting /dev on /root/dev failed: no such file or directory
done.
Mounting: mounting /dev on /root/dev failed: no such file or directory
run-init: can't execute '/sbin/init': no such file or directory
target filesystem dosen't have requested /sbin/init
run-init: can't execute '/sbin/init': no such file or directory
run-init: can't execute '/etc/init': no such file or directory
run-init: can't execute '/bin/init': no such file or directory
run-init: can't execute '/bin/sh': no such file or directory
run-init: can't execute '': no such file or directory
No init found. Try passing init= bootarg

(initramfs)

More data:

  • Even before I added windows, ubuntu will first load the grub command line, and then I would have to enter grub>exit to enter ubuntu.
  • I use a new m.2 512GB disk for the windows installation.
  • I can view all of my files and directory of the Ubuntu partition using the Grub ls command.
  • Some grub> ls command ouput:
Grub> ls
(proc) (hd0) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,msdos5) (hd1,msdos1)

Grub> ls (hd1,msdos5)/ lost+found/ boot/ swampfile etc/ media/ var/ bin dev/ home/ lib lib32 lib64 libx32 mnt/ opt/ proc/ root/ run/ sbin snap/ srv/ sys/ tmp/ usr/ cdrom/ -(My ubuntu partition)

Grub> ls (hd0,gpt2)/ efi/

Grub> ls (hd0,gpt4)/ /Program File /Program File (x86) ...

  • (My Windows partition...)

Grub> ls (hd1,msdos1)/ efi/ System Volume Information/ $recycle.bin/ Recovery

  • (ubuntu efi boot?)

Grub ls (hd1,msdos1)/efi/ ubuntu/ boot/

  • Some grub> set command ouput:
Grub> set
cmdpath=(hd1,msdos1)/EFI/UBUNTU
grub_cpu=x86_64
grub_platform=efi
lang=
locale_dir=
prefix=(hd1,msdos1)/boot/grub
root=hd1,msdos1

some failed methods:

  • I tried to boot Linux on live cd and update the grub
  • I tried to use boot-repair
  • I tried to add those lines to the grub:
Grub> set prefix=(hd1,msdos5)/boor/grub
Grub> insmod normal
Grub> normal
  • I tried to change the root folder of the linux command to root=/dev/sda1 ro. As far as I understand I should use the nvme1n1p5 as my disks are m.2 type.
  • I have seen somewhere that you can't dual boot legacy bios with UEFI and that I should change this setting in the bios. but all the relevant options were on "legacy bios only"

So, this is my last painful experience with dual booting. I hope I have been clear enough. If you need any other information please tell me. And of course, thank you very much for the will to help me :)

update:

After reading the boot-repair report: https://paste.ubuntu.com/p/VG5skMbhVk/ I realize that in the second line of the Grub I should have written nvme0n1p5 instead of nvme1n1p5, Currently, I'm successfully booted into my ubuntu.

Right now I am not sure how to update my grub. My end goal would be that when powering the computer I'll be prompt with a grub menu with ubuntu and windows.

  • UEFI or BIOS installs? Both must be the same. And if UEFI, you need gpt not msdos. Windows only installs in UEFI mode to gpt and only in BIOS boo tmode to MBR(msdos). But Ubuntu will install either UEFI or BIOS to either MBR or gpt. Please copy & paste the pastebin link to the Bootinfo summary report ( do not post report), do not run the auto fix till reviewed.Lets see details, use ppa version with your USB installer (2nd option) or any working install, not Boot-Repair ISO https://help.ubuntu.com/community/Boot-Repair – oldfred Apr 12 '22 at 02:55
  • Well, I already run the auto-fix of the default version of the boot repair... this is the report URL: https://paste.ubuntu.com/p/VG5skMbhVk/ should I do it again with the PPA version and without using the auto-fix? – Bel Garat Apr 12 '22 at 10:29
  • Oh, it's a little bit embarrassing... I just have read the report for the first time and I noticed that I should write nvme0n1p5 instead of nvme1n1p5. I just did it and now I am writing from my ubuntu. BTW how do I update the grub? I guess I should just do Grub-update but I am afraid to break this stuff again... And as I mentioned I didn't have the grub menu even before dual booting... – Bel Garat Apr 12 '22 at 10:43
  • You have mixed BIOS boot Ubuntu with UEFI boot Windows. Grub can only dual boot if in same boot mode. And better to have all drives as gpt. If redoing Ubuntu drive to gpt that will erase it, so best to have good backups. How you boot install & repair media is then how it installs or repairs. Your report shows UEFI boot. https://askubuntu.com/questions/629470/gpt-vs-mbr-why-not-mbr – oldfred Apr 12 '22 at 13:37

0 Answers0