You are not logged in.

#1 2013-06-29 07:20:08

PyroDevil
Member
Registered: 2012-06-25
Posts: 33

[SOLVED] Encrypt-Hook with LVM-on-Crypt fails to encrypt root part...

Hi,

I think that since the mkinitcpio (0.14.0-1) update (and the regeneration of the initramfs for my kernel) the encrypt hook doesn't work anymore. (At least for me)
I have my root filesystem in a LVM, which physical volume is encrypted with luks.

Here are my hooks from /etc/mkinitcpio.conf:

HOOKS="base udev autodetect modconf block keyboard keymap encrypt lvm2 resume filesystems fsck shutdown"

Output when I let it generate the initramfs:

% 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: 3.9.7-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [encrypt]
  -> Running build hook: [lvm2]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
  -> Running build hook: [shutdown]
==> Generating module dependencies
==> Creating gzip 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: 3.9.7-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: bfa
==> WARNING: Possibly missing firmware for module: aic94xx
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [encrypt]
  -> Running build hook: [lvm2]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
  -> Running build hook: [shutdown]
==> Generating module dependencies
==> Creating gzip initcpio image: /boot/initramfs-linux-fallback.img
==> Image generation successful

But I am able to mount in manually within the emergency shell by executing:

$ cryptsetup luksOpen /dev/sda3 system
Enter passphrase for /dev/sda3:
$ lvm vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_system" using metadata type lvm2
$ lvm vgchange -ay
  3 logical volume(s) in volume group "vg_system" now active
$ exit

Last edited by PyroDevil (2013-06-29 11:14:35)


Probably the last man who knew how it worked had been tortured to death years before.
Or as soon as it was installed. Killing the creator was a traditional method of patent protection.
(Small Gods)

Offline

#2 2013-06-29 07:30:40

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Encrypt-Hook with LVM-on-Crypt fails to encrypt root part...

This has nothing to do with the encrypt hook or Luks/dm-crypt.  This is a but in Arch's current lvm2 implementation.  Despite the threads title, it also has nothing to do with encryption... though this also means that a search would have yeilded results.

https://bbs.archlinux.org/viewtopic.php?id=158012

Offline

#3 2013-06-29 07:55:10

PyroDevil
Member
Registered: 2012-06-25
Posts: 33

Re: [SOLVED] Encrypt-Hook with LVM-on-Crypt fails to encrypt root part...

Thanks for the link.

mdias wrote:

ok, I found a temporary workaround that seems to work for me,

I edited the file /usr/lib/initcpio/hooks/lvm2 to add this:

run_hook() {
    lvm pvscan --cache --activate ay
}

Now, this will activate all lvm volumes regardless of lvm.conf, but it suits my needs for now.

This solution didn't work for me.

On boot time I was not asked to enter a password for the encrypted partition.
That's the reason I thought it was the encryption hook.


Probably the last man who knew how it worked had been tortured to death years before.
Or as soon as it was installed. Killing the creator was a traditional method of patent protection.
(Small Gods)

Offline

#4 2013-06-29 08:06:06

PyroDevil
Member
Registered: 2012-06-25
Posts: 33

Re: [SOLVED] Encrypt-Hook with LVM-on-Crypt fails to encrypt root part...

brain0 wrote:

Everyone who is still having trouble, try changing the global filter line in /etc/lvm/lvm.conf from

# global_filter = []

to

global_filter = [ "r|^/dev/fd[0-9]$|", "r|^/dev/sr[0-9]$|" ]

Then run mkinitcpio -p linux again.

I tried this too, but it didn't help either. I think its because my partition doesn't get decrypted, so lvm doesn't find the physical volume.


Probably the last man who knew how it worked had been tortured to death years before.
Or as soon as it was installed. Killing the creator was a traditional method of patent protection.
(Small Gods)

Offline

#5 2013-06-29 11:13:53

PyroDevil
Member
Registered: 2012-06-25
Posts: 33

Re: [SOLVED] Encrypt-Hook with LVM-on-Crypt fails to encrypt root part...

I found the issue!
The grub rename action has rested my "/etc/default/grub" to the default.
Stupid me, I should check for those pacsave more often.

Thanks nevertheless!


Probably the last man who knew how it worked had been tortured to death years before.
Or as soon as it was installed. Killing the creator was a traditional method of patent protection.
(Small Gods)

Offline

Board footer

Powered by FluxBB