You are not logged in.

#1 2023-03-03 20:40:52

AAJRKK
Member
Registered: 2023-03-03
Posts: 6

[SOLVED] Grub not detecting older win10 installation

Ok, so I can't figure out how to make grub detect my dual system, short story, my pc was only win10, decided to try and learn linux, so I installed arch using using UEFI bootable + archinstall, everything good so far.

But now grub doesn't detect win10, installed with BIOS, not UEFI, so here I dumped all I've tried and whatever info I can get in hopes you guys can help me out.

lsblk --fs
NAME   FSTYPE FSVER LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                     
|-sda1 ntfs         System Reserved 9C6066BA60669AB2                                    
|-sda2 ntfs                         0ADE6EE8DE6ECC0F                                    
|-sda3 ntfs                         54E09601E095EA0E                                    
`-sda4 ntfs                         44D82415D824082E                                    
sdb                                                                                     
`-sdb1 ntfs                         AE1E25AA1E256C91                                    
sdc                                                                                     
`-sdc1 ntfs                         46A4B4C6A4B4BA2F                                    
sdd                                                                                     
|-sdd1 vfat   FAT32                 F5E2-8A3D                             437.2M    14% /boot
|-sdd2 ext4   1.0                   09171db7-e457-43d1-842d-b5791fb25739      9G    47% /
`-sdd3 ext4   1.0                   854a4737-15b4-48ce-9407-c399a1956a55  353.3G    14% /home
zram0                                                                                   [SWAP]

Following the steps on Arch Wiki with BIOS added this to my /etc/grub.d/40_custom

if [ "${grub_platform}" == "pc" ]; then
	menuentry "Windows 10" {
		insmod part_msdos
		insmod ntfs
		insmod ntldr
		search --no-floppy --fs-uuid 9C6066BA60669AB2
		ntldr /bootmgr
	}
fi

And updated the grub.cfg using

$ sudo grub-mkconfig -o /boot/grub/grub.cfg

Now reading on several posts and forums got the hint that I should mount the unit first, so I did it using

$ sudo mkdir -p /mnt/win
$ sudo mount /dev/sda1 /mnt/win

And then re run the mkconfig line and my grub.cfg looks like this

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd3,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt2 --hint-efi=hd3,gpt2 --hint-baremetal=ahci3,gpt2  09171db7-e457-43d1-842d-b5791fb25739
else
  search --no-floppy --fs-uuid --set=root 09171db7-e457-43d1-842d-b5791fb25739
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-09171db7-e457-43d1-842d-b5791fb25739' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod fat
	set root='hd3,gpt1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt1 --hint-efi=hd3,gpt1 --hint-baremetal=ahci3,gpt1  F5E2-8A3D
	else
	  search --no-floppy --fs-uuid --set=root F5E2-8A3D
	fi
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=09171db7-e457-43d1-842d-b5791fb25739 rw rootfstype=ext4 loglevel=3 quiet
	echo	'Loading initial ramdisk ...'
	initrd	/amd-ucode.img /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-09171db7-e457-43d1-842d-b5791fb25739' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-09171db7-e457-43d1-842d-b5791fb25739' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd3,gpt1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt1 --hint-efi=hd3,gpt1 --hint-baremetal=ahci3,gpt1  F5E2-8A3D
		else
		  search --no-floppy --fs-uuid --set=root F5E2-8A3D
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=09171db7-e457-43d1-842d-b5791fb25739 rw rootfstype=ext4 loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/amd-ucode.img /initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-09171db7-e457-43d1-842d-b5791fb25739' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd3,gpt1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt1 --hint-efi=hd3,gpt1 --hint-baremetal=ahci3,gpt1  F5E2-8A3D
		else
		  search --no-floppy --fs-uuid --set=root F5E2-8A3D
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=09171db7-e457-43d1-842d-b5791fb25739 rw rootfstype=ext4 loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/amd-ucode.img /initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
	fwsetup --is-supported
	if [ "$?" = 0 ]; then
		menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
			fwsetup
		}
	fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

if [ "${grub_platform}" == "pc" ]; then
	menuentry "Microsoft Windows Vista/7/8/8.1/10 BIOS/MBR" {
		insmod part_msdos
		insmod ntfs
		insmod ntldr
		search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 9C6066BA60669AB2
		ntldr /bootmgr
	}
fi
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

I've also removed the comment on /etc/default/grub (GRUB_DISABLE_OS_PROBER=false)

So far I have no luck, the stupid windows is invisible, the only thing I can think off is that the drive needs to be automatically mounted but haven't tried yet since I don't wanna tamper with my win10 boot or grub and make everything unbootable so... halp and thx.

EDIT// Decided to mess around with /etc/fstab, added this line.

# /dev/sda1
UUID=9C6066BA60669AB2	/mnt/win 	auto 	rw,user,auto 	0    0

Checked with

$ sudo findmnt --verify
/mnt/win
   [E] on-disk ntfs seems unsupported by the current kernel
   [W] your fstab has been modified, but systemd still uses the old version;
       use 'systemctl daemon-reload' to reload

0 parse errors, 1 error, 1 warning

So I deleted the line again because for what I understand can ruin boot.

Last edited by AAJRKK (2023-03-04 15:14:11)

Offline

#2 2023-03-03 23:38:35

jonno2002
Member
Registered: 2016-11-21
Posts: 868

