You are not logged in.

#1 2011-11-08 08:42:30

Harey
Member
From: Bavaria, Germany
Registered: 2007-03-24
Posts: 374

kernel updates kill my luks encrypted system

All right, this is weird. I have a 64bit system with encrypted root, home and  swap partitions. To setup I followed the wiki here:
https://wiki.archlinux.org/index.php/LUKS
My swap is encrypted like described here:
https://wiki.archlinux.org/index.php/LU … sk_support

Since the updates to kernel 3.1 each new kernel update kills my system. Pacman says while upgrading

[2011-11-08 08:21] >>> Updating module dependencies. Please wait ...                                                                   
[2011-11-08 08:21] >>> Generating initial ramdisk, using mkinitcpio.  Please wait...
[2011-11-08 08:21] ==> Building image from preset: 'default'
[2011-11-08 08:21]   -> -k /boot/vmlinuz-linux_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img_64
[2011-11-08 08:21] ==> Starting build: 3.1.0-3-ARCH
[2011-11-08 08:21]   -> Parsing hook: [base]
[2011-11-08 08:21]   -> Parsing hook: [udev]
[2011-11-08 08:21]   -> Parsing hook: [autodetect]
[2011-11-08 08:21]   -> Parsing hook: [pata]
[2011-11-08 08:21]   -> Parsing hook: [scsi]
[2011-11-08 08:21]   -> Parsing hook: [sata]
[2011-11-08 08:21]   -> Parsing hook: [usbinput]
[2011-11-08 08:21]   -> Parsing hook: [keymap]
[2011-11-08 08:21]   -> Parsing hook: [usb]
[2011-11-08 08:21]   -> Parsing hook: [encrypt]
[2011-11-08 08:21]   -> Parsing hook: [openswap]
[2011-11-08 08:21]   -> Parsing hook: [resume]
[2011-11-08 08:21]   -> Parsing hook: [filesystems]
[2011-11-08 08:21] ==> Creating gzip initcpio image: /boot/initramfs-linux.img_64
[2011-11-08 08:21] ==> Image generation successful
[2011-11-08 08:21] ==> Building image from preset: 'fallback'
[2011-11-08 08:21]   -> -k /boot/vmlinuz-linux_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img_64 -S autodetect
[2011-11-08 08:21] ==> Starting build: 3.1.0-3-ARCH
[2011-11-08 08:21]   -> Parsing hook: [base]
[2011-11-08 08:21]   -> Parsing hook: [udev]
[2011-11-08 08:21]   -> Parsing hook: [pata]
[2011-11-08 08:21]   -> Parsing hook: [scsi]
[2011-11-08 08:21]   -> Parsing hook: [sata]
[2011-11-08 08:21]   -> Parsing hook: [usbinput]
[2011-11-08 08:21]   -> Parsing hook: [keymap]
[2011-11-08 08:21]   -> Parsing hook: [usb]
[2011-11-08 08:21]   -> Parsing hook: [encrypt]
[2011-11-08 08:21]   -> Parsing hook: [openswap]
[2011-11-08 08:21]   -> Parsing hook: [resume]
[2011-11-08 08:21]   -> Parsing hook: [filesystems]
[2011-11-08 08:21] ==> Creating gzip initcpio image: /boot/initramfs-linux-fallback.img_64
[2011-11-08 08:21] ==> Image generation successful

So the generation of the initramfs seems to be ok.
But when I reboot this box, I get:

running hook [openswap]
device /dev/sda4 doesn't exist or access denied
running hook [resume]
waiting 10 seconds for device /dev/mapper/swapDevice
waiting 10 seconds for device /dev/mapper/root
root device /dev/mapper/root doesn't exist. Attempting to create it.
ERROR: unable to determine major/minor number of root device /dev/mapper/root

/dev/sda4 is my swap partition. Then I get dropped to a recovery shell which I can't use because my (usb) keyboard is not working.

Now the funny part. I start the box from a install cd and chroot into the existing installation. I do a

mkinitcpio -p linux

The initramfs is regenerated and it works again! What the hell is pacman doing other than regenerate the initramfs with my presets?

Harvey

Last edited by Harey (2011-11-12 16:10:48)


Linux is like a wigwam: No Gates, no Windows and an Apache inside

Offline

#2 2011-11-08 14:10:49

eworm
Package Maintainer (PM)
From: Oberhausen, Germany
Registered: 2010-01-30
Posts: 107
Website

Re: kernel updates kill my luks encrypted system

I is /sys mounted? mkinitcpio reads from there and decides what modules are needed.
If the boot fails... Does booting the fallback initrd work?


ArchLinux - make it simple & lightweight

Offline

#3 2011-11-08 14:31:14

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: kernel updates kill my luks encrypted system

It'd be beneficial to actually look at what's in the created "bad" image rather than guessing at what might be wrong. Use lsinitcpio to poke around.

Offline

#4 2011-11-08 15:03:33

Harey
Member
From: Bavaria, Germany
Registered: 2007-03-24
Posts: 374

Re: kernel updates kill my luks encrypted system

falconindy wrote:

It'd be beneficial to actually look at what's in the created "bad" image rather than guessing at what might be wrong. Use lsinitcpio to poke around.

Agreed. But

[harvey@obelix ~]$ lsinitcpio -x /boot/vmlinuz-linux_64 
bsdcpio: Unrecognized archive format: Invalid or incomplete multibyte or wide character

I have chosen no compression in /etc/mkinitcpio.conf.

@eworm: The fallback image fails with the same error, /sys is mounted when pacman regenerates the image during the update. When chrooting in I mount sys as well by

mount -t sysfs sys sys/

Harvey


Linux is like a wigwam: No Gates, no Windows and an Apache inside

Offline

#5 2011-11-08 15:42:11

eworm
Package Maintainer (PM)
From: Oberhausen, Germany
Registered: 2010-01-30
Posts: 107
Website

Re: kernel updates kill my luks encrypted system

Harey wrote:
[harvey@obelix ~]$ lsinitcpio -x /boot/vmlinuz-linux_64 
bsdcpio: Unrecognized archive format: Invalid or incomplete multibyte or wide character

You should look at the initrd, not the kernel image:

lsinitcpio -a /boot/initramfs-linux.img_64

ArchLinux - make it simple & lightweight

Offline

#6 2011-11-08 17:11:17

Harey
Member
From: Bavaria, Germany
Registered: 2007-03-24
Posts: 374

Re: kernel updates kill my luks encrypted system

eworm wrote:

You should look at the initrd, not the kernel image:

lsinitcpio -a /boot/initramfs-linux.img_64

Damn, my bad. Ok, but here comes the funny part. I tried to provoke the error again by

pacman -S linux

but the reboot was fine. No errors here. I guess I have to wait for the next kernel update. Unfortunately I have deleted the faulty initramfs image when chrooting in at first.

I will have a closer look on the other packages in todays update. Maybe there is something else interesting here.

Harvey


Linux is like a wigwam: No Gates, no Windows and an Apache inside

Offline

#7 2011-11-09 00:46:24

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: kernel updates kill my luks encrypted system

Please paste an excerpt from /var/log/pacman.log from the last upgrade that failed, including all package updates made before and after the 'linux' package.

Offline

#8 2011-11-09 08:18:14

Harey
Member
From: Bavaria, Germany
Registered: 2007-03-24
Posts: 374

Re: kernel updates kill my luks encrypted system

It's not much. I upgrade on a daily basis...

[2011-11-08 08:20] Running 'pacman -Syu'                                                                                               
[2011-11-08 08:20] synchronizing package lists                                                                                         
[2011-11-08 08:20] starting full system upgrade                                                                                        
[2011-11-08 08:21] >>> Updating module dependencies. Please wait ...                                                                   
[2011-11-08 08:21] >>> Generating initial ramdisk, using mkinitcpio.  Please wait...                                                   
[2011-11-08 08:21] ==> Building image from preset: 'default'                                                                           
[2011-11-08 08:21]   -> -k /boot/vmlinuz-linux_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img_64                              
[2011-11-08 08:21] ==> Starting build: 3.1.0-3-ARCH
[2011-11-08 08:21]   -> Parsing hook: [base]
[2011-11-08 08:21]   -> Parsing hook: [udev]
[2011-11-08 08:21]   -> Parsing hook: [autodetect]
[2011-11-08 08:21]   -> Parsing hook: [pata]
[2011-11-08 08:21]   -> Parsing hook: [scsi]
[2011-11-08 08:21]   -> Parsing hook: [sata]
[2011-11-08 08:21]   -> Parsing hook: [usbinput]
[2011-11-08 08:21]   -> Parsing hook: [keymap]
[2011-11-08 08:21]   -> Parsing hook: [usb]
[2011-11-08 08:21]   -> Parsing hook: [encrypt]
[2011-11-08 08:21]   -> Parsing hook: [openswap]
[2011-11-08 08:21]   -> Parsing hook: [resume]
[2011-11-08 08:21]   -> Parsing hook: [filesystems]
[2011-11-08 08:21] ==> Creating gzip initcpio image: /boot/initramfs-linux.img_64
[2011-11-08 08:21] ==> Image generation successful
[2011-11-08 08:21] ==> Building image from preset: 'fallback'
[2011-11-08 08:21]   -> -k /boot/vmlinuz-linux_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img_64 -S autodetect
[2011-11-08 08:21] ==> Starting build: 3.1.0-3-ARCH
[2011-11-08 08:21]   -> Parsing hook: [base]
[2011-11-08 08:21]   -> Parsing hook: [udev]
[2011-11-08 08:21]   -> Parsing hook: [pata]
[2011-11-08 08:21]   -> Parsing hook: [scsi]
[2011-11-08 08:21]   -> Parsing hook: [sata]
[2011-11-08 08:21]   -> Parsing hook: [usbinput]
[2011-11-08 08:21]   -> Parsing hook: [keymap]
[2011-11-08 08:21]   -> Parsing hook: [usb]
[2011-11-08 08:21]   -> Parsing hook: [encrypt]
[2011-11-08 08:21]   -> Parsing hook: [openswap]
[2011-11-08 08:21]   -> Parsing hook: [resume]
[2011-11-08 08:21]   -> Parsing hook: [filesystems]
[2011-11-08 08:21] ==> Creating gzip initcpio image: /boot/initramfs-linux-fallback.img_64
[2011-11-08 08:21] ==> Image generation successful
[2011-11-08 08:21] upgraded linux (3.1-3 -> 3.1-4)
[2011-11-08 08:22] upgraded linux-headers (3.1-3 -> 3.1-4)
[2011-11-08 08:22] upgraded udev (174-1 -> 175-1)
[2011-11-08 08:22] In order to use the new version, reload all virtualbox modules manually.
[2011-11-08 08:22] upgraded virtualbox-modules (4.1.6-1 -> 4.1.6-2)
[2011-11-08 08:22] upgraded virtualbox (4.1.6-1 -> 4.1.6-2)

The following reboot (right after updating) failed as described.

Harvey


Linux is like a wigwam: No Gates, no Windows and an Apache inside

Offline

#9 2011-11-12 16:06:23

Harey
Member
From: Bavaria, Germany
Registered: 2007-03-24
Posts: 374

Re: kernel updates kill my luks encrypted system

New kernel 3.1.1 did it again. My system hangs in initramfs after the reboot. Same as before: a simple rebuild without any changes fixed the boot process. This time I was able to backup the 'bad' initramfs before chrooting in and rebuilding.
it is very funny to see the content of the 'bad' initramfs image - it is nearly empty!

==> Image: /boot/initramfs-linux.img_64.bak
==> Kernel: unknown
==> Compressed with: gzip
  -> Compression ratio: .452
  -> Estimated decompression time: 0.036s

==> Included binaries:
  /sbin/dmsetup
  /sbin/cryptsetup
  /sbin/udevadm
  /sbin/blkid
  /sbin/modprobe
  /bin/busybox

==> Hook run order:
  udev
  keymap
  encrypt
  openswap
  resume

The rebuilt image looks like this:

==> Image: /boot/initramfs-linux.img_64
==> Kernel: 3.1.1-1-ARCH
==> Compressed with: gzip
  -> Compression ratio: .593
  -> Estimated decompression time: 0.047s

