You are not logged in.

#1 2014-12-08 06:35:29

bovis
Member
Registered: 2009-01-25
Posts: 22

[SOLVED] LVM on Luks cannot find device

A fresh installation of Arch with LVM on Luks as per the instructions here (https://wiki.archlinux.org/index.php/Dm … VM_on_LUKS) seems to go well throughout until I restart.

The system boots to GRUB but gives me an error when starting:

ERROR: resume: hibernation device 'dev/mapper/MyStorage-swapvol' not found
ERROR: device '/dev/mapper/MyStorage-rootvol' not found. Skipping fsck.
ERROR: Unable to find root device '/dev/mapper/MyStorage-rootvol'.

I am then dropped into a recovery shell.

My mkinitcpio.conf hooks for encrypt, lvm2, and resume are included along with the necessary changes to kernel parameters. My cryptdevice is listed with its UUID.

I can provide more system details as necessary. I'm posting this from a separate machine, so I can grab files/code from the encrypted machine as needed.

I'm not sure where to go from here as far as troubleshooting. I've looked over everything three times with no success. Any help is appreciated. Thanks.

Last edited by bovis (2014-12-10 00:52:23)

Offline

#2 2014-12-08 13:03:43

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 275

Re: [SOLVED] LVM on Luks cannot find device

Shaving a similar issue. See here. LVM2/device-mapper seems to be broken again. The new 2.02.114-1 version didn't seem to solve anything. Seems to happen every now and then.

I find it odd that this seems to be the second time I was among the first to discover this. Looks like I am one of just maybe 4 to 5 Archers using full system encryption (and detached LUKS headers too).

I should add I do see my volume group but the associated logical volumes are not being activated.

Last edited by KairiTech (2014-12-08 17:07:16)

Offline

#3 2014-12-08 14:58:51

bovis
Member
Registered: 2009-01-25
Posts: 22

Re: [SOLVED] LVM on Luks cannot find device

* Edited to insert UUIDs 2014-12-09 *

As a followup, here are my fstab, grub, and mkinitcpio.conf.

Also, note that /dev/sda1 and /dev/sda2 are Windows. /dev/sda3 is a primary partition as /boot/. And /dev/sda4 is a primary where the mapper volumes are located.

fstab:

# /dev/mapper/MyStorage-rootvol
UUID=b8d6c4c3-b69b-4912-b26c-909d4eb912c7	/         	ext4      	rw,relatime,data=ordered	0 1

# /dev/mapper/MyStorage-homevol
UUID=1d953a31-a19b-49c5-8bf4-7b4598b0090d	/home     	ext4      	rw,relatime,data=ordered	0 2

# /dev/mapper/MyStorage-tmpvol
UUID=5fcd20fd-209f-4a2e-b16d-35b06d101398	/tmp      	ext4      	rw,relatime,data=ordered	0 2

# /dev/mapper/MyStorage-varvol
UUID=de6b0220-1975-4e52-958f-7d2bc143972b	/var      	ext4      	rw,relatime,data=ordered	0 2

# /dev/sda3
UUID=70ea6e21-3a38-4d66-973b-b0200f10c746	/boot     	ext4      	rw,relatime,data=ordered	0 2

# /dev/mapper/MyStorage-swapvol
UUID=07ec871a-2885-4a79-a943-b21ea6501797	none      	swap      	defaults  	0 0

grub.conf

#
# 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 loadfont unicode ; 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-b8d6c4c3-b69b-4912-b26c-909d4eb912c7' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos 
	insmod ext2
	set root='hd0,msdos3'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  70ea6e21-3a38-4d66-973b-b0200f10c746
	else
	  search --no-floppy --fs-uuid --set=root 70ea6e21-3a38-4d66-973b-b0200f10c746
	fi
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=b8d6c4c3-b69b-4912-b26c-909d4eb912c7 rw  cryptdevice=b8d6c4c3-b69b-4912-b26c-909d4eb912c7:MyStorage root=/dev/mapper/MyStorage-rootvol resume=/dev/mapper/MyStorage-swapvol quiet
	echo	'Loading initial ramdisk ...'
	initrd	 /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-b8d6c4c3-b69b-4912-b26c-909d4eb912c7' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-b8d6c4c3-b69b-4912-b26c-909d4eb912c7' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos 
		insmod ext2
		set root='hd0,msdos3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  70ea6e21-3a38-4d66-973b-b0200f10c746
		else
		  search --no-floppy --fs-uuid --set=root 70ea6e21-3a38-4d66-973b-b0200f10c746
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=b8d6c4c3-b69b-4912-b26c-909d4eb912c7 rw  cryptdevice=b8d6c4c3-b69b-4912-b26c-909d4eb912c7:MyStorage root=/dev/mapper/MyStorage-rootvol resume=/dev/mapper/MyStorage-swapvol 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-b8d6c4c3-b69b-4912-b26c-909d4eb912c7' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos 
		insmod ext2
		set root='hd0,msdos3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  70ea6e21-3a38-4d66-973b-b0200f10c746
		else
		  search --no-floppy --fs-uuid --set=root 70ea6e21-3a38-4d66-973b-b0200f10c746
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=b8d6c4c3-b69b-4912-b26c-909d4eb912c7 rw  cryptdevice=b8d6c4c3-b69b-4912-b26c-909d4eb912c7:MyStorage root=/dev/mapper/MyStorage-rootvol resume=/dev/mapper/MyStorage-swapvol 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 ###
menuentry 'Windows Vista (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-4A7A4BD67A4BBD87' {
	insmod part_msdos 
	insmod ntfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  4A7A4BD67A4BBD87
	else
	  search --no-floppy --fs-uuid --set=root 4A7A4BD67A4BBD87
	fi
	chainloader +1
}
### 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 ###

### BEGIN /etc/grub.d/60_memtest86+ ###
### END /etc/grub.d/60_memtest86+ ###

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 resume 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=""

Last edited by bovis (2014-12-09 15:12:12)

Offline

#4 2014-12-09 06:33:35

bovis
Member
Registered: 2009-01-25
Posts: 22

Re: [SOLVED] LVM on Luks cannot find device

Further testing. I downgraded and ran together device-mapper-2.02.112-1 and lvm2-2.02.112-1 and received the same error as in my original post.

Same result running device-mapper-2.02.111-1 and lvm2-2.02.111-1 together.

The current version of each is 2.02.114-1 as of 2014-12-03.

KairiTech suggested that an upgrade in recent packages (here) could have caused the problem. Downgrades of at least these two packages alone don't seem to fix it.

Offline

#5 2014-12-09 07:54:29

th3voic3
Member
Registered: 2012-03-20
Posts: 92

Re: [SOLVED] LVM on Luks cannot find device

I recently switched to the systemd lvm and encrypt hooks following these instructions and I don't have the issue. Maybe that is a workaround?

Offline

#6 2014-12-09 10:56:41

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,482

Re: [SOLVED] LVM on Luks cannot find device

bovis, removing the UUIDs does not help if you want anyone to check you use the correct ones. In any case, the only UUID you optionally need to use in your kernel line is for cryptdevice= .. in your above config you list two root= entries:

linux	/vmlinuz-linux root=UUID=(UUID) rw  cryptdevice=(UUID):MyStorage root=/dev/mapper/MyStorage-rootvol resume=/dev/mapper/MyStorage-swapvol quiet

delete the one with the UUID. Any /dev/mapper/ in the kernel line are distinct in themselves. they will will never open the wrong one because the cryptdevice=UUID= to make the mapper's available is distinct in itself.
edit: and to boot from the recovery shell, try:

# vgscan
# vgchange -ay
# exit

Last edited by Strike0 (2014-12-09 11:02:36)

Offline

#7 2014-12-09 15:22:20

bovis
Member
Registered: 2009-01-25
Posts: 22

Re: [SOLVED] LVM on Luks cannot find device

Strike0:

My UUIDs are now in place in the code above. The values in GRUB match those in the fstab as they should.

I tried to boot after removing the first root=UUID=(UUID) and leaving the cryptdevice... value. No success. Same errors.

Turning on boot debugging with the kernel parameters verbose, debug, and ignore_loglevel (3 separate boots) revealed nothing of note.

Also, vgscan commands do not work from the recovery shell.

Offline

#8 2014-12-09 15:30:42

bovis
Member
Registered: 2009-01-25
Posts: 22

Re: [SOLVED] LVM on Luks cannot find device

th3voic3 wrote:

I recently switched to the systemd lvm and encrypt hooks following these instructions and I don't have the issue. Maybe that is a workaround?

Did you experience a similar problem with not being able to boot before that switch to the different hooks? You mention that it solved your issue with resume not working. I'm not even able to boot yet to try the resume, so I'm not sure if that's the right step for me at this point.

Offline

#9 2014-12-09 23:55:17

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,482

Re: [SOLVED] LVM on Luks cannot find device

bovis wrote:

My UUIDs are now in place in the code above. The values in GRUB match those in the fstab as they should.

Well, no, not the cryptdevice, your fstab does not list the volume group, does it?
wink

bovis wrote:

I tried to boot after removing the first root=UUID=(UUID) and leaving the cryptdevice... value. No success. Same errors.

You got a couple errors in your cryptdevice= declaration:
- the UUID you use is of the root device, that's not equal to the UUID of the LVM volume group.
- the UUID either has to be specified like I wrote in above post (=UUID=) or through the /dev/disk/by-uuid/ ...

bovis wrote:

Also, vgscan commands do not work from the recovery shell.

yes, could not work because of the wrong cryptdevice declaration. in recovery, open it first with

cryptsetup open /dev/sda4 MyStorage 

and try them again then please.

Offline

#10 2014-12-10 00:49:37

bovis
Member
Registered: 2009-01-25
Posts: 22

Re: [SOLVED] LVM on Luks cannot find device

Changing the UUID to the one associated with /dev/sda4 and not with the mapper root worked.

blkid /dev/sdXY

^^ for anyone reading this who needs a uuid (run as root)

By the way, upgrading lvm2, device-mapper, and systemd also worked without a hitch. The root was found with downgraded and upgraded packages, so there is no problem with those.

Thanks for the help, Strike0. I'll mark this as solved.

Offline

Board footer

Powered by FluxBB