You are not logged in.

#1 2015-12-20 11:34:59

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

[RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

I installed Windows 10 to a second hard drive I added to my desktop. To make sure nothing went wrong with grub/linux I unplugged the first hard drive during installation.

So I know have a system that is theoretically a dual-boot system. I just currently need to go into my BIOS and change the order it reads the hard drives in to change which OS is started!

Is there a way to have GRUB boot windows when installed this way?

Resolved: Everything still seems to be working

Last edited by jonnybarnes (2016-01-03 21:32:27)

Offline

#2 2015-12-20 11:47:38

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

You could install os-prober and then regenerate your GRUB configuration:

# grub-mkconfig -o /boot/grub/grub.cfg

This should usually detect other operating systems and add entries for them. For Windows, it would typically add an entry for chain loading the Windows bootloader.


pkgshackscfgblag

Offline

#3 2015-12-20 12:06:14

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

This doesn’t work sad

It creates a new entry in my grub menu, but when I select Windows 10 I then see the blue windows boot-up logo for about 2 seconds, then my machine restarts.

When I change the bios boot-up order to goto Windows directly it then complains about failing to start-up properly last time...

Offline

#4 2015-12-20 12:12:00

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

Of interest, Windows automatically formatted the second hard drive to have 500MB partition, and a second partition to use the rest of hard drive, GRUB is currently set to load the 500M partition.

Is this right?

Offline

#5 2015-12-20 12:19:32

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

It's possible - from what I know Windows creates a separate "system partition" (pressumably containing the bootloader and kernel), so trying to boot from that one should usually work.

Are you using BIOS or UEFI to boot your system?


pkgshackscfgblag

Offline

#6 2015-12-20 12:35:47

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

I'm using BIOS.

This is what is now in my grub.cfg:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 10 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-DA202CDC202CC0FD' {
	insmod part_msdos 
	insmod ntfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  DA202CDC202CC0FD
	else
	  search --no-floppy --fs-uuid --set=root DA202CDC202CC0FD
	fi
	drivemap -s (hd0) ${root}
	chainloader +1
}
### END /etc/grub.d/30_os-prober ###

And this is what fdisk prints out:

Command (m for help): p
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
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: dos
Disk identifier: 0xcdd53a6f

Device     Boot   Start        End    Sectors  Size Id Type
/dev/sda1  *       2048    1026047    1024000  500M  7 HPFS/NTFS/exFAT
/dev/sda2       1026048 1953521663 1952495616  931G  7 HPFS/NTFS/exFAT

I do find it kind of silly that the smallest hard drive I could buy today was a 1TB drive!

Offline

#7 2015-12-20 16:40:56

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

Bah os-prober still use the damn old chainloader +1 way?  Is it even expected to work with later Windows?
You might need a custom entry which uses the ntldr command instead:
https://wiki.archlinux.org/index.php/GR … S-MBR_mode

Offline

#8 2015-12-20 17:00:02

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

Using the ntldr results in the same outcome, I see the blue windows boot-up logo for 2s then my machine reboots.

Offline

#9 2015-12-20 18:25:13

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

tom.ty89 wrote:

Bah os-prober still use the damn old chainloader +1 way?  Is it even expected to work with later Windows?

According to the official documentation, yes it is.

@OP: Try the drive swapping technique outlined in the link above, Windows will only boot if it is on the "first" disk.

EDIT: I see there is already a drivemap command in your grub.cfg -- try declaring the drives explicitly rather than as "${root}"

Last edited by Head_on_a_Stick (2015-12-20 18:28:00)

Offline

#10 2015-12-21 10:00:14

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

Okay, this still results in the windows logo for 2s then a machine restart:

menuentry "Microsoft Windows 10 BIOS-MBR" {
    insmod part_msdos
    insmod ntfs
    insmod search_fs_uuid
    insmod ntldr     
    search --no-floppy --fs-uuid --set=root DA202CDC202CC0FD
    drivemap -s (hd0) (hd2,msdos1)
    ntldr /bootmgr
}

Offline

#11 2015-12-21 11:46:38

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

What if you remove the line `drivemap -s (hd0) (hd2,msdos1)`?

Offline

#12 2015-12-21 12:48:39

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

This seems to have worked, thanks smile

Offline

#13 2015-12-21 13:41:41

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

Pfft that means os-prober is silly sad

But well grub-mkconfig is even sillier anyway, so write your grub.cfg: https://ptpb.pw/uhiV.cfg big_smile

Last edited by tom.ty89 (2015-12-21 14:57:08)

Offline

#14 2015-12-21 14:50:43

Archforum101
Member
Registered: 2015-12-11
Posts: 44

Re: [RESOLVED]Setup GRUB to dual-boot Windows 10 on a second hard drive

Might look this over too. That nixer is dual booting Arch + win10 and worked for him. You'll just have to determine the right path cmd on your system to set grub2 as default. Works on this system too, several gnu/nix OS's and win8.1.

When comp boots up, I get right to the grub2 menu and win8.1 boots fine if selected. Your use case is slightly diff though, as you're dealing with 2 hdd's. Should still work though.

Last edited by Archforum101 (2015-12-21 14:51:45)

Offline

Board footer

Powered by FluxBB