==> Included modules:
  aes_generic		  fcrypt		  hid-roccat-kone	  rmd160
  aesni-intel		  ff-memless		  hid-roccat-koneplus	  rmd256
  aes-x86_64		  gcm			  hid-roccat-kovaplus	  rmd320
  af_alg		  gf128mul		  hid-roccat-pyra	  salsa20_generic
  ahci			  ghash-clmulni-intel	  hid-samsung		  salsa20-x86_64
  algif_hash		  ghash-generic		  hid-sjoy		  scsi_mod
  algif_skcipher	  hid			  hid-sony		  sd_mod
  ansi_cprng		  hid-a4tech		  hid-speedlink		  seed
  anubis		  hid-apple		  hid-sunplus		  seqiv
  arc4			  hid-axff		  hid-tmff		  serpent
  async_memcpy		  hid-belkin		  hid-topseed		  sha1_generic
  async_pq		  hid-cherry		  hid-twinhan		  sha256_generic
  async_raid6_recov	  hid-chicony		  hid-uclogic		  sha512_generic
  async_tx		  hid-cypress		  hid-wacom		  snd
  async_xor		  hid-dr		  hid-waltop		  snd-rawmidi
  ata_piix		  hid-elecom		  hid-wiimote		  snd-seq-device
  authenc		  hid-emsff		  hid-zpff		  soundcore
  authencesn		  hid-ezkey		  hid-zydacron		  sr_mod
  blowfish		  hid-gaff		  hifn_795x		  syscopyarea
  camellia		  hid-gyration		  hmac			  sysfillrect
  cast5			  hid-holtekff		  jbd2			  sysimgblt
  cast6			  hid-kensington	  khazad		  tcrypt
  cbc			  hid-keytouch		  lcd			  tea
  ccm			  hid-kye		  libahci		  tgr192
  cdrom			  hid-lcpower		  libata		  twofish_common
  crc16			  hid-logitech		  lrw			  twofish_generic
  crc32c		  hid-magicmouse	  lzo			  twofish-x86_64
  crc32c-intel		  hid-microsoft		  mbcache		  uhci-hcd
  cryptd		  hid-monterey		  md4			  usbcore
  crypto_null		  hid-multitouch	  md5			  usbhid
  ctr			  hid-ntrig		  michael_mic		  usb-storage
  cts			  hid-ortek		  padlock-aes		  vmac
  deflate		  hid-petalynx		  padlock-sha		  wp512
  des_generic		  hid-picolcd		  pata_acpi		  xcbc
  dm-crypt		  hid-pl		  pata_jmicron		  xor
  dm-mod		  hid-prodikeys		  pcbc			  xts
  ecb			  hid-quanta		  pcrypt		  zlib
  ehci-hcd		  hid-roccat		  raid6_pq		  zlib_deflate
  ext4			  hid-roccat-arvo	  raid6test
  fb_sys_fops		  hid-roccat-common	  rmd128

==> Included binaries:
  /bin/busybox
  /sbin/udevadm
  /sbin/dmsetup
  /sbin/blkid
  /sbin/cryptsetup
  /sbin/modprobe

==> Hook run order:
  udev
  keymap
  encrypt
  openswap
  resume

For some reason the initramfs built by pacman is missing all modules. To say it again, nothing changed, simple rebuilt by mkinitcpio -p linux!

This seems to be a bad bug... hmm

Harvey

Last edited by Harey (2011-11-12 16:07:09)


Linux is like a wigwam: No Gates, no Windows and an Apache inside

Offline

#10 2011-11-12 16:56:58

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: kernel updates kill my luks encrypted system

-k /boot/vmlinuz-linux_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img_64

Still have no idea how your kernel is named as such. That's not the official Arch package's name. There's something you have yet to tell us about your setup.

Offline

#11 2011-11-12 17:06:44

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: kernel updates kill my luks encrypted system

My rule is: always rebuild initramfs even when no new kernel is installed after upgraded relevant packages, to keep binaries and other file in sync. (the most important is udev).

Offline

#12 2011-11-12 22:01:16

Harey
Member
From: Bavaria, Germany
Registered: 2007-03-24
Posts: 374

Re: kernel updates kill my luks encrypted system

This is a dual boot 32bit / 64bit archlinux system with one boot partition as desribed here:
https://bbs.archlinux.org/viewtopic.php?id=84584
This configuration has beeen working until recent.

Harvey


Linux is like a wigwam: No Gates, no Windows and an Apache inside

Offline

Board footer

Powered by FluxBB