You are not logged in.

#1 2017-04-03 09:29:26

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

[SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

I installed arch alongside windows 10 on a brand new Lenovo Yoga 10. Windows was already installed and I partitioned one device to give 265G to arch.
I followed strictly the install wiki and other wiki regarding bootloader, dual boot and UEFI. Unfortunately, when I boot the laptop, menu entries appear but will not start the OS'es (w10 or arch).

If I boot into arch, init starts but will hang after a while because login and network services didn't start.
If I boot into windows, I get a message :Unmountable boot volume
According to me, my menu is missing the EUFI shell entries. I only have these options: arch, windows boot manager, EFI default loader, reboot into firmware.

Below are relevant parts of my install.

  • disk partitioning.

    # fdisk -l
    ......
    /dev/nvme0n1p1    EFI system    <----- I didn't touch it
    ....
    /dev/nvme0n1p3     186G  Microsoft basic data  <---- w10
    ...
    /dev/nvme0n1p6    264.7G  Linux filesystem
  • filesystem
    I created Btfs subvolumes:

    # pwd
    /
    # btrfs subvolume list -p .
    ID 261 gen 263 parent 5 top level 5 path ROOT
    ID 262 gen 16 parent 5 top level 5 path home
    ID 263 gen 17 parent 5 top level 5 path snapshots
    ID 264 gen 263 parent 5 top level 5 path etc
    ID 265 gen 35 parent 261 top level 261 path var/lib/machines  <---- did nothing to create this. It appeared ( i guess some systemd machined mechanism)

    Before running pacstrap and installing, I mounted the EFI partition as /boot.
    Once everything installed:

  • boot partition

    # ls boot
    BOOT EFI initramfs-linux-fallback.img initramfs-linux.img intel-ucode.img loader vmlinuz-linux   <---- shellx64.efi missing ??
  • fstab

    # cat /etc/fstab
    UUID=xxyy  /   btrfs   rw,noatime,compress=lzo,ssd,subvolid=261,subvol=/ROOT,subvol=ROOT   0  0    <---- why genfstab wrote twice subvol=  ?
    ....
    UUID=505D-DE47        /boot       vfat       rw,relatime     0  2
  • boot partition

    # bootctl --path=/boot install
    # bootctl --path=/boot 
    System
    Firmware: UEFI 2.50...
    Secure Boot: disable
    Setup Mode: user
    
    Loader: systemd-boot 232
    Partition: n/a   <----- This line should contain a partition address. I think my issue comes from here
    File |__ /EFI/BOOT/loader.efi
    
    Boot loader Binaries:
    ESP : /dev/disk/by-partuuid/xxxyyyy         <---- PARTUUID number corresponds to /dev/nvme0n1p1  (the EFI part) when running blkid
    File: |__ /EFI/systemd/systemd-bootx64.efi  (systemd-boot 232)
    File: |__ /EFI/BOOT/bootx64.efi (systemd-boot 232)
    
    Boot Loader Entries in EFI variables:
    Title: Linux Boot Manager
    ID: 0x0002
    Status:active, boot-order
    Partition: /dev/disk/by-partuuid/xxxyyyy      <---- same partition as above ESP
    File: |__ /EFI/systemd/systemd-bootx64.efi
    
    Title: Windows Boot Manager
    ID:0x0001
    Status:active, boot-order
    Partition: Partition: /dev/disk/by-partuuid/xxxyyyy     <---- again same as the two entries above
    File: |__/EFI/Microsoft/Boot/bootmgfw.efi
  • Configuration files

    # cat /boot/loader/loader.conf
    default  arch
    timeout  5
    editor   0
    # cat /boot/loader/entries/arch.conf
    title   arch
    linux  /vmlinuz-linux
    initrd /intel-ucode.img
    initrd /initramfs-linux.img
    options root=PARTUUID=xxxxyyyyyy  rw  rootflags=subvol=ROOT  video=1920x1080     <----- Yoga 910 screen resolution is 4k, so need this video entry+ PARTUUID is the one of /dev/nvme0n1p6  (Linux partition)

Any help would be much appreciated as I am on this issue since 2 days already and can't see how fix it. I suspect the issue comes from the loader having n/a as Partition, but I don't know how fix it.

Last edited by gabx (2017-04-09 13:20:00)

Offline

#2 2017-04-03 14:31:52

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

From LENOVO forum:

Try installing GRUB boot manager? Is Linux Mint UEFI, or Legacy BIOS? The reason why you can't boot into windows is because windows was installed in RAID mode, not AHCI. Reinstall windows in AHCI mode, and you shouldn't have any problems with Linux Mint finding the boot manager.

Is this answer a possible explanation?

Last edited by gabx (2017-04-03 15:53:38)

Offline

#3 2017-04-03 17:38:38

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

The answer to your question is no, what you got from the lenovo forum isn't helpful. I'll get to another machine and try to help real soon.


Simple and Open

Offline

#4 2017-04-03 19:05:13

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Thank you. I found too this answer quite fancy

Offline

#5 2017-04-03 20:34:18

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Installing a boot manager or boot loader (2 different things) with UEFI, entries get written to non-volatile memory that UEFI uses at boot to know what to launch and more. The efibootmgr utility is what the script(s) that install the boot loader or manager use to manipulate the UEFI boot related variables. Entering the efibootmgr command without any switches will show you those variables, those boot entries.

Many people don't use the boot manager that is built into the flavor of UEFI that they have. On mine, if I press F10 and hold it during boot I will see the built in boot manager. It might be some other F key for you, F3, F2, F8, etc. It will show you the boot entries held in the UEFI non-volatile memory. Your's will likely show you an entry for windows and one for systemd-boot that is most likely named Arch or Arch Linux or Linux. When you have been booting your likely seeing the systemd-boot menu and it seems to have issues.

Try finding your UEFI boot manager menu and using it to launch windows. Adding a boot manager or loader and linux shouldn't have done anything to your windows boot. That will show you windows is or isn't still healthy and that we only need to fix systemd-boot. With UEFI multiple boot loaders or boot managers can all exist without overwriting one another. About the only ways to mess up an existing boot option are by messing up the ESP or deleting the existing boot entry in UEFI's non-volatile memory.


Simple and Open

Offline

#6 2017-04-05 00:47:31

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

I think the issue may be the combination of nvme, btrfs, uefi, systemd. I've seen much discussion about this or very similar issues. It gets complicated by there being many comments from people that make wild assumptions and come to very unlikely conclusions and recommendations. I'll try to briefly describe my thinking about this.

Your UEFI flavor, whatever it is, must be able to access UEFI executables on the ESP or windows wouldn't have been able to boot. Make sure the ESP and boot flags are set on the ESP since I'm not sure windows cares about that but some boot loader/manager install scripts do care. Look at the files and folders on your ESP to ensure that the Arch kernel is at it's root and that you see the appropriate files and folders. Use the efibootmgr man page to see how to use it if needed and use it to inspect the UEFI variables to ensure they are correct. If they aren't, delete and re-create the entry.

Once you are confident in the ESP contents and UEFI variables check out systemd-boot in depth. Ensure that the nvme device id's are correct and that they don't contain sdax nomenclature. Ensure your esp/loader/entries/arch-btrfs-subvol.conf file matches as shown in the systemd-boot wiki page. Running bootctl --path=esp install with your nvme device id should both copy the systemd-boot programs to the ESP and make the entry in the UEFI variables. If you have any doubt about either, run that again. Delete the existing entry in the UEFI variables by using efibootmgr if you want before you re-run this bootctl command.

If you get to where you feel solid about the UEFI variables, and for that matter any related settings in your UEFI flavor, solid about the ESP properties, files and folders and about the systemd-boot configuration, I'd try to eliminate btrfs as the issue by either verifying it's config as I mentioned above or creating a small (10GB) ext4 partion for root of a new install.


Simple and Open

Offline

#7 2017-04-05 12:57:26

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

thank you for all these details.
For now, I want to get back to semi-original state: i keep the Linux partition.
Unfortunately, boot manager installed when installing Linux is still here and I can't even boot from an usb key to repair windows! Boot manager will only let me boot windows, but when choosing it windows will not boot: unmountable boot volume.

EDIT: i reinstalled windows 10. I want now to do again from the begining the arch install. What would be your suggestion to avoid the same issue?

Last edited by gabx (2017-04-05 15:47:03)

Offline

#8 2017-04-05 18:10:23

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

I guess I'd go as simple as possible to start and try to get more pieces in successive projects. Does windows have the whole drive again or do you still have your partition for linux? Have you removed any boot entries left from your initial linux and windows installs? Is the ESP newly re-created by the windows install or does it still have leftovers from the initial windows and linux installs? I ask those things to know if they could confuse things now but mainly you just have to know those things as you try again.

I think I'd start with the simplest install possible. One partition of ext4 for everything other than the ESP. Mount the ESP at /boot. Don't install a boot loader or manager, just use the built in EFISTUB capability to have UEFI launch the kernel directly. You do that using the efibootmgr utility to create the boot entry. You don't even need a swap partition.

I have set USB and CD/DVD ahead of the SDD in my UEFI boot priority settings. On my InsydeH2O UEFI based Toshiba laptop I press F2 to get to that at boot. I can boot from USB or CD/DVD just by having one of them accessible at boot. Or, I can press F10 and see all of SDD, USB and Optical drive listed. When I select one of them it either shows me a list of boot options on that device if there are more than one or just boots from that device if there is only one option installed on it. So if I choose the CD/DVD or USB it boots from that or if I choose the SDD it may offer more than one option. My Arch installation that I'm using has grub and systemd-boot installed and there are options listed in UEFI for them but the boot option I've chosen as the default uses the EFISTUB kernel capability that is on by default to just launch Arch directly from UEFI. It takes about 3 seconds from when UEFI finishes till I can login. I can press F10 and choose what to boot anytime but normal operation is it's most efficient with this configuration.

One of the first things I did when I got this system was to learn about all the settings and options to do with my UEFI. There isn't all that much to learn but know what you have to work with. Also, search for any know bugs in your UEFI and see if you think they may affect you. It's usually straightforward to update UEFI from windows but no always that easy from linux. I went through some updates of my UEFI but haven't had a need to do that now in a long time. You usually have to take any UEFI updates and settings documentation into your own hands. Your vendor can't be counted on for this.

Once you have a working Arch system, add any boot manager/loader that you want. You can install whichever of them that you want and if you have trouble just switch the default boot option variable to one that works using efibootmgr. It's not like on BIOS where installing a boot loader/manager or another distro or OS over writes the previous boot loader. New UEFI boot variables are added and new boot options are added to the ESP in their own folders.

Do keep in mind though what your choice of mount point for the ESP does. The linux kernel gets installed to /boot no matter what mount point you choose for the ESP. That means if the ESP is mounted to /boot, the kernel resides on the ESP. If you choose /boot/efi as the mount point for the ESP, the kernel is on the root partition not the ESP. That effects a couple things at least. UEFI can only launch OS's from the ESP for one. If the kernel isn't on the ESP you can't use UEFI to launch the kernel directly. You also can't have more than one distro instance, such as multiple Arch instances or multiples of any distro, that use the same kernel name and both have /boot as the mount point. If you ever install a second instance of an OS, use /boot/efi as the ESP mount point.

I can't help myself but get carried away and write too much but I'll end this now. Let me know if you need anything.


Simple and Open

Offline

#9 2017-04-06 11:05:21

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Wel,again, thank you for this long post. Here is now my situation:
I reinstalled a new windows 10. The ESP partition is clean and has only w10 stuff. The Linux dedicated partition is here too.

Following your advices, I will try to boot Linux and windows without installing any boot loader and manager, but just using Efi stub facilities. Is that correct?
Once both OS boot, I will then add a boot manager, be it rEFInd boot manager or systemd-boot.

On the right path?

EDIT: if I refer to Efi stub arch wiki:

  1. I mount my esp partition (in my case, the one created by w10) as /boot

  2. using EFI directly, I run

    # efibootmgr -d /dev/sdX -p Y -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/sdBZ rw initrd=/initramfs-linux.img"

Is it all? Shall I enter an entry in my fstab for the esp monted as /boot ?
When I will reboot, how can I choose the OS? With the F1-F12 Fn keys?

Sorry, but all this is very confusing to me.I have been using GRUB many times in the past but now this very new situation let me in troubles.

Last edited by gabx (2017-04-06 14:06:30)

Offline

#10 2017-04-06 15:37:41

cbpeckles
Member
Registered: 2015-06-26
Posts: 5

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

If that is the exact efibootmgr command you ran then it is incorrect.  "-d /dev/sdX" and "root=/dev/sdBZ" needs to correspond to the ESP and the root partition you want to boot.  (i.e. the B and Z need to be replaced with your root device)  You should really consider using a UUID for the root kernel option to allow you to boot if device names get changed. 

Yes you should make an entry for mounting your ESP to boot.  Again, UUIDs should be considered here.  You need this becuase when the linux kernel is updated it will be copied to /boot along with the initramfs.  If ESP is not mounted to boot, you will be running the same kernel forever.  Problems will also be caused with kernel modules.

When you reboot you should be able to pick "Arch Linux" from your boot up list after pressing the boot menu button.

NOTE:  I really find this the more difficult way of getting UEFI boot to work correctly.  rEFInd makes this much simpler imo as is its purpose.  If you do get around to switching to it, you will use the same command but you will be pointing the efibootmgr command to rEFInd's .efi file.  After setting rEFInd to be your default boot up entry, you can pick any operating system that refind finds or ones you have manually told refind exist by way of its .conf file.

Last edited by cbpeckles (2017-04-06 15:42:36)

Offline

#11 2017-04-06 23:10:11

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Yes, you are on the right path. Mount your root and ESP partitions as described in the installation guide and as part of the install generating the fstab will put the ESP in it. I do use UUID in it. You will use the F key for the boot menu if you need to boot to something other than your default OS. The UEFI variable for the default boot entry will auto boot you to which ever you want to be the default. You can also use setting the boot next variable in UEFI if desired. You set that temporary setting using efibootmgr.

cbpeckles is correct to make sure your efibootmgr command to create the entry does identify your partitions and I think with yours using nvme I'd use the nvme nomenclature. The last I knew rEFInd was no longer maintained so that would be my caution about using it. I still would keep the number of moving parts so to speak minimal and not use any boot manager or loader until and unless everything else is working.


Simple and Open

Offline

#12 2017-04-06 23:25:21

loqs
Member
Registered: 2014-03-06
Posts: 17,195

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Blasphemist wrote:

The last I knew rEFInd was no longer maintained so that would be my caution about using it.

It was case the arch refind package was not following upstream updates for most of 2016 but it appears to have resumed doing so.  https://git.archlinux.org/svntogit/pack … refind-efi

Offline

#13 2017-04-07 08:20:16

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Here is the exact line I wrote:

# efibootmgr -d /dev/nvme0n1 -p 1 -c -L "Arch Linux" -l /vmlinuz-linux -u "root=UUID=xxxxxyyyy rw rootflags=subvol=ROOT initrd=/initramfs-linux.img initrd=intel-ucode.img video=1920x1080"

.

  • My esp is mounted at /boot

    # ls boot
    BOOT EFI initramfs... here all linux + intel stuff
  • # fdisk -l

    /dev/nvme0n1p1    EFI System
    ......
    /dev/nvme0n1p6     Linux Filesystem
  • # efibootmgr -v

    BootOrder : 0002,0000,.....
    Boot0002* Arch Linux
    Boot0000* Windows Boot Manager
  • # cat etc/fstab

    .......
    UUID=505D-DE47     /boot     vfat    rw,relatime     0   2

Now I can boot to Linux: system init starts and I can see init messages, but it hangs at systemd-logind. Boot stops here and then no command line.
I can boot a plain and fully functional windows when changing boot order.

According to me, for now, my boot settings are OK, and the only reason I can see for arch not to boot is in the way I install it. Right?

I will now try to reinstall arch with a simple unique etx4 partition and see if it is my Btrfs stuff which breaks arch from booting.

Last edited by gabx (2017-04-08 12:46:52)

Offline

#14 2017-04-07 08:26:25

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Is it all working now?


Simple and Open

Offline

#15 2017-04-07 08:29:50

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Blasphemist wrote:

Is it all working now?

Please see my last post a few minutes ago and tell me your advice.
Thank you for being here and helping

Last edited by gabx (2017-04-07 08:30:05)

Offline

#16 2017-04-07 11:48:03

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

I changed the filesystem on my Linux partition from btrfs to ext4 and reinstall base arch.

I mounted my esp at /boot, then pacstrap, genfstab, arch-chroot. After that, I followed systemd-boot instruction to set settings in conf files. At last, exit, umounted and rebooted.

At next boot, I was found with systemd simple boot manager and I am now able to dual boot windows 10 and arch. YES !!
Next thing is now to make a new try with btrfs as filesystem.

One thing annoyes me still. When booting arch, I have a bunch of this 3 line message:

 [    3.299999       ]  pcieport   0000:00:1c.0   Pcie Bus Error : Severity=Corrected, type=Data Link Layer, id=00e(Transmitter ID)
                                                                           device [8086:9d14] error status/mask=00001000/0000200
                                                                           [12] Replay Timer Timeout

then messages hang and I can't see the rest of boot process init messages. I have to type the Enter key to make the login prompt appears.

Do anyone have an idea about this issue? (looks like hardware issue)

Thank you much for all your precious posts. I am now giving a try at Btrfs and see if I can dual boot.

EDIT

# journalctl -k
.........
platform MSFT0101:00 failed to claim ressource 1
acpi MSFT0101:00: platform device creation failed 
........
<the three lines mentioned above appear many times>
<with>
pcieport 0000:00:1c.0: AER: corrected error recieved: id=00e0
<each time after these 3 lines>
.....
sd 0:0:0:0:  [sda] No Caching mode page found
sd 0:0:0:0:  [sda] Assuming drive cache: write through

Last edited by gabx (2017-04-07 12:02:44)

Offline

#17 2017-04-07 14:49:53

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

Great to see the progress and congrats on staying with this. That's how you really learn. I'll do some research and thinking and see if I can help with this error.


Simple and Open

Offline

#18 2017-04-07 15:46:56

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

What network and video hardware do you have? I've seen some other threads in this forum where this error was related to hardware.


Simple and Open

Offline

#19 2017-04-09 13:19:04

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 135
Website

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

I have spent nearly two days trying to dual boot with arch on Btrfs with no success. I may have poorly setup Btrfs (but I doubt as I already have done it many times), or there is something broken with systemd-boot/EFI/Btrfs. I stoped wasting my time and I now dualboot with systemd-boot and linux on ext4.

As for my hardware:

# lspci | grep "VGA"
VGA compatible controller: Intel corporation Device 5916 (rev 2)

I mark the thread as solved as my boot is working

Offline

#20 2017-04-10 14:26:49

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED]systemd-boot dual windows10/arch on UEFI - Boot menu broken

That's good to hear. I've been considering a move to btrfs and if I do I'll watch for this but I wonder if it may only show up with the nvme in that mix.


Simple and Open

Offline

Board footer

Powered by FluxBB