You are not logged in.

#1 2022-11-18 00:33:02

j@s0n
Member
Registered: 2020-08-15
Posts: 30

Can't set up dual boot

I'm setting up a new machine as a dual boot. I installed Windows 10 on nvme0n1. It booted and ran as expected. I then booted off the arch ISO and set up arch on nvme1n1, with grub as the boot manager in nvme1n1p1 and root in nvme1n1p2. I was able to restart and boot into arch just fine.
I tried to add the windows partition to grub, by mounting the windows partition and running os-prober. However it doesn't list any output or add anything to grub.

How can I set this up as a dual boot?

Offline

#2 2022-11-18 00:35:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,745

Re: Can't set up dual boot

Which Windows partition are you mounting? On a EFI setup you need to mount the FAT ESP partition containing the actual boot loader, not the NTFS one.

In doubt post the output of lsblk -f and the grub-mkconfig invocation in code tags: https://bbs.archlinux.org/help.php#bbcode

Last edited by V1del (2022-11-18 00:36:46)

Offline

#3 2022-11-18 01:01:17

j@s0n
Member
Registered: 2020-08-15
Posts: 30

Re: Can't set up dual boot

I only see one windows partition. I don't remember if I set it up as EFI or not. I just followed the defaults.

$ lsblk -f
NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme1n1                                                                            
├─nvme1n1p1 vfat   FAT32       7823-7EBB                             954.1M     7% /boot
├─nvme1n1p2 ext4   1.0         e00b3e89-a435-482f-84fd-d3c142111af8   83.9G     9% /
└─nvme1n1p3                                                                        
nvme0n1                                                                            
└─nvme0n1p1 ntfs         M.2   12A61375A6135895                                    
$ grub-mkconfig
#
# 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_msdos
insmod ext2
search --no-floppy --fs-uuid --set=root e00b3e89-a435-482f-84fd-d3c142111af8
    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-e00b3e89-a435-482f-84fd-d3c142111af8' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod fat
	search --no-floppy --fs-uuid --set=root 7823-7EBB
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=e00b3e89-a435-482f-84fd-d3c142111af8 rw  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-e00b3e89-a435-482f-84fd-d3c142111af8' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-e00b3e89-a435-482f-84fd-d3c142111af8' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod fat
		search --no-floppy --fs-uuid --set=root 7823-7EBB
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=e00b3e89-a435-482f-84fd-d3c142111af8 rw  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-e00b3e89-a435-482f-84fd-d3c142111af8' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod fat
		search --no-floppy --fs-uuid --set=root 7823-7EBB
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=e00b3e89-a435-482f-84fd-d3c142111af8 rw  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 ###
fwsetup --is-supported
if [ "$grub_platform" = "efi" -a "$?" = 0 ]; then
	menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
		fwsetup
	}
fi
### END /etc/grub.d/30_uefi-firmware ###

### 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.
### 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 ###

Offline

#4 2022-11-18 03:17:30

Scimmia
Fellow
Registered: 2012-09-01
Posts: 9,838

Re: Can't set up dual boot

you don't run os-prober, the grub-mkconfig script does. You need to regenerate your config.

Offline

#5 2022-11-18 04:18:40

j@s0n
Member
Registered: 2020-08-15
Posts: 30

Re: Can't set up dual boot

Scimmia wrote:

you don't run os-prober, the grub-mkconfig script does. You need to regenerate your config.

I ran it to see if it said anything interesting. grub-mkconfig warns me that it's going to run os-prober, but it doesn't find my Windows installation.

Last edited by j@s0n (2022-11-18 04:19:28)

Offline

#6 2022-11-18 04:25:04

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,859

Re: Can't set up dual boot

Do you actually have a Windows .efi on your EFI partition? (Or on a different EFI partition?)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2022-11-18 04:30:02

j@s0n
Member
Registered: 2020-08-15
Posts: 30

Re: Can't set up dual boot

cfr wrote:

Do you actually have a Windows .efi on your EFI partition? (Or on a different EFI partition?)

If you mean the partition I mount on /boot, no. The doc I was following didn't talk about creating one.

I was able to boot my Windows partition via the BIOS boot menu and verify that I have an MBR partition.

Offline

#8 2022-11-18 04:36:08

j@s0n
Member
Registered: 2020-08-15
Posts: 30

Re: Can't set up dual boot

https://wiki.archlinux.org/title/Dual_boot_with_Windows wrote:

Windows 8/8.1 and 10 x86_64 versions support booting in x86_64 UEFI mode from GPT disk only, OR in BIOS mode from MBR disk only. They do not support IA32 UEFI boot, x86_64 UEFI boot from MBR disk, or BIOS boot from GPT disk.

If I'm reading that correctly, my MBR partition isn't going to work with grub running in UEFI mode. So it looks like I need to convert my partition to GPT or reinstall on a GPT partition.

Offline

#9 2022-11-18 05:03:57

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,859

Re: Can't set up dual boot

j@s0n wrote:

If I'm reading that correctly, my MBR partition isn't going to work with grub running in UEFI mode. So it looks like I need to convert my partition to GPT or reinstall on a GPT partition.

Or boot in BIOS mode i.e. just switch the boot loader for Arch.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2022-11-18 05:43:02

j@s0n
Member
Registered: 2020-08-15
Posts: 30

Re: Can't set up dual boot

I changed the partition type to GPT, reinstalled Windows, and was able to add it to grub. But now when I boot into Windows, it overwrites grub as the default boot option and I have to go into the BIOS to get the grub menu.

Offline

#11 2022-11-18 06:08:19

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,859

Re: Can't set up dual boot

j@s0n wrote:

I changed the partition type to GPT, reinstalled Windows, and was able to add it to grub. But now when I boot into Windows, it overwrites grub as the default boot option and I have to go into the BIOS to get the grub menu.

See https://wiki.archlinux.org/title/Unifie … boot_order.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB