[SOLVED] Grub doesn't detect windows

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
kinu
Level 1
Level 1
Posts: 21
Joined: Sat Oct 18, 2008 5:20 am

[SOLVED] Grub doesn't detect windows

Post by kinu »

Hello!

I've installed windows and mint in separate drives. sda is for windows and nvme1 is for mint. First installed windows, and then Mint.
The thing is that grub does not see Windows. I can boot to Windows changing boot order in BIOS, so I think is ok, but I want grub to boot both systems.

fdisk -l

Code: Select all

Disco /dev/nvme0n1: 238,49 GiB, 256060514304 bytes, 500118192 sectores
Disk model: Apacer AS2280P4 256GB                   
Unidades: sectores de 1 * 512 = 512 bytes
Tamaño de sector (lógico/físico): 512 bytes / 512 bytes
Tamaño de E/S (mínimo/óptimo): 512 bytes / 512 bytes
Tipo de etiqueta de disco: dos
Identificador del disco: 0x9416f7d0

Dispositivo    Inicio Comienzo     Final  Sectores Tamaño Id Tipo
/dev/nvme0n1p1 *          2048   1050623   1048576   512M  b W95 FAT32
/dev/nvme0n1p2         1052670 500117503 499064834   238G  5 Extendida
/dev/nvme0n1p5         1052672 500117503 499064832   238G 83 Linux


Disco /dev/sda: 223,58 GiB, 240057409536 bytes, 468862128 sectores
Disk model: KINGSTON SUV400S
Unidades: sectores de 1 * 512 = 512 bytes
Tamaño de sector (lógico/físico): 512 bytes / 4096 bytes
Tamaño de E/S (mínimo/óptimo): 4096 bytes / 4096 bytes
Tipo de etiqueta de disco: gpt
Identificador del disco: 2412B298-A26F-414B-A0DB-41F02F8A19E0

Dispositivo  Comienzo     Final  Sectores Tamaño Tipo
/dev/sda1        2048    206847    204800   100M Sistema EFI
/dev/sda2      206848    239615     32768    16M Reservado para Microsoft
/dev/sda3      239616 467789875 467550260   223G Datos básicos de Microsoft
/dev/sda4   467791872 468858879   1067008   521M Entorno de recuperación de Wind
and have two more HDD, as seen in lsbk

Code: Select all

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 223,6G  0 disk 
├─sda1        8:1    0   100M  0 part 
├─sda2        8:2    0    16M  0 part 
├─sda3        8:3    0   223G  0 part 
└─sda4        8:4    0   521M  0 part 
sdb           8:16   0 465,8G  0 disk 
├─sdb1        8:17   0 461,8G  0 part 
├─sdb2        8:18   0     1K  0 part 
└─sdb5        8:21   0     4G  0 part 
sdc           8:32   0 465,8G  0 disk 
└─sdc1        8:33   0 465,8G  0 part 
nvme0n1     259:0    0 238,5G  0 disk 
├─nvme0n1p1 259:1    0   512M  0 part /boot/efi
├─nvme0n1p2 259:2    0     1K  0 part 
└─nvme0n1p5 259:3    0   238G  0 part /
I've tried to mount the /dev/sda1 (containing a directory named EFI) to /boot/efi and then

Code: Select all

grub-mkconfig -o /boot/grub/grub.cfg
again, but windows is not detected

How I can fix this?

EDIT: the grub Mint installed is grub-pc....is it correct?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
MikeNovember
Level 7
Level 7
Posts: 1856
Joined: Fri Feb 28, 2020 7:37 am
Location: Nice, Paris, France

Re: Grub doesn't detect windows

Post by MikeNovember »

Hi,

The correct way to install Windows and Mint on separate drives is the following:
- put your future Windows disk on SATA connector 0, remove future Mint disk, install Windows;
- remove your Windows disk, install your future Mint disk on SATA connector 0, install Mint;
- add your Windows 10 on SATA connector 1.

Now, your Windows 10 has its own boot sector, and your Mint has GRUB. Future updates of Mint will not affect Windows boot, and future updates of Windows will not affect GRUB.

Boot your computer, it will boot on Mint (SATA 0); then, in a terminal:

Code: Select all

sudo update-grub
This will update your GRUB menu on your Mint disk, without affecting your Windows disk.

At next launch, you will have the choice to boot on Mint or Windows.

Regards,

MN
_____________________________
Linux Mint 21.3 Mate host with Ubuntu Pro enabled, VMware Workstation Player with Windows 10 Pro guest, ASUS G74SX (i7-2670QM, 16 GB RAM, GTX560M with 3GB RAM, 1TB SSD).
kinu
Level 1
Level 1
Posts: 21
Joined: Sat Oct 18, 2008 5:20 am

Re: Grub doesn't detect windows

Post by kinu »

Thank you.

So, the only way is to reinstall both OS?

And, if I can boot windows changing boot order in BIOS (so windows boot is not damaged)... why isn't Grub able to see and boot Windows?

And you see I want mint in nvme1, and windows in sata 0 (only sata 3 plug)....how to do it?
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Grub doesn't detect windows

Post by AndyMH »

If sudo update-grub did not find win the usual cause is that one OS is installed in legacy mode and the other in UEFI.

In mint check with efibootmgr:

Code: Select all

andy@T432 ~ $ efibootmgr
EFI variables are not supported on this system.
this is booting in legacy, anything else is UEFI.

Check your win install:
https://www.tenforums.com/tutorials/851 ... -bios.html
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
kinu
Level 1
Level 1
Posts: 21
Joined: Sat Oct 18, 2008 5:20 am

Re: Grub doesn't detect windows

Post by kinu »

Thanks again.

I followed the guide and Windows is in UEFI mode. And Mint in BIOS mode.

So, what to do? If I have to reinstall, I prefer reinstalling Mint, but, how to assure I install it in UEFI mode?
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Grub doesn't detect windows

Post by AndyMH »

Easiest is to re-install mint. But there are a few things to be aware of:

You have mint installed to your nvme drive, it currently has a legacy/msdos partition table on it. You need to reformat the drive with a gpt partition table. You can use gparted, there is a copy on your mint install stick. It will wipe the drive.

There is a bug in the installer when installing in UEFI mode. It will put grub (the bootloader) in the first EFI partition it finds. This might be your win drive (sda) and not what you want. There are two fixes for this:
  • the easiest - disconnect your win drive before you install mint, reconnect it after, or...
  • using gparted disable the esp & boot flags on your EFI partition on your win drive, then install mint and then re-enable the boot & esp flags on the EFI partition on sda after install.
For both of these, when you boot your new mint install you will need to open a terminal and sudo update-grub to find win so that you get a grub menu on boot giving you the choice of mint or win (the installer will put 'ubuntu' at the top of the BIOS boot list, if you don't update grub the only way of booting win will be to go into your BIOS boot list and select 'windows bootloader').

To install mint you have to boot the install stick in UEFI mode. How to do this is dependent on your BIOS. You may have options for Both (legacy first), if so set to Both (UEFI first) or UEFI only, or if there is a CSM option (compatability support mode), turn it off. You can check what mode the install stick has booted in with efibootmgr.

You should be able to install mint with the 'erase and install' option, pointing it at your nvme drive, or you can use the 'something else' option and create the partitions you want in advance (use gparted). If you use 'something else' you need a minimum of two partitions, one 100MB size, format fat32 with the flags esp and boot set (this is your EFI partition) and one ext4 partition for /.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
kinu
Level 1
Level 1
Posts: 21
Joined: Sat Oct 18, 2008 5:20 am

Re: Grub doesn't detect windows

Post by kinu »

Thank you very much!

Now it is working, following your wise guiding.
Locked

Return to “Installation & Boot”