You are not logged in.

#1 2020-02-15 11:24:13

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Reboot to Windows10 on another HDD

I want to reboot my machine into Win10 on a second harddrive.
Maybe with a new entry to my polybar shutdown section.

I found this old post:

Head_on_a_Stick wrote:
drog wrote:

Hi, how can add a entry to systemd-boot to windows which is in another hdd?

I don't think you can unless you share the Windows ESP on the other hard drive with Arch and mount it to /boot

It is possible to make a custom NVRAM entry to boot Windows on a second drive:

# efibootmgr -d /dev/sdX -p Y -c -L "Windows" -l /EFI/Microsoft/Boot/bootmgfw.efi

Replace X & Y with the drive letter and partition number of the Windows EFI system partition.

But i dont know how to share the Windows ESP.
Is the proposal still up to date?
Can someone explain in more detail how it works?


current arch installation
Please leave comments on gist.

Offline

#2 2020-02-15 11:41:57

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

archinco wrote:

i dont know how to share the Windows ESP

What is your current configuration?

# parted --list
# lsblk -f
# efibootmgr -v

If you have /boot mounted to an ESP on another drive then you can copy the contents over to the ESP on the Windows drive, edit /etc/fstab to reflect this change then remount /boot to the new location and run the bootctl install command again to generate a new NVRAM boot entry.


Jin, Jîyan, Azadî

Offline

#3 2020-02-15 12:18:21

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

Thank's for your reply.

What is your current configuration?

Model: ATA OCZ-VECTOR150 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  608MB  607MB  primary  ntfs         boot
 2      608MB   240GB  239GB  primary  ntfs


Model: Samsung SSD 970 EVO Plus 500GB (nvme)
Disk /dev/nvme0n1: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name              Flags
 1      1049kB  538MB  537MB  fat32        EFI System        boot, esp
 2      538MB   430GB  429GB               Linux filesystem
NAME        FSTYPE FSVER LABEL          UUID                                   FSAVAIL FSUSE% MOUNTPOINT
sda                                                                                           
|-sda1      ntfs         System-reserviert
|                                       B45AD82F5AD7EBDC                                      
`-sda2      ntfs                        16E6DBADE6DB8AFF                                      
nvme0n1                                                                                       
|-nvme0n1p1 vfat   FAT32 UEFI           81E0-7DC8                               377.1M    26% /boot
`-nvme0n1p2 crypto 2                    37438890-ccf0-40bb-b865-715477c0e1d0                  
  `-main    LVM2_m LVM2                 JScQ09-jaV3-4WWD-cFUX-1VAo-sqds-Ze7gLU                
    |-main-root
    |       ext4   1.0   root           c59a60fa-deb4-41c2-909e-4dca8c5bf717     14.1G    47% /
    `-main-home
            ext4   1.0   home           7fb15e87-b138-4cad-a0be-81439bb2cd99    319.4G     7% /home
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0005,0009,0008
Boot0005* Linux Boot Manager	HD(1,GPT,b7f321c1-d151-4535-bf56-5bae1f42e089,0x800,0x100000)/File(\EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI)
Boot0008* Hard Drive	BBS(HD,,0x0)..GO..NO........o.O.C.Z.-.V.E.C.T.O.R.1.5.0....................A...........................>..Gd-.;.A..MQ..L.C.O.-.Z.9.L.5.A.7.7.F.D.V.M.J.D.9.9.N.B........BO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .P.l.u.s. .5.0.0.G.B....................A...........................%8X.........R..Gd-.;.A..MQ..L.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .P.l.u.s. .5.0.0.G.B........BO
Boot0009* UEFI OS	HD(1,GPT,b7f321c1-d151-4535-bf56-5bae1f42e089,0x800,0x100000)/File(\EFI\BOOT\BOOTX64.EFI)..BO

Windows 10 is installed on the VECTOR 150 SSD.

If you have /boot mounted to an ESP on another drive then you can copy the contents over to the ESP on the Windows drive, edit /etc/fstab to reflect this change then remount /boot to the new location and run the bootctl install command again to generate a new NVRAM boot entry.

Does it work to copy the Windows stuff to my existing /boot on archlinux.
Sry, i dont rly understand this topic. -.-

Last edited by archinco (2020-02-15 12:59:26)


current arch installation
Please leave comments on gist.

Offline

#4 2020-02-15 12:36:34

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

Your Windows system is installed in non-UEFI mode so you need to use the non-UEFI version of GRUB in your Arch system to be able to chainload it, see https://wiki.archlinux.org/index.php/Du … imitations & https://wiki.archlinux.org/index.php/Du … imitations for more on this.

Try adding a BIOS boot partition (type EF02 in gdisk, no filesystem, use sectors 34-2047 on /dev/nvme0n1) then run the relevant command to get Arch booting in non-UEFI mode. If that works then install the os-prober package and update the GRUB configuration again to generate a Windows entry.

EDIT: target /dev/sda with the grub-install command, your motherboard might need the "boot" flag to determine which disk to start. Backup the MBR beforehand:

# dd if=/dev/sda bs=512 count=1 of=mbr.bak

Use this to restore mbr.bak if anything goes wrong:

cp mbr.bak /dev/sda

The backup & restore process can be done from the live system, just remember to extract & save the mbr.bak file.

And for future reference prepend commands with LC_ALL=C to make them speak English.

Last edited by Head_on_a_Stick (2020-02-15 12:41:43)


Jin, Jîyan, Azadî

Offline

#5 2020-02-15 12:57:08

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

Your Windows system is installed in non-UEFI mode so you need to use the non-UEFI version of GRUB in your Arch system to be able to chainload it, see https://wiki.archlinux.org/index.php/Du … imitations & https://wiki.archlinux.org/index.php/Du … imitations for more on this.

How do you see it's not in UEFI mode?
My Windows installation is fresh. Maybe i should try to install again in UEFI mode first?

And for future reference prepend commands with LC_ALL=C to make them speak English.

Thank you. I have edited the post.

Last edited by archinco (2020-02-15 13:00:04)


current arch installation
Please leave comments on gist.

Offline

#6 2020-02-15 13:21:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

archinco wrote:

How do you see it's not in UEFI mode?

Because it's installed on a disk with an msdos partition table. Read my links. Double-check the status from Windows, ask the interweb how.

archinco wrote:

My Windows installation is fresh. Maybe i should try to install again in UEFI mode first?

That might be a better idea. Make sure /dev/sda has a GUID partition table before running the Windows installer. Or clear the partition table entirely and boot the installer in UEFI mode (ie, with CSM or "Legacy" mode disabled).


Jin, Jîyan, Azadî

Offline

#7 2020-02-15 17:10:38

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

Because it's installed on a disk with an msdos partition table. Read my links. Double-check the status from Windows, ask the interweb how.

I've check your link, and followed the tip to use mbr2gpt first.
This worked ffor me by running:

mbr2gpt /validate /allowFullOS
mbr2gpt /convert /allowFullOS

Now the configuration looks like this:

Model: ATA OCZ-VECTOR150 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  608MB  607MB  ntfs               hidden, diag
 2      608MB   240GB  239GB  ntfs               msftdata
 3      240GB   240GB  105MB  fat32              boot, esp


Model: Samsung SSD 970 EVO Plus 500GB (nvme)
Disk /dev/nvme0n1: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name              Flags
 1      1049kB  538MB  537MB  fat32        EFI System        boot, esp
 2      538MB   430GB  429GB               Linux filesystem
NAME        FSTYPE FSVER LABEL          UUID                                   FSAVAIL FSUSE% MOUNTPOINT
sda                                                                                           
|-sda1      ntfs         System-reserviert
|                                       B45AD82F5AD7EBDC                                      
|-sda2      ntfs                        16E6DBADE6DB8AFF                                      
`-sda3      vfat   FAT32                BA54-6367                                             
nvme0n1                                                                                       
|-nvme0n1p1 vfat   FAT32 UEFI           81E0-7DC8                               377.1M    26% /boot
`-nvme0n1p2 crypto 2                    37438890-ccf0-40bb-b865-715477c0e1d0                  
  `-main    LVM2_m LVM2                 JScQ09-jaV3-4WWD-cFUX-1VAo-sqds-Ze7gLU                
    |-main-root
    |       ext4   1.0   root           c59a60fa-deb4-41c2-909e-4dca8c5bf717     14.1G    47% /
    `-main-home
            ext4   1.0   home           7fb15e87-b138-4cad-a0be-81439bb2cd99    319.5G     7% /home
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0000,0005,0009,0008
Boot0000* Windows Boot Manager	HD(3,GPT,cc91333a-500f-11ea-8cf8-d0509993199b,0x1bef1800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0005* Linux Boot Manager	HD(1,GPT,b7f321c1-d151-4535-bf56-5bae1f42e089,0x800,0x100000)/File(\EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI)
Boot0008* Hard Drive	BBS(HD,,0x0)..GO..NO........o.O.C.Z.-.V.E.C.T.O.R.1.5.0....................A...........................>..Gd-.;.A..MQ..L.C.O.-.Z.9.L.5.A.7.7.F.D.V.M.J.D.9.9.N.B........BO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .P.l.u.s. .5.0.0.G.B....................A...........................%8X.........R..Gd-.;.A..MQ..L.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .P.l.u.s. .5.0.0.G.B........BO
Boot0009* UEFI OS	HD(1,GPT,b7f321c1-d151-4535-bf56-5bae1f42e089,0x800,0x100000)/File(\EFI\BOOT\BOOTX64.EFI)..BO

current arch installation
Please leave comments on gist.

Offline

#8 2020-02-15 17:30:46

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

So now you need to copy the contents of /boot from /dev/nvme0n1p1 to /dev/sda3. Read my first post in this thread again for further instructions.


Jin, Jîyan, Azadî

Offline

#9 2020-02-15 20:51:11

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

I've made a backup of the windows boot folder. (sda3 mounted to windrive)
And started the recommended copy:

sudo cp -a /boot/. /mnt/windrive/

The copy breaks because there is not enough space (100 MB).
I don't know if i need to copy all the content of the folder...
should i try to expand the sda3 drive from linux?

Would it be possible to copy the other way around?


current arch installation
Please leave comments on gist.

Offline

#10 2020-02-15 21:03:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

archinco wrote:

Would it be possible to copy the other way around?

No, that will break Windows.

Just use GRUB instead, that doesn't care if the Windows ESP is on another disk.


Jin, Jîyan, Azadî

Offline

#11 2020-02-16 07:21:41

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

No, that will break Windows.

Just use GRUB instead, that doesn't care if the Windows ESP is on another disk.

Ok, then better no inverse copy, but I would like to stick with systemd-boot.
I've decided to resize the EFI-Patition within gparted and the copy finaly worked.

If you have /boot mounted to an ESP on another drive then you can copy the contents over to the ESP on the Windows drive, edit /etc/fstab to reflect this change then remount /boot to the new location and run the bootctl install command again to generate a new NVRAM boot entry.

That's my current /boot entry:

# /dev/nvme0n1p1 UUID=81E0-7DC8
LABEL=UEFI         	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro	0 2

I guess i have to rename the partition to:

# /dev/sda3 UUID=BA54-6367
/dev/sda3        	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro	0 2

             

To remount i use this:

# umount /dev/nvme0n1p1
# mount /dev/sda3 /boot

Edit:
On 'bootctl install' i receive the message, that there is not space.(again)
Maybe i have to recreate the Windows-EFI on the larger partition before i can continue...

Last edited by archinco (2020-02-16 10:32:01)


current arch installation
Please leave comments on gist.

Offline

#12 2020-02-16 11:25:01

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

archinco wrote:

I guess i have to rename the partition to:

# /dev/sda3 UUID=BA54-6367
/dev/sda3        	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro	0 2

It's better to use the UUID rather than the block device because the latter might change if you have another drive attached when booting.

archinco wrote:

On 'bootctl install' i receive the message, that there is not space.(again)

Please post the actual, verbatim command output rather than a vague description. And we should check the mountpoint and free space available:

df -h

You should probably explicitly declare the ESP mountpoint for bootctl(1), as per the ArchWiki.


Jin, Jîyan, Azadî

Offline

#13 2020-02-16 13:59:29

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

It's better to use the UUID rather than the block device because the latter might change if you have another drive attached when booting.

Ok

Please post the actual, verbatim command output rather than a vague description. And we should check the mountpoint and free space available:

The copy command didn't worked as expected before... so its not bootctl

sudo cp -a /boot/. /mnt/windrive/
cp: error writing '/mnt/windrive/./initramfs-linux-lts-fallback.img': No space left on device
cp: error writing '/mnt/windrive/./initramfs-linux.img': No space left on device
cp: error writing '/mnt/windrive/./initramfs-linux-fallback.img': No space left on device
df -h
/dev/sda4               96M     96M  3,0K  100% /mnt/windrive

I don't understand this... I've created a new EFI-Partion on Windows (600Mb space)
And gparted tells me, there are 600 Mb now. It seems only 100Mb are correct formated.


current arch installation
Please leave comments on gist.

Offline

#14 2020-02-16 14:26:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

archinco wrote:

I've created a new EFI-Partion on Windows (600Mb space)

Did you expand the filesystem to fill the new partition?


Jin, Jîyan, Azadî

Offline

#15 2020-02-17 18:37:37

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

I've tried to expand the windows efi-partition, but win10 killed my archlinux efi partition at some point.
Now i can't boot into my archsystem anymore.
I've tried to rebuild my systemd-bootloader like on my first install (link below).
There are no errors, but it doesnt show a loader entry after reboot.
The timeout setting in loader.conf works correctly.

Do i have to change the fstab? Or use the efibootmgr command?


current arch installation
Please leave comments on gist.

Offline

#16 2020-02-17 19:57:41

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

archinco wrote:

I've tried to expand the windows efi-partition

How?

archinco wrote:

win10 killed my archlinux efi partition at some point.

Define "killed".

archinco wrote:

Now i can't boot into my archsystem anymore.

Is there a boot menu entry for it? If so, what happens when you select it? If not, what do you actually see when booting the machine?

archinco wrote:

I've tried to rebuild my systemd-bootloader like on my first install (link below).

Just the bootloader section? Did you mount the (Windows) ESP correctly beforehand?

archinco wrote:

it doesnt show a loader entry after reboot.

What doesn't show a "loader entry"? And what do you mean by "loader entry", exactly?

archinco wrote:

Do i have to change the fstab? Or use the efibootmgr command?

The fstab file won't be read unless the system is able to be booted.

But we should probably see

efibootmgr -v

Jin, Jîyan, Azadî

Offline

#17 2020-02-17 20:28:26

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

How?

With diskpart on win10--> delete partiton --> recreate efi partition --> format the efi partion

Define "killed".

I guess the wrong partition get formated.
I'm not sure if diskpart lose the focus to a selected disk after some commands.

Is there a boot menu entry for it? If so, what happens when you select it? If not, what do you actually see when booting the machine?

I see a menu, with only one entry "Reboot into Firmware" (I change timeout to 1s, this works)

Just the bootloader section? Did you mount the (Windows) ESP correctly beforehand?

I have two disks. Both have an EFI partition. The partition on the Linux-disk doesnt work anymore.
So im not sure why i should mount the Windows ESP now? It's not yet expanded so i cant use it to boot into Arch.
First i want to restore the broken ArchBoot then i will try to expand the windows EFI-partition again.

What doesn't show a "loader entry"? And what do you mean by "loader entry", exactly?

The loader entry doesnt show up i the startup menu. (Arch Linux row in this case)

nvim /boot/loader/entries/arch.conf
...
title    Arch Linux
linux    /vmlinuz-linux
initrd   /intel-ucode.img
initrd   /initramfs-linux.img
options  cryptdevice=/dev/nvme0n1p2:main root=/dev/mapper/main-root rw lang=de init=/usr/lib/systemd/systemd locale=de_DE.UTF-8

efibootmgr -v

Doesn't changed for the Linux-Manger, only new order...

BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0005,0009,0008
Boot0000* Linux Boot Manager    HD(1,GPT,b7f321c1-d151-4535-bf56-5bae1f42e089,0x800,0x100000)/File(\EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI)

Last edited by archinco (2020-02-17 20:36:56)


current arch installation
Please leave comments on gist.

Offline

#18 2020-02-17 21:20:35

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

archinco wrote:

With diskpart on win10--> delete partiton --> recreate efi partition --> format the efi partion

I'm not familiar with Windows' partitioning tools but that sounds like you have deleted the contents of that partition. Why did you do that? Please tell me you backed up the contents beforehand and so are able to restore them.

archinco wrote:

I guess the wrong partition get formated.

Why are you guessing? Examine the contents of the partitions from the Arch live ISO image.

archinco wrote:

First i want to restore the broken ArchBoot then i will try to expand the windows EFI-partition again.

If the Arch ESP is empty then re-format it, mount it correctly, (arch-)chroot into the system then re-install the kernel and run the bootctl(1) command to reinstate the bootloader.

Last edited by Head_on_a_Stick (2020-02-17 21:21:41)


Jin, Jîyan, Azadî

Offline

#19 2020-02-22 07:34:26

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

I'm not familiar with Windows' partitioning tools but that sounds like you have deleted the contents of that partition. Why did you do that? Please tell me you backed up the contents beforehand and so are able to restore them.

I tried to reformat the windows esp partition and accidently format the arch esp.
The win10 boot still works.

If the Arch ESP is empty then re-format it, mount it correctly, (arch-)chroot into the system then re-install the kernel and run the bootctl(1) command to reinstate the bootloader.

It doesn't work. Please tell me if i should open a new topic for this problem.
Error message after select linux or linux-lts to start:

Failed to open file: initramfs-linux.img
Trying to load files to higher address
Failed to open file: initramfs-linux.img

What I've done so far:

modprobe dm-crypt
cryptsetup luksOpen /dev/nvme0n1p2 crypt
vgchange -ay
mkfs.fat -F 32 -n UEFI /dev/nvme0n1p1
mount /dev/mapper/main-root /mnt
mount /dev/nvme0n1p1 /boot
arch-chroot /mnt
pacman -S linux
pacman -S intel-ucode
pacman -S mkinitcpio

mkinitcpio -p linux 
bootctl install
nvim /boot/loader/entries/arch.conf
[i]
title    Arch Linux
linux    /vmlinuz-linux
initrd   /intel-ucode.img
initrd   /initramfs-linux.img
options  cryptdevice=/dev/nvme0n1p2:main root=/dev/mapper/main-root rw lang=de init=/usr/lib/systemd/systemd locale=de_DE.UTF-8
[/i]

nvim /boot/loader/loader.conf
[i]
timeout 1
default arch
[/i]

exit
umount ...
reboot

Did i miss something?

Last edited by archinco (2020-02-22 07:34:54)


current arch installation
Please leave comments on gist.

Offline

#20 2020-02-22 13:49:02

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Reboot to Windows10 on another HDD

archinco wrote:

Please tell me if i should open a new topic for this problem.

No, this thread is a mess anyway, let's not spread it out across the boards.

archinco wrote:
mount /dev/nvme0n1p1 /boot

That should have been

mount /dev/nvme0n1p1 /mnt/boot

Next time check the contents of /dev/nvme0n1p1 to make sure the kernel image & initramfs are actually present on the ESP.


Jin, Jîyan, Azadî

Offline

#21 2020-02-22 14:24:46

archinco
Member
From: Germany
Registered: 2019-10-20
Posts: 34

Re: Reboot to Windows10 on another HDD

Yeah it worked, thank you very much.


current arch installation
Please leave comments on gist.

Offline

Board footer

Powered by FluxBB