Re: recent kernels can't access my encrypted disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Uwe Menges wrote:

>   The LUKS part seems to succeed as you can access decrypted volume and see it's 
>   lvm2. And the LVM part doesn't work. Did you try a manual pvscan/vgscan after 
>   you get into the fallback shell?

Unfortunately neither vgscan nor pvscan are in the initramfs.  I tried
adding vgscan manually, approximately like this:

  zcat /boot/initrd.img-2.6.26|cpio -i
  cp /sbin/vgscan sbin
  cp /boot/initrd.img-2.6.26 /boot/initrd.img-2.6.26-aside
  find . | cpio -o | gzip >/boot/initrd.img-2.6.26

However, I only got a message about an incomplete write and a kernel panic.

>   And I neither know your setup nor how LUKS/LVM works behind the curtain in 
>   detail, but CONFIG_DM_UEVENT may be important to trigger exactly the step you 
>   seem to be missing.

I don't have that configured in either 2.6.26 (which fails) or in
2.6.24 (which works okay).

  $ grep UEVENT config-2.6.2*
  config-2.6.24:CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
  config-2.6.24:# CONFIG_DM_UEVENT is not set
  config-2.6.26:CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
  config-2.6.26:# CONFIG_DM_UEVENT is not set

Could that be a new dependency?

Clemens Fruhwirth wrote:
> 
> In my opinion, that points to the LVM2 tools doing something
> odd. Probably compare version numbers of vgchange, but I doubt that
> LVM introduced a bug. Rather check /etc/lvm/lvm.conf in the
> initramfs. It should contain something like
> 
> devices { 
>   scan = [ "/dev/" ]
>   filter = [ "a|^/dev/mapper/|", "a|^/dev/sd|", "a|^/dev/loop|", "r/.*/" ]
>   ..
> }
> 
> The scan line is most likely there, but filters is sometimes fiddled
> with. A string starting with 'a' means accept, 'r' means reject. You
> want the path "a|^/dev/mapper|" to be scanned and not
> rejected. (^/dev/mapper is a regexp). filter = ["a/.*/"] is also ok.

After a boot fails and it drops into a shell, /etc/lvm is an empty
directory.  In an unpacked initramfs (for either kernel), there is no
/etc/lvm at all, nor a file lvm.conf anywhere in the filesystem.  So
either lvm is running without a configuration file, or else it gets
created by some other magic.

After a successful boot, I find this:

  $ grep filter /etc/lvm/lvm.conf 
      # A filter that tells LVM2 to only use a restricted set of devices.
      # The filter consists of an array of regular expressions.  These
      # Don't have more than one filter line active at once: only one gets used.
      # filter = [ "a/.*/" ]
      filter = [ "r|/dev/cdrom|" ]
      # filter = [ "a/loop/", "r/.*/" ]
      # filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]
      # filter = [ "a|^/dev/hda8$|", "r/.*/" ]
      # The results of the filtering are cached on disk to avoid

so it apparently defaults to accepting anything not on a cdrom.  

> If everything fails, copy strace into the initramfs and have a look at
> what's going on when running vgchange.

I'll try this next.  My first attempt at adding a program to an
initramfs failed (above), but I'll investigate further.

          - Jim Van Zandt

---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux