You are not logged in.

#1 2019-01-03 08:03:40

atis
Member
Registered: 2019-01-01
Posts: 17

[SOLVED] Systemd-boot detects Windows but not Arch.

I'm trying to install Encrypted Arch with Systemd-boot as the bootloader along side Windows 10.


--------------------------------------------------
These are the Hooks
--------------------------------------------------

 HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems fsck) 

[root@archiso boot]# mkinitcpio -p linux

==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 4.20.0-arch1-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [encrypt]
  -> Running build hook: [lvm2]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 4.20.0-arch1-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: aic94xx
  -> Running build hook: [encrypt]
  -> Running build hook: [lvm2]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
==> Image generation successful

--------------------------------------------------
My loader.conf
--------------------------------------------------

[root@archiso boot]# cat /boot/loader/loader.conf

#timeout 3
#console-mode keep
default 8dcebf4330ed489d8b672d271c57b325-*

linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID=26226fb3-47b4-454d-80fc-c67ce72b9d28:cryptlvm  root=/dev/mapper/volgroup0-lv_root quiet rw

Here cryptdevice is my

 nvme0n1p6 

partition which is my

 /mnt/home 

or

 /dev/mapper/volgroup0-lv_home 

--------------------------------------------------
This is my /boot directory
--------------------------------------------------

[root@archiso boot]# ls

EFI  initramfs-linux-fallback.img  initramfs-linux.img  loader  vmlinuz-linux

--------------------------------------------------
This is my /boot/EFI directory
--------------------------------------------------

[root@archiso EFI]# ls

Boot  Microsoft  systemd

-------------------------------------------------

I followed wiki to the best of my abilities but I'm sure I made some really stupid mistake somewhere. I just don't know where to look.

Last edited by atis (2019-01-03 14:05:08)

Offline

#2 2019-01-03 08:30:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Systemd-boot detects Windows but not Arch.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-01-03 08:48:38

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

You shouldn't add the entry definition to the loader.conf make a new file e.g. /boot/loader/entries/arch.conf : https://wiki.archlinux.org/index.php/Sy … ng_loaders

Last edited by V1del (2019-01-03 08:51:08)

Offline

#4 2019-01-03 08:56:55

atis
Member
Registered: 2019-01-01
Posts: 17

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

[root@archiso /]# efibootmgr

BootCurrent: 0006
Timeout: 0 seconds
BootOrder: 0005,0000,0001,0002,0007,0006
Boot0000* Windows Boot Manager
Boot0001* grub_uefi
Boot0002* Solid State Disk
Boot0005* Linux Boot Manager
Boot0006* USB Drive (UEFI) - hp v10w 1100
Boot0007* USB Drive (UEFI) - hp v10w 1100

This is the output of efibootmgr. Does grub_uefi suppose to be there? I didn't install grub so I'm not sure.

Last edited by atis (2019-01-03 09:00:18)

Offline

#5 2019-01-03 08:59:56

atis
Member
Registered: 2019-01-01
Posts: 17

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

@V1del Do these look correct?


[root@archiso loader]# cat entries/arch.conf

title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options cryptdevice=UUID=26226fb3-47b4-454d-80fc-c67ce72b9d28:cryptlvm  root=/dev/mapper/volgroup0-lv_root quiet rw

and

[root@archiso loader]# cat loader.conf
#timeout 3
#console-mode keep
default 8dcebf4330ed489d8b672d271c57b325-*

where

[root@archiso /]# cd /boot/
[root@archiso boot]# ls
EFI  initramfs-linux-fallback.img  initramfs-linux.img  intel-ucode.img  loader  vmlinuz-linux
[root@archiso boot]# cd loader/
[root@archiso loader]# ls
entries  loader.conf
[root@archiso loader]# cat loader.conf
#timeout 3
#console-mode keep
default 8dcebf4330ed489d8b672d271c57b325-*
[root@archiso loader]# cd entries/
[root@archiso entries]# ls
arch.conf
[root@archiso entries]#

Last edited by atis (2019-01-03 09:02:38)

Offline

#6 2019-01-03 09:06:39

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

From a glance yes, at least the entry should appear now. The default option doesn't make much sense you might want to switch that, however it shouldn't be inherently problematic

Offline

#7 2019-01-03 09:17:41

atis
Member
Registered: 2019-01-01
Posts: 17

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

I restarted the PC but unfortunately this time no entries showed up and I think it directly boot-ed arch.

This is what I see on the screen right now.

starting version 239
ERROR: device '/dev/mapper/volgroup0-lv_root' not found. Skipping fsck.
mount: /new_root: no filesystem type specified
You are now being dropped into an emergency shell
sh: can't access tty: job control turned off.

I'm quite sure it failed because it didn't ask for a decryption password for volgroup0. But I do have encrypt and lvm Hook present in my mkinitcpio config file.

Last edited by atis (2019-01-03 09:18:45)

Offline

#8 2019-01-03 09:45:37

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,975
Website

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

atis wrote:

[root@archiso /]# efibootmgr

BootCurrent: 0006
Timeout: 0 seconds
BootOrder: 0005,0000,0001,0002,0007,0006
Boot0000* Windows Boot Manager
Boot0001* grub_uefi
...

Your EFI thusly first tries to boot the "Windows Boot Manager" and, if it fails, "grub_uefi", which I presume is a Grub2 installation previously installed by you.
If Grub's configuration is outdated, and the system cannot boot correclty, you will be dropped to the emergency shell you see.
If you do no longer use grub, but systemd-boot, remove grub from the EFI boot entries using efibootmgr.


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#9 2019-01-03 10:28:55

atis
Member
Registered: 2019-01-01
Posts: 17

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

schard wrote:

If you do no longer use grub, but systemd-boot, remove grub from the EFI boot entries using efibootmgr.

I'm not sure why Windows boot fails but what you said is indeed what I want to do!

Will just removing it work or do I have to replace it with systemd-boot equivalent?
Although I'm not sure how to go about doing either of those. I'm not at all familiar with efibootmgr and I don't want to mess things up even more.

EDIT: I found these commands that could work

Add systemd-boot to efibootmgr

 efibootmgr -c -d /dev/< I think should be my boot partition> -p Y -l "\EFI\systemd\systemd-bootx64.efi" -L "Linux Boot Manager" 

maybe delete grub entry like this

 efibootmgr -b 0001 -B 

and maybe change the order with

 efibootmgr -o 

Is that correct?

Last edited by atis (2019-01-03 11:02:46)

Offline

#10 2019-01-03 11:44:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

With regards to efibootmgr that's right, though there's no real use to reinstalling systemd-boot it is already present. To get the menu to show up you might want to explicitly configure a timeout.

What's relevant is the boot order, according to that systemd-boot (0005 Linux Boot Manager) is currently loaded first. So I think from that aspect we have it fixed, now your other setup seems to be incorrect. double check your LVM / LUKS config that this is really what you used, post any relevant files in doubt.

Offline

#11 2019-01-03 11:56:27

atis
Member
Registered: 2019-01-01
Posts: 17

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

I pretty much did this when encrypting my drives

mkfs.ext2 /dev/nvme0n1p5

To set up encryption

cryptsetup luksFormat /dev/nvme0n1p6
cryptsetup open --type luks /dev/nvme0n1p6 lvm

To set up lvm:

# pvcreate --dataalignment 1m /dev/mapper/lvm
# vgcreate volgroup0 /dev/mapper/lvm
# lvcreate -L 30GB volgroup0 -n lv_root
# lvcreate -l 100%FREE volgroup0 -n lv_home
# modprobe dm_mod
# vgscan
# vgchange -ay

Formatting:

# mkfs.ext4 /dev/volgroup0/lv_root
# mkfs.ext4 /dev/volgroup0/lv_home
# mount /dev/volgroup0/lv_root /mnt
# mkdir /mnt/boot
# mkdir /mnt/home
# mount /dev/nvme0n1p5 /mnt/boot
# mount /dev/volgroup0/lv_home /mnt/home

And after generating mkinitcpio I installed bootctl --path=/boot

This is my fstab

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/volgroup0-lv_root
UUID=737ae8e6-5f8c-45e0-86b8-bbc0c47d8750       /               ext4            rw,relatime     0 1

# /dev/nvme0n1p5
UUID=e6118f3c-78be-4977-b4f7-077304e34633       /boot           ext2            rw,relatime,block_validity,barrier,user_xattr,acl       0 2

# /dev/mapper/volgroup0-lv_home
UUID=26226fb3-47b4-454d-80fc-c67ce72b9d28       /home           ext4            rw,relatime     0 2

Offline

#12 2019-01-03 12:36:18

atis
Member
Registered: 2019-01-01
Posts: 17

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

I ran 

 efibootmgr -b 0001 -B  

command from

 arch-chroot 

and I can see all the boot options by systemd-boot. So that's solved!

Now all I have to fix is

starting version 239
ERROR: device '/dev/mapper/volgroup0-lv_root' not found. Skipping fsck.
mount: /new_root: no filesystem type specified
You are now being dropped into an emergency shell
sh: can't access tty: job control turned off.

Since it isn't asking me for decryption password, I suspect there's something wrong with my

 /entries/arch.conf 

file

This is how it's set up

[root@archiso entries]# cat arch.conf
title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options cryptdevice=UUID=26226fb3-47b4-454d-80fc-c67ce72b9d28:volgroup0  root=/dev/mapper/volgroup0-lv_root quiet rw

EDIT: Forgot to add updated arch.conf file.

Last edited by atis (2019-01-03 13:04:58)

Offline

#13 2019-01-03 14:03:58

atis
Member
Registered: 2019-01-01
Posts: 17

Re: [SOLVED] Systemd-boot detects Windows but not Arch.

Ok solved it! I was apparetnly using the wrong uuid.

/dev/nvme0n1p6: UUID="9d820161-e1cf-4215-8c5d-b9ad393bcfc2" TYPE="crypto_LUKS" PARTUUID="e7dcacc4-4a7a-a14c-b561-6f3907f66b66"

This was the uuid I was supposed to use instead!

So this was the final arch.conf

[root@archiso entries]# cat arch.conf
title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options cryptdevice=UUID=9d820161-e1cf-4215-8c5d-b9ad393bcfc2:lvm root=/dev/mapper/volgroup0-lv_root quiet rw

Offline

Board footer

Powered by FluxBB