I know this is a very common question but none of the answers I read worked for me so far.
I have two M.2 NVMe SSD. I have installed Windows 10 in one, and wanted to install Ubuntu 20.04 on the other one. I figured the safer way for me to do it was to unplug the Windows drive and do a fresh install. Then, plug it in and run sudo update-grub
for it to recognize the Windows install in the other drive.
But life isn't that easy (or I'm missing something) :'(
$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.0-63-generic
Found initrd image: /boot/initrd.img-5.8.0-63-generic
Found linux image: /boot/vmlinuz-5.8.0-43-generic
Found initrd image: /boot/initrd.img-5.8.0-43-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 55,5M 1 loop /snap/core18/1988
loop1 7:1 0 219M 1 loop /snap/gnome-3-34-1804/66
loop2 7:2 0 64,8M 1 loop /snap/gtk-common-themes/1514
loop3 7:3 0 51M 1 loop /snap/snap-store/518
loop4 7:4 0 31,1M 1 loop /snap/snapd/11036
nvme1n1 259:0 0 465,8G 0 disk
└─nvme1n1p1 259:1 0 465,8G 0 part /media/username/System
nvme0n1 259:2 0 465,8G 0 disk
└─nvme0n1p1 259:3 0 465,8G 0 part /
The entry for:
nvme1n1 259:0 0 465,8G 0 disk
└─nvme1n1p1 259:1 0 465,8G 0 part /media/username/System
is the drive where Windows lives in.
$ sudo fdisk -l
Disk /dev/loop0: 55,48 MiB, 58159104 bytes, 113592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 218,102 MiB, 229629952 bytes, 448496 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 64,79 MiB, 67915776 bytes, 132648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop3: 51,4 MiB, 53522432 bytes, 104536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop4: 31,9 MiB, 32595968 bytes, 63664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/nvme1n1: 465,78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: PNY CS3030 500GB SSD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdef856b7
Device Boot Start End Sectors Size Id Type
/dev/nvme1n1p1 2048 976771071 976769024 465,8G 7 HPFS/NTFS/exFAT
Disk /dev/nvme0n1: 465,78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: PNY CS3030 500GB SSD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x84bb543f
Device Boot Start End Sectors Size Id Type
/dev/nvme0n1p1 * 2048 976771071 976769024 465,8G 83 Linux
Also:
$ [ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode"
Installed in Legacy mode
I am wondering, what can I do to get Windows added to the GRUB and be able to dual-boot?
Thank you very much in advance.
Let me know if you need any more information
UPDATE 1:
First, I removed my Ubuntu drive and my Windows wasn't booting :( I realized I had other drives that had unplugged. I plugged them in and it booted windows normally. Apparently, the windows bootloader has been installed somewhere else. Weird! I unplugged everything but the Windows drive to try and solve the bootloader issue.
I went and try different things from the Windows side. I created a media installation drive and booted to the troubleshoot area. There I got in the command line prompt and used diskpart
to make the Windows Partition active
I use bootrec /fixmbr
, bootrec /fixboot
, and bootrec /rebuildbbcd
. This wasn't working either. Then I use bcdboot c:\windows /d
and that did the job. I restarted and booted Windows normally without any other drives plugged in.
Plugged in my Ubuntu drive and ran sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.0-63-generic
Found initrd image: /boot/initrd.img-5.8.0-63-generic
Found linux image: /boot/vmlinuz-5.8.0-43-generic
Found initrd image: /boot/initrd.img-5.8.0-43-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 10 on /dev/nvme1n1p1
done
At last!
PS: Don't know if I should make this update an answer to my own question to help others. I'll try later.