You are not logged in.

#1 2012-02-11 02:08:51

maahes
Member
Registered: 2012-02-09
Posts: 12

Unable to find lvm volumes -- Unable to determine major/minor number

I shall try to describe my issue as thoroughly as possible: I have an x86_64 arch install with lvm2 and encrypted root and home dirs, the format is:

/boot
lvm
->crypt-pool
-->crypt-root
-->crypt-home

I am unable to boot at all. The error I get is: Unable to find lvm, followed by "Unable to determine major/minor on root device."

So far, in order to fix this I have tried all of the following:

1.) upgraded my kernel and mkinitcpio.
2.) manually regenerated my mkinitcpio and confirmed it matched my kernel, and had modules.
3.) generated a grub.cfg for /boot (not sure if it's necessary for the bootloader...but it wasn't there, so I made one), and regenerated the grub.cfg in /root/boot/grub/
4.) Changed the order of hooks in mkinitcpio.conf, it had lvm2 listed after encrypt.

That last one is interesting, in that, even though I have changed the order, when the boot fails, and it drops me into ramfs, if I look at mkinitcpio.conf there, the hooks are in the wrong order. If I try to edit the file at all everything screws up and it tells me ":q" in vi is not implemented, and I can't exit out of vi. Edit: according to #grub, this has to do with initramfs scripts, not grub.

I also tried changing the insmod order in both grub configs, it seemed to make no difference. And just in case the grub.cfg in /boot was extraneous I tried booting both with and without it.

I am at a complete loss of what to do next, please help.

forgot relevant files:

#
# 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
set default="0"
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 {
true
}

set menu_color_normal=light-blue/black
set menu_color_highlight=light-cyan/blue

terminal_input console
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux, with Linux linux' --class archlinux --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod cryptodisk
	insmod luks
	insmod gcry_rijndael
	insmod gcry_rijndael
	insmod gcry_sha1
	insmod lvm
	insmod ext2
	set root='lvm/cryptpool-cryptroot'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint='lvm/cryptpool-cryptroot'  350b7e59-07d4-4b53-8647-2ee202b3cd89
	else
	  search --no-floppy --fs-uuid --set=root 350b7e59-07d4-4b53-8647-2ee202b3cd89
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=/dev/mapper/cryptpool-cryptroot ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux Fallback' --class archlinux --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod cryptodisk
	insmod luks
	insmod gcry_rijndael
	insmod gcry_rijndael
	insmod gcry_sha1
	insmod lvm
	insmod ext2
	set root='lvm/cryptpool-cryptroot'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint='lvm/cryptpool-cryptroot'  350b7e59-07d4-4b53-8647-2ee202b3cd89
	else
	  search --no-floppy --fs-uuid --set=root 350b7e59-07d4-4b53-8647-2ee202b3cd89
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=/dev/mapper/cryptpool-cryptroot ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/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/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### 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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
# 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 first, so it may be used to
# override the actual binaries used in a given hook.
# (Existing files are NOT overwritten if already added)
# 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.
# Some users may wish to include modprobe.conf for custom module options
# like so:
#    FILES="/etc/modprobe.d/modprobe.conf"
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 pata scsi sata filesystems"
#
##   This is identical to the above, except the old ide subsystem is
##   used for IDE devices instead of the new pata subsystem.
#    HOOKS="base udev autodetect ide scsi sata filesystems"
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS="base udev pata scsi sata usb 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 pata mdadm encrypt filesystems"
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS="base udev usb lvm2 filesystems"
HOOKS="base udev autodetect pata scsi sata keymap lvm2 encrypt filesystems usbinput"

# COMPRESSION
# Use this to compress the initramfs image. With kernels earlier than
# 2.6.30, only gzip is supported, which is also the default. Newer kernels

Last edited by maahes (2012-02-11 03:00:38)

Offline

#2 2012-02-11 02:37:06

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Unable to find lvm volumes -- Unable to determine major/minor number

maahes wrote:

4.) Changed the order of hooks in mkinitcpio.conf, it had lvm2 listed after encrypt.

That last one is interesting, in that, even though I have changed the order, when the boot fails, and it drops me into ramfs, if I look at mkinitcpio.conf there, the hooks are in the wrong order. If I try to edit the file at all everything screws up and it tells me ":q" in vi is not implemented, and I can't exit out of vi.

After you changed the order of the hooks, did you run mkinitcpio again to regenerate your initramfs?

sudo mv /boot/initramfs-linux.img{,_bk} && sudo mkinitcpio -g /boot/initramfs-linux.img

(Certainly, you'll need to modify this line of code if your grub is expecting some other name for your initramfs.)

Offline

#3 2012-02-11 05:05:05

maahes
Member
Registered: 2012-02-09
Posts: 12

Re: Unable to find lvm volumes -- Unable to determine major/minor number

did so now, only now I'm getting a slightly different error: could not find udevd no such file or directory. I checked both grub.cfg's and my mkinitcpio.conf and there's no listing for udevd ....which I've never heard of, so I assumed it was a typo?

For clarification: udev is in the mkinitcpio.

Edit: Google confirms this is indeed a thing.Adding and trying again.
Edit: mkinitcpio says not found as a hook when generating an image, assuming its a userspace daemon?

Last edited by maahes (2012-02-11 05:37:24)

Offline

#4 2012-02-11 05:34:35

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Unable to find lvm volumes -- Unable to determine major/minor number

maahes wrote:

did so now, only now I'm getting a slightly different error: could not find udevd no such file or directory. I checked both grub.cfg's and my mkinitcpio.conf and there's no listing for udevd ....which I've never heard of, so I assumed it was a typo?

For clarification: udev is in the mkinitcpio.

I'm not sure whether I yet have a good intuition for how you have your machine set up, but I suspect you need to include a cryptdevice flag to the kernel in your grub config. The file isn't found because the kernel doesn't know your root directory needs decrypting first.

My setup is an LVM over LUKS over LVM sandwich. To boot into my system, the grub.cfg contains the line:

linux	/vmlinuz-linux root=/dev/mapper/cryptvg-root cryptdevice=/dev/mapper/vg-crypt:root rootfstype=ext4 pcie_aspm=force acpi_osi=Linux acpi_backlight=vendor i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 ro

Now, most of those flags don't have anything to do with your problem, but note the cryptdevice. It tells the kernel it's dealing with an encrypted filesystem sitting in a logical volume called crypt on a volume group called vg. The bit after the colon tells the kernel to associate this encrypted filesystem with /dev/mapper/root.

As for how to fix your system, I'm afraid I still feel a bit fuzzy about how your LVM and encrypted layers relate to each other, whether you have LVM over LUKS, or LUKS over LVM, or something else. Was there a particular how-to that you followed?

Offline

#5 2012-02-11 05:57:03

maahes
Member
Registered: 2012-02-09
Posts: 12

Re: Unable to find lvm volumes -- Unable to determine major/minor number

I used This guide

Which appears to mean I have dm-crypt on top of an lvm. Basically I set it up by walking through the arch installer and setting up the encrypted partitions on top of the lvm. Am I to presume after a recent kernel update that the format for referring to encrypted drives changed?

Offline

#6 2012-02-11 06:22:29

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Unable to find lvm volumes -- Unable to determine major/minor number

maahes wrote:

I used This guide

Which appears to mean I have dm-crypt on top of an lvm. Basically I set it up by walking through the arch installer and setting up the encrypted partitions on top of the lvm. Am I to presume after a recent kernel update that the format for referring to encrypted drives changed?

Ah, this makes it clearer.

I haven't used the Arch Installer to make an encrypted LVM setup before. I stole some ideas from aptosid and the manual method and managed to pull it all together with a bit of help from falconindy smile.

If you followed the how-to in the wiki exactly, it says you should have a LVM on LUKS (or dm-crypt) setup. The fact that you have crypt-root and crypt-home sitting inside crypt-pool in your lvm supports this notion. In this case, you do need to have encrypt before lvm2 in your hooks.

I suggest start by reversing the order of those two hooks.

I think you also need the cryptdevice set. Unfortunately, cryptdevice seems to be poorly documented, so on reflection I'm actually not 100% sure what the bit after the colon really does. However, some approximation of the following should be getting close:

linux /boot/vmlinuz-linux root=/dev/mapper/cryptpool-cryptroot cryptdevice=/dev/sda2:crypt-root ro quiet

Offline

#7 2012-02-11 09:20:05

maahes
Member
Registered: 2012-02-09
Posts: 12

Re: Unable to find lvm volumes -- Unable to determine major/minor number

I tried exactly the line you recommended and it won't boot (same errors), I will try permutations of it tomorrow, but I must try and get some sleep now. Thanks for your help smile

Offline

#8 2012-02-11 09:35:25

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Unable to find lvm volumes -- Unable to determine major/minor number

I spot what looks like an inconsistency in the information you provided. First you have this:

maahes wrote:

the format is:

/boot
lvm
->crypt-pool
-->crypt-root
-->crypt-home

Then in your grub configuration, you have,

maahes wrote:
linux	/boot/vmlinuz-linux root=/dev/mapper/cryptpool-cryptroot ro  quiet

I think you either have two many hyphens when describing your setup, or you have not enough hyphens when specifying your root device. I suspect it's the former. In that case, I think you need to change the cryptdevice flag to:

cryptdevice=/dev/sda2:cryptroot

Offline

#9 2012-02-11 22:58:24

maahes
Member
Registered: 2012-02-09
Posts: 12

Re: Unable to find lvm volumes -- Unable to determine major/minor number

Okay, tried that, still no boot. Additionally it freezes at a reboot trying to load the little Arch selection screen, and ramfs no longer works at all. Additionally from a cold boot, it takes twice as long now to bring up the Arch selection menu.

Offline

#10 2012-02-11 23:03:16

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: Unable to find lvm volumes -- Unable to determine major/minor number

Well, I'm out of ideas. Hopefully someone more knowledgeable like falconindy sees this thread and spots the problem smile

Offline

Board footer

Powered by FluxBB