[SOLVED] Cant boot crypted device after upgrade to Mageia3

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] Cant boot crypted device after upgrade to Mageia3

Postby htgoebel » May 30th, '13, 13:43

Hi,

after upgrading to Mageia3, I'm no longer able to boot my encrypted system. After some debugging I ended with adding `rdshell rdinitdebug rdbreak=pre-mount` to the kernel command line and at least was able to enter the crypt password.

The command executed (as shown by dracut's debug-output) is
Code: Select all
/bin/plymouth ask-for-password --prompt Password (/dev/sda6) --number-of-tries=5 --command=/sbin/cryptsetup luksOpen -T1 /dev/sda6 crypt_sda6
which looks okay.

After entering the password, I get this error message:
Code: Select all
/dev/mapper/control: open failed: No such device
Failure to communicate with kernel device-mapper driver.
Check that device-mapper is available in the kernel.
Cannot initialize device-mapper. Is dm_mod kernel module loaded?

After entering the password 5 times (see number of tries), drakut continues until it stops with message "sh: 0: can't acess tty; job control turned of".
Now executing
Code: Select all
modprobe dm_mod
yields no error, but running
Code: Select all
/sbin/cryptsetup luksOpen -T1 /dev/sda6 crypt_sda6
still failes with the same error-message. The initrd does not contain `lsmod`, so I can not check whether dm_mod is loaded or not.

Any help?
Last edited by htgoebel on May 31st, '13, 13:04, edited 1 time in total.
htgoebel
 
Posts: 15
Joined: Sep 9th, '11, 20:36

Re: Cant boot crypted device after upgrade to Mageia3

Postby htgoebel » May 31st, '13, 12:48

I was able to recover from this problem.

As I wrote in my original post, fixing the problem in the dracut shell did not succeed in the first try. So I created a rescue-medium, which took we one step further: I was now able to luksOpen the root-partion when in the dracut shell -- which allowed booting my system. Now running `dracut -f`again gave me a working system. :-)

If you are able to luksOpen the root-partion, you may not need to go via the rescue-medium.

Short description
  • Boot from a rescue-disk, mount your partions, chroot there
  • run `dracut -f`
  • reboot
  • if booting still fails, you should be dropped into the dracut shell. There
    • cryptsetup luksOpen your root-device (here crypt_sda6)
    • ln -sf /dev/mapper/crypt_sda6 /dev/root
    • exit # this should continue booting
    • After booting run `drakut -f` again. Now hopefully your system is booting.

Longer description
  • Prepare some rescue CD/USB-Stick. The dual-arch-CD should be fine.
  • Boot from rescue CD/USB-Stick
  • When the rescue-meu shows up "go to the console"
  • modprobe dm_mod
  • cryptsetup luksOpen ...
  • rescue-gui # go back to the rescue-gui
  • Select "Mount your partitions under /mnt" - this is the easiest way, and this is why we use the rescue-gui
  • "Go to the console" again
  • chroot /mnt/
  • dracut -f
  • exit # leave chroot
  • reboot
  • if booting still fails, you should be dropped into the dracut shell again. Following the details instructions from https://www.kernel.org/pub/linux/utils/ ... acut-shell you can continue like this
    • Run `blkid` and identify your root-device
    • UUID=$(cryptsetup luksUUID /dev/mapper/linux-root) # replace "linux-root" with the device you identified
    • cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
    • ln -sf /dev/mapper/luks-$UUID /dev/root
    • exit # this should continue booting
    • This boot may not start the graphics mode (GUI). Press Alt-F2 to get a console to log in.
    • After booting run `drakut -f` again. Now hopefully your system is booting.
htgoebel
 
Posts: 15
Joined: Sep 9th, '11, 20:36

Re: [SOLVED] Cant boot crypted device after upgrade to Magei

Postby morgano » May 31st, '13, 14:19

Thank you for this description. It may come in handy as i will later upgrade two encrypted mga2.

To help even better, could you please post a bug on this, so developers can improve the update process?
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1495
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: [SOLVED] Cant boot crypted device after upgrade to Magei

Postby htgoebel » Jul 19th, '13, 19:58

htgoebel
 
Posts: 15
Joined: Sep 9th, '11, 20:36


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest