[H-GEN] EFI dual boot with systemd-bood

Andrew Ridgway armistace at riseup.net
Sat Nov 7 23:19:42 EST 2015

Hi All,

Sorry for the bottom post before.

I have now got this working so I thought I would share my experience.

First of all though, Systemd-boot at this stage can not handle what I
wanted as it does not support chainloading onto a different Hard drive
EFI partition, at least I couldn't find any documentation to this

GRUB however does, It has both the "--set=root" and "chainloader"
options which can work in tandem to produce the result I required.

For those interested to reproduce what I have done I took the following
steps, as a side note Microsoft have also provided an upgrade path from
win 8 pro 32bit to win 10 pro 64bit pro, meaning that this upgrade
required no further financial outlay on my behalf.

1. Remove Linux harddrives and ensure win 8 still boots (not stricly
necessary but I don't trust windows)

1. Follow the upgrade process from win8 32bit to win10 32bit.

2. Follow the upgrade process from win10 32bit to win10 64bit

8-1-32/ - this link has more details)

3. ensure win10 drivers are installed and it is upgraded and turn off

4. Reinsert Linux harddrives and reinstall linux in UEFI GPT mode 
(I had bios MBR which is fully incompatible with uefi so I had to
reinstall my root partition) thankfully my home drive was on a seperate
disk so I did not need to wipe that (and it works even though it is in
MBR mode, I think this is because It does not handle any booting)

5. Install grub in UEFI mode to the EFI partition.

6. At this point I then reboot the computer and checked the UEFI
interface could see both the windows boot disk and grub and boot into
both. - It could which meant I had a backup (if annoying) method of
achieving what I want by simply changing boot disk

7. now came the fun part of working out how to get grub to chainload
windows. It turns out that it can use the same method I was using to
chainload windows in BIOS/MBR.

After some extensive googling I found this article:

which very nicely explained everything I needed.

This left me with the following 40_custom in etc/grub.d/:

exec tail -n +3 $0
# 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
# the 'exec tail' line above.

if [ "${grub_platform}" == "efi" ]; then
	menuentry "Windows 10 UEFI-GPT" {
		insmod part_gpt
		insmod fat
		insmod search_fs_uuid
		insmod chain
		search --fs-uuid --set=root --hint-bios=hd2,gpt2 --
hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2  $uuid_value
		chainloader /EFI/Microsoft/Boot/bootmgfw.efi

Obviously where $uuid_value is the UUID value for the windows drive.
The linked article nicely explains how to get this.

I ran a grub-mkconfig to build my grub menu and it worked as expected
with a new menu entry  for "Windows 10 UEFI-GPT"

The first time I boot into Windows from grub windows decided to change
the value of the main boot disk in the UEFI but since I have reset it
it has not done it since and it now works as it did before except in
UEFI-GPT instead of BIOS-MBR. 

I am a bit disappointed about the systemd-boot thing but this seems to
work really well now, I have even been through a windows update without
anything breaking so I am going to leave as is.

Thanks for trying everyone, and thank for the pointers Russell they
helped me better interpret the articles I was reading.


On Sun, 2015-09-27 at 14:00 +1000, Andrew Ridgway wrote:
> [ Humbug *General* list - semi-serious discussions about Humbug
> and     ]
> [ Unix-related topics. Posts from non-subscribed addresses will
> vanish. ]
> On 27 September 2015 11:39:01 am AEST, Russell Stuart <russell-humbug
> @stuart.id.au> wrote:
> > [ Humbug *General* list - semi-serious discussions about Humbug
> > and    
> > ]
> > [ Unix-related topics. Posts from non-subscribed addresses will
> > vanish.
> > ]
> > 
> > On Sat, 2015-09-26 at 21:11 +1000, Andrew Ridgway wrote:
> > > tl;dr: has anyone chain loaded 64bit windows 10 through systemd-
> > > boot
> > > windows being on a completely separate hard drive to systemd-boot 
> > > and
> > > the linux boot partition.
> > 
> > I see nobody has replied.
> > 
> > We discussed this at the Humbug meeting, and none of us had much of
> > a
> > clue most because none of us have used systemd-boot.  I gather it's
> > a
> > signed EFI shim that does boot loading.  Also, it sounds like you
> > are
> > booting Windows from something other than SATA-O (ie, not the C
> > drive).
> > That has caused some of us a world of pain in the past.  There were
> > some
> > claims that grub had magic to handle that - somehow hiding the
> > other
> > drives so it looked to Windows as it if was booting from C.
> > 
> > So you have combined using systemd-boot and trying to run Windows
> > from
> > something other than C, and it all gets too hard.  There were only
> > two
> > suggestions - bring it into the next Humbug meeting so we can all
> > have
> > a
> > poke at it, or re-arrange your drives so Windows boot's from
> > C.  Linux
> > can boot from anything after all ...
> > 
> > _______________________________________________
> > General mailing list
> > General at lists.humbug.org.au
> > http://lists.humbug.org.au/mailman/listinfo/general
> I don't know which sata Windows is on but my install procedure with
> legacy boot was as follows:
> Take Linux drives out and install Windows....quietly weep
> Take windows drive out (overkill but better safe than sorry)
> Put Linux drives in install Linux
> Put Windows drive back in and run osprober (a Ubuntu application that
> has been ported to arch)
> Edit grub.cfg and change the windows entry to point to msdos2 as the
> one it selects is the recovery partition of 8. The run grub-mkconfig
> This will boot Linux and windows
> I of course made sure that each drive stayed in the same sata
> position between swaps.
> That seemed to work each time under legacy. Under EFI and systemd-
> boot this will obviously be very different.
> Once I have the funds to purchase windows 10 (64bit and 32bit
> licences are not transferable....) I might backup and bring it along
> it might make for an interesting evening .
> Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.humbug.org.au/pipermail/general/attachments/20151108/de3dc23c/attachment.sig>

More information about the General mailing list