Re: [SOLVED] Grub not detecting older win10 installation

do you even have os-prober installed ? its an optional dependency so is NOT installed with grub.

Offline

#3 2023-03-04 00:39:09

AAJRKK
Member
Registered: 2023-03-03
Posts: 6

Re: [SOLVED] Grub not detecting older win10 installation

jonno2002 wrote:

do you even have os-prober installed ? its an optional dependency so is NOT installed with grub.

Yes I do, forgot to mention, it's installed and working.

Offline

#4 2023-03-04 01:02:42

jonno2002
Member
Registered: 2016-11-21
Posts: 868

Re: [SOLVED] Grub not detecting older win10 installation

AAJRKK wrote:

it's installed and working.

your grub.cfg says otherwise:

.....
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
.....

also /dev/sda1 is not your windows partition, its a system reserved partition, so either /dev/sda(2,3,4) will be the one you want to mount.

post output of:

lsblk
fdisk -l

Offline

#5 2023-03-04 02:21:13

AAJRKK
Member
Registered: 2023-03-03
Posts: 6

Re: [SOLVED] Grub not detecting older win10 installation

jonno2002 wrote:

your grub.cfg says otherwise:

Oh, then I screw up somewhere while installing, I'll check again.

jonno2002 wrote:

also /dev/sda1 is not your windows partition, its a system reserved partition, so either /dev/sda(2,3,4) will be the one you want to mount.

post output of:

lsblk
fdisk -l

Thought it was, wiki said it should be System Reserved or System

lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 465.8G  0 disk 
|-sda1   8:1    0   549M  0 part /mnt/win
|-sda2   8:2    0 145.4G  0 part 
|-sda3   8:3    0   514M  0 part 
`-sda4   8:4    0 319.3G  0 part 
sdb      8:16   0 465.8G  0 disk 
`-sdb1   8:17   0 465.8G  0 part 
sdc      8:32   0 465.8G  0 disk 
`-sdc1   8:33   0 465.8G  0 part 
sdd      8:48   0 465.8G  0 disk 
|-sdd1   8:49   0   511M  0 part /boot
|-sdd2   8:50   0  19.5G  0 part /
`-sdd3   8:51   0 445.8G  0 part /home
zram0  254:0    0     4G  0 disk [SWAP]
fdisk -l
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000AAKS-0
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: 0xff17ff19

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048   1126399   1124352   549M  7 HPFS/NTFS/exFAT
/dev/sda2         1126400 306146550 305020151 145.4G  7 HPFS/NTFS/exFAT
/dev/sda3       306147328 307199999   1052672   514M 27 Hidden NTFS WinRE
/dev/sda4       307202048 976771071 669569024 319.3G  7 HPFS/NTFS/exFAT


Disk /dev/sdb: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000AAKS-0
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: 0xed9eed9e

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2048 976769023 976766976 465.8G  7 HPFS/NTFS/exFAT


Disk /dev/sdc: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000AAKS-0
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: 0xeecfeecf

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdc1          63 976768064 976768002 465.8G  7 HPFS/NTFS/exFAT


Disk /dev/sdd: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500LT012-1DG14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 4940FF4D-725C-421F-8BB5-6980BE9748D6

Device        Start       End   Sectors   Size Type
/dev/sdd1      2048   1048575   1046528   511M EFI System
/dev/sdd2   1050624  41943039  40892416  19.5G Linux filesystem
/dev/sdd3  41943040 976773119 934830080 445.8G Linux filesystem


Disk /dev/zram0: 4 GiB, 4294967296 bytes, 1048576 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Forgot to mention, when I use

$ sudo grub-mkconfig -o /boot/grub/grub.cfg

the output is

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  amd-ucode.img initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done

I get no errors from os-prober

Last edited by AAJRKK (2023-03-04 02:25:51)

Offline

#6 2023-03-04 04:50:30

jonno2002
Member
Registered: 2016-11-21
Posts: 868

Re: [SOLVED] Grub not detecting older win10 installation

i think i see your problem, sda, sdb and sdc are using a "dos" or "mbr" partitioning method, and your arch drive (sdd) is using gpt/uefi, you will have to change your windows to gpt/uefi or change your arch install to mbr/dos if you want grub to boot both, OR you can select which drive to boot from your bios which is just a case of hitting whatever key your bios uses to enter the boot select screen. that assuming your bios boots both uefi and mbr without changing settings, thats up to you to figure out

Offline

#7 2023-03-04 15:13:47

AAJRKK
Member
Registered: 2023-03-03
Posts: 6

Re: [SOLVED] Grub not detecting older win10 installation

jonno2002 wrote:

i think i see your problem, sda, sdb and sdc are using a "dos" or "mbr" partitioning method, and your arch drive (sdd) is using gpt/uefi, you will have to change your windows to gpt/uefi or change your arch install to mbr/dos if you want grub to boot both, OR you can select which drive to boot from your bios which is just a case of hitting whatever key your bios uses to enter the boot select screen. that assuming your bios boots both uefi and mbr without changing settings, thats up to you to figure out

Ohhh I was afraid that would be an issue, so far been switching with the bios disk selector, I'm trying to migrate from win10 to arch, can't stand that spyware anymore, but I'll have to reinstall arch then, still need to export a lot of configs.

Thanks a lot mate for taking a look at this, cheers!

Offline

Board footer

Powered by FluxBB