PDA

View Full Version : [SOLVED] 14.04: Prepared Disk (LVM/LUKS/LVM), Installed. Reboots to BusyBox; Chroot Fix Fails.



DiagonalArg
May 9th, 2014, 05:46 AM
Hey all - I prepared my disk & did an install of 14.04, but it fails on reboot @busybox. I tried repairs using chroot, but that fails at grub-probe. I'd be grateful for help on either step.

First, I prepared the disk and installed:


Two logical volumes: boot & crypt. The latter is used for LUKS
crypt, unlocked, contains a different volume group with two logical volumes: swap & root.
Installed using ext4 for boot and btrfs for root.


On reboot, at busybox I found cryptsetup didn't even exist in the initramfs. Looking at things with the live-USB, there wasn't a crypttab. So, I did a chroot into the failing system, created a crypttab, and tried to do:


update-grub
update-initramfs

but update-grub returns a lot of:


File descriptor 4 ... leaked on vgs invocation ... /usr/sbin/grub-probe

followed by:


grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map

Here, /dev/sdb is my USB stick. Hmmm.... I'm finding intimations on the web that some of this stuff is related to problems with putting Grub into a logical volume (https://bugs.archlinux.org/task/36349) (but Grub is new enough so that shouldn't be an issue). There are maybe also obscure problems with grub-probe finding the root device (http://edoceo.com/notabene/grub-probe-error-cannot-find-device-for-root).

Questions:


How can I get the installer to recognized that it's installing into an unlocked encrypted disk?
What is going on with grub-probe, and how do I fix it?


Thx/

sobsk
October 14th, 2014, 11:12 PM
Hello, it's already long time since your post, however, it's pretty easy to fix it, you are just probably missing necessary modules in your initramfs. Follow these steps to fix it:
1. chroot into the failing system
2. add ''dm-crypt, aes, xts, sha512'' lines to ''/etc/initramfs-tools/modules'' file
3. create ''/etc/crypttab'' with ''cpart UUID=<uuid of your disk> none luks''.
4. ''update-initramfs -k all -c -v''
5. profit :)

DiagonalArg
November 1st, 2014, 02:28 AM
Dude, I'm gonna try it. I thought it had something to do with BtrFS and had found long, tedious explanations of how to mix LUKS & BtrFS in a root volume. So, (for the moment) I had given up on the move from 12.04. I'll see if it works! (And then I'll see if I can add in RAID and put the LUKS header in the USB stick! :)

DiagonalArg
November 14th, 2014, 11:46 AM
It works!! Didn't need to run update-grub at all. Only update-initramfs, as you said. Only (stupid) error, caused by the fact that's is been so long since I looked at that partially installed system, was that I had to make sure to "cryptsetup luksOpen /dev/volume.group.crypt <name>" where <name> is the same as the name appearing in /etc/crypttab (so the unlocked crypt becomes is /dev/mapper/<name>). Otherwise, update-initramfs does not recognize that it needs to include cryptsetup in the new initramfs.

@sobsk - you have reference to a good writeup on this? I read a lot on initramfs, but clearly there's more to learn.

DiagonalArg
November 14th, 2014, 12:02 PM
For anyone else who's looking at this, I'll add that there is one grub error that appears, but I can still boot with no problem:

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1274320
http://askubuntu.com/questions/468466/why-this-occurs-error-diskfilter-writes-are-not-supported

DiagonalArg
December 13th, 2014, 04:34 AM
I'm trying to build a RAID system now, but I'm unclear on which modules I'll need for that. I'm finding different lists, dm_mirror, dm_raid and dm_region_hash; or maybe just dm_raid and raid1. Can someone clue me in, or at least point me to where I can understand this better?