You are not logged in.

#1 2019-11-06 04:17:24

hexated
Member
Registered: 2019-08-17
Posts: 13

[Solved] LUKS LVM cannot be found on boot

Installed a LUKS encrypted system following the Arch Wiki (installed this method before and had good results). However, on reboot, after typing in the passphrase, I am given the following error and given a recovery shell:

ERROR: device '/dev/mapper/vg0-lv_root' not found. Skipping fsck.

My situation is very similar to the one in this thread, but after trying their solution, the problem persists. However, I am unsure to whether I correctly edited the UUID necessary, so I will post my files below.

Last edited by hexated (2019-11-06 07:20:27)

Offline

#2 2019-11-06 05:20:40

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

(edit: changed screenshot of blkid to text)

fstab:

# /dev/mapper/vg0-lv_root
UUID=e8b9f901-394a-4e77-92ae-b9225214abfe	/         	ext4      	rw,relatime	0 1

# /dev/nvme0n1p2
UUID=872b5839-0663-4ba0-a408-94ceece5f535	/boot     	ext4      	rw,relatime	0 2

# /dev/mapper/vg0-lv_home
UUID=ebf0feaf-03e2-4ecf-b8f4-67928532a55c	/home     	ext4      	rw,relatime	0 2

#blkid output

/dev/nvme0n1p1: UUID="4E45-0139" TYPE="vfat" PARTUUID="27d4c4f1-f4e8-1f49-beca-04fb7b1763b3"
/dev/nvme0n1p2: UUID="872b5839-0663-4ba0-a408-94ceece5f535" TYPE="ext4" PARTUUID="04d0c099-e54a-754c-a158-6660a6e2a7c6"
/dev/nvme0n1p3: UUID="9814f284-a529-4e9d-b707-8a3c448d7aa3" TYPE="crypto_LUKS" PARTUUID="7dc20922-cc4a-9643-9a4c-f139d6603cad"
/dev/sda1: UUID="2019-11-01-16-33-14-00" LABEL="ARCH_201911" TYPE="iso9660" PTUUID="65cc13ea" PTTYPE="dos" PARTUUID="65cc13ea-01"
/dev/sda2: SEC_TYPE="msdos" LABEL_FATBOOT="ARCHISO_EFI" LABEL="ARCHISO_EFI" UUID="E058-601A" TYPE="vfat" PARTUUID="65cc13ea-02"
/dev/loop0: TYPE="squashfs"
/dev/mapper/lvm: UUID="uQzYx6-N6QF-xJRx-06Sk-9ZWl-eeaJ-6vPoen" TYPE="LVM2_member"
/dev/mapper/vg0-lv_root: UUID="e8b9f901-394a-4e77-92ae-b9225214abfe" TYPE="ext4"
/dev/mapper/vg0-lv_home: UUID="ebf0feaf-03e2-4ecf-b8f4-67928532a55c" TYPE="ext4"

grub.conf, kernel line:

linux \vmlimuz-linux-lts root=/dev/mapper/vg0-lv_root rw cryptdevice=/dev/nvme0n1p3:vg0 loglevel=3 quiet

On another note, I also checked to makesure my hooks were setup in mkinitcpio.conf, and I did add encrypt and lvm2.

Last edited by hexated (2019-11-06 06:32:37)

Offline

#3 2019-11-06 05:25:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,119
Website

Re: [Solved] LUKS LVM cannot be found on boot

From the recovery shell, can you manually open the LVs with vgchange and unlock the cryptdevice?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2019-11-06 05:32:04

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

I attempted to unlock the lv for vgchange but it returned:

[rootfs]# cryptsetup open /dev/nvme0n1p3 lvm
Enter passphrase ...
Cannot use device /dev/nvme0n1p3 which is already in use (already mapped or mounted).

Last edited by hexated (2019-11-06 05:36:06)

Offline

#5 2019-11-06 05:41:17

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,119
Website

Re: [Solved] LUKS LVM cannot be found on boot

Is this LVM on LUKS? If the cryptdevice is unlocked you should be able to enable the logical volumes.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2019-11-06 05:45:42

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

Yes, the LVM is on LUKS. My mistake, I had forgotten that I unlocked the LVM earlier in startup. Unfortunately, vg commands do not work in the recovery shell. I think the user in the thread I mentioned also had the same problem with vgchange.

Last edited by hexated (2019-11-06 05:47:29)

Offline

#7 2019-11-06 05:47:41

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,119
Website

Re: [Solved] LUKS LVM cannot be found on boot

hexated wrote:

Unfortunately, vg commands do not work in the recovery shell.

That's not an error message. Please report the exact command you issued and the output.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2019-11-06 05:51:11

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

[rootfs]# vgchange
sh: vgchange: not found
[rootfs]# vgscan
sh: vgscan: not found

Last edited by hexated (2019-11-06 05:52:12)

Offline

#9 2019-11-06 05:55:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,119
Website

Re: [Solved] LUKS LVM cannot be found on boot

You are supposed to pass options to the command.

If it still fails, try prepending lvm to the command: lvm vgchange -a y $groupname


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2019-11-06 06:00:00

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

[rootfs]# vgchange -ay vg0
sh: vgchange: not found
[rootfs]# lvm vgchange -ay vg0
sh: lvm: not found

On a side note, thank you for being patient with me. I'm not very experienced with LUKS LVM setup and the fat portion of my knowledge is shallow stuff from just reading wikis.

Offline

#11 2019-11-06 06:04:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,119
Website

Re: [Solved] LUKS LVM cannot be found on boot

Alright. You'll need to chroot in and paste details of your setup (as text, not screenshots). Please include your boot loader/manager, mkinitcpio.conf and a blkid as text.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2019-11-06 06:06:40

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

I'll borrow my friend's laptop tomorrow to ssh into my arch machine so I can copy paste in the config files. Currently my setup is just my phone and laptop (the one in question).

Offline

#13 2019-11-06 06:07:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,119
Website

Re: [Solved] LUKS LVM cannot be found on boot

You can use the live media, in the same way you installed Arch...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2019-11-06 06:09:08

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

The live media includes a web browser? Sorry, I thought it was just the command line interface.

Offline

#15 2019-11-06 06:15:06

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,119
Website

Re: [Solved] LUKS LVM cannot be found on boot


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#16 2019-11-06 06:24:08

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

Didn't know about the pastebin functionallity, cool.

grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod lvm
insmod ext2
set root='lvmid/j9xOWG-sINY-4NCb-1fyZ-VPIM-gDmN-XlLpQ0/566C3T-I54c-bbpF-Xv7H-qPym-lRsi-iUyxeZ'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='lvmid/j9xOWG-sINY-4NCb-1fyZ-VPIM-gDmN-XlLpQ0/566C3T-I54c-bbpF-Xv7H-qPym-lRsi-iUyxeZ'  e8b9f901-394a-4e77-92ae-b9225214abfe
else
  search --no-floppy --fs-uuid --set=root e8b9f901-394a-4e77-92ae-b9225214abfe
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-e8b9f901-394a-4e77-92ae-b9225214abfe' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  872b5839-0663-4ba0-a408-94ceece5f535
	else
	  search --no-floppy --fs-uuid --set=root 872b5839-0663-4ba0-a408-94ceece5f535
	fi
	echo	'Loading Linux linux-lts ...'
	linux	/vmlinuz-linux-lts root=/dev/mapper/vg0-lv_root rw  cryptdevice=/dev/nvme0n1p3:vg0:allow-discards loglevel=3 quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-linux-lts.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-e8b9f901-394a-4e77-92ae-b9225214abfe' {
	menuentry 'Arch Linux, with Linux linux-lts' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-advanced-e8b9f901-394a-4e77-92ae-b9225214abfe' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  872b5839-0663-4ba0-a408-94ceece5f535
		else
		  search --no-floppy --fs-uuid --set=root 872b5839-0663-4ba0-a408-94ceece5f535
		fi
		echo	'Loading Linux linux-lts ...'
		linux	/vmlinuz-linux-lts root=/dev/mapper/vg0-lv_root rw  cryptdevice=/dev/nvme0n1p3:vg0:allow-discards loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/initramfs-linux-lts.img
	}
	menuentry 'Arch Linux, with Linux linux-lts (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-fallback-e8b9f901-394a-4e77-92ae-b9225214abfe' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  872b5839-0663-4ba0-a408-94ceece5f535
		else
		  search --no-floppy --fs-uuid --set=root 872b5839-0663-4ba0-a408-94ceece5f535
		fi
		echo	'Loading Linux linux-lts ...'
		linux	/vmlinuz-linux-lts root=/dev/mapper/vg0-lv_root rw  cryptdevice=/dev/nvme0n1p3:vg0:allow-discards loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/initramfs-linux-lts-fallback.img
	}
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-e8b9f901-394a-4e77-92ae-b9225214abfe' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  872b5839-0663-4ba0-a408-94ceece5f535
		else
		  search --no-floppy --fs-uuid --set=root 872b5839-0663-4ba0-a408-94ceece5f535
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=/dev/mapper/vg0-lv_root rw  cryptdevice=/dev/nvme0n1p3:vg0:allow-discards loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-e8b9f901-394a-4e77-92ae-b9225214abfe' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  872b5839-0663-4ba0-a408-94ceece5f535
		else
		  search --no-floppy --fs-uuid --set=root 872b5839-0663-4ba0-a408-94ceece5f535
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=/dev/mapper/vg0-lv_root rw  cryptdevice=/dev/nvme0n1p3:vg0:allow-discards loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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 change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

mkinitcpio.conf:

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

blkid:

[root@archiso /]# blkid
/dev/nvme0n1p1: UUID="4E45-0139" TYPE="vfat" PARTUUID="27d4c4f1-f4e8-1f49-beca-04fb7b1763b3"
/dev/nvme0n1p2: UUID="872b5839-0663-4ba0-a408-94ceece5f535" TYPE="ext4" PARTUUID="04d0c099-e54a-754c-a158-6660a6e2a7c6"
/dev/nvme0n1p3: UUID="9814f284-a529-4e9d-b707-8a3c448d7aa3" TYPE="crypto_LUKS" PARTUUID="7dc20922-cc4a-9643-9a4c-f139d6603cad"
/dev/sda1: UUID="2019-11-01-16-33-14-00" LABEL="ARCH_201911" TYPE="iso9660" PTUUID="65cc13ea" PTTYPE="dos" PARTUUID="65cc13ea-01"
/dev/sda2: SEC_TYPE="msdos" LABEL_FATBOOT="ARCHISO_EFI" LABEL="ARCHISO_EFI" UUID="E058-601A" TYPE="vfat" PARTUUID="65cc13ea-02"
/dev/loop0: TYPE="squashfs"
/dev/mapper/lvm: UUID="uQzYx6-N6QF-xJRx-06Sk-9ZWl-eeaJ-6vPoen" TYPE="LVM2_member"
/dev/mapper/vg0-lv_root: UUID="e8b9f901-394a-4e77-92ae-b9225214abfe" TYPE="ext4"
/dev/mapper/vg0-lv_home: UUID="ebf0feaf-03e2-4ecf-b8f4-67928532a55c" TYPE="ext4"

Last edited by hexated (2019-11-06 06:24:51)

Offline

#17 2019-11-06 07:08:44

kermit63
Member
Registered: 2018-07-04
Posts: 4

Re: [Solved] LUKS LVM cannot be found on boot

Did you install the lvm2 package after pacstrap? I think this is one of the packages removed from the 'base' package, so you need to install it explicitly before exiting arch-chroot.

Offline

#18 2019-11-06 07:18:24

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

Installing lvm2 separately fixed the problem with being unable to find the LUKS LVM thank you. However, I'm confused as the repo says that base still includes lvm2 here .

Offline

#19 2019-11-06 16:07:25

ngenisis
Member
Registered: 2019-11-06
Posts: 1

Re: [Solved] LUKS LVM cannot be found on boot

The new installation guide has "The base package does not include all tools from the live installation, so installing other packages may be necessary for a fully functional base system. In particular, consider installing: ... utilities for accessing RAID or LVM partitions", but the article for LVM doesn't have a section describing how to install LVM utilities because it used to be in base. I've been meaning to update the Wiki but I haven't had the time

Offline

#20 2019-11-06 17:46:15

hexated
Member
Registered: 2019-08-17
Posts: 13

Re: [Solved] LUKS LVM cannot be found on boot

My bad then, I should have checked the new installation guide for updates. Thank you for your help.

Offline

Board footer

Powered by FluxBB