After running apt-get upgrade yesterday and shutting down, I'm no longer able to boot Ubuntu 15.

The last several lines I see during boot are:

Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.

My hard disk is encrypted, so normally I would get a Passphrase prompt here. However, after a little while, I just get:

mdadm: CREATE group disk not found

This message repeats ad infinitum and I'm not able to boot. Same with recovery mode.

I found a few threads about this error, but no solution yet. What can I do to diagnose and fix this problem?

Thank you!

share|improve this question
    
Fairly sure this isn't grub related. – Wolfer Sep 30 '15 at 15:12
    
Say can you mount the disk in another system, decrypt it and check whether cryptsetup is still installed? Should be in /sbin/cryptsetup. – Wolfer Sep 30 '15 at 15:13
    
Thanks, should I just remove the grub2 tag, then? I don't have access to another machine - would your suggestion work from an external disk with Ubuntu netinstall on it, for example? – uwotm8 Sep 30 '15 at 15:15
    
Yes, as long as it has cryptsetup (the standard linux encryption tool). And I think it does. – Wolfer Sep 30 '15 at 15:19
    
Thanks, Wolfer. That's definitely a good step to try later today. I'll look for instructions for unlocking the disk from a live boot. What should I do if cryptsetup is not there? I suspect some dependency was removed during the apt-get upgrade. – uwotm8 Sep 30 '15 at 15:22
up vote 0 down vote accepted

This error is generated by the initramfs script that finds and mounts the root fs.

I've experienced this message before and it turned out to be caused by updating the initramfs from a live cd.

The thing was that I had an encrypted root, and when opening the luks volume from the live cd I didn't use the same name that was in my crypttab.

So, I booted the live cd and did:

cryptsetup luksOpen /dev/md1 md1
vgchange -ay
mount /dev/vgmain/lvroot /mnt/custom
<... mount dev et. al ...>
chroot /mnt/custom
<... fix something ...>
update-initramfs -u
exit
umount /mnt/custom && vgchange -an && cryptsetup luksClose md1

The update-initramfs -u did warn about cryptsetup: WARNING: invalid line in /etc/crypttab - but at first I didn't deem it important.

After some failed attempts to boot it hit me: my crypttab had md1_crypt for the luks volume, but when I updated the initramfs it saw md1 so it went with that. From within the boot scripts md1 was not available as a luks volume.

So I booted my livecd again and corrected it:

cryptsetup luksOpen /dev/md1 md1_crypt
vgchange -ay
mount /dev/vgmain/lvroot /mnt/custom
<... mount dev et. al ...>
chroot /mnt/custom
update-initramfs -u
exit
umount /mnt/custom
vgchange -an
cryptsetup luksClose md1_crypt

I've looked through the initramfs-tools scripts, but I couldn't find the exact spot where this went wrong, so I assume it was just some weird interaction between cryptsetup, mdadm and lvm.

On another debian host I had a similar issue*, except this time without crypttools or lvm involved, and I was able to work around it by changing my mdadm.conf from /dev/md/n device paths to /dev/mdn. On this ocassion, the issue only presented itself while the array was rebuilding and not when everything was normal.

Perhaps someone more familiar with the inner workings of initramfs-tools can figure this out.

* the debian host also showed a message like incrementally starting raid arrays after a few CREATE group disk not found.

share|improve this answer

I believe it has to do with race conditions when mdadm builds disk arrays. You may have to play with delays in the pre-mount scripts to allow all the arrays to be built. I have set up a nested RAID for /boot because grub cannot deal with RAID10 and the second level mirror RAID1 does not get normally built by mdadm. So I have had to put mdadm --assemble /dev/md/boot into a pre-mount script.

Your situation maybe different but I think my experience gives a clue.

share|improve this answer

gnp's answer was pretty good and definitely pointed me in the right direction (my problem was caused by a broken cryptroot setup). However, it wasn't quite sufficient to debug the problem)

  1. This can be due to cryptsetup not mapping encrypted volume. This means that initramfs does not have and lvm volume to mount, if you are using and encrypted lvm physical group (the default encrypted ubuntu install)
  2. For generally debugging this sort of problem, you want to understand initramfs and update-initramfs (google, then I would insert links by stackexchange won't let me)
  3. To get more debugging output you can edit your boot options in grub (by pressing e over a valid option), you should remove the splash and quiet options. If this is not sufficient you can use break=premount as described here: https://wiki.debian.org/InitramfsDebug, to drop into an interactive shell and see what is going on. The script that was causing problems here was called cryptroot.
  4. To understand what is going on in the generation of initramfs scripts, you can look at the files in /usr/share/initramfs-tools/hooks and /usr/share/initramfs-tools/scripts, the former is run on a full working system to generate configuration for the latter. You might try adding set -x flags to these scripts for debugging.

In my particular case, I had problems correcting this from a boot disk with chroot because lvm tools where not returning the correct results inside the jail. I needed to mount in a number of things to work around this. I also had to ensure that the luks volume was mapped with the correct name (It needed to match up with the value in crypttab, and the helpful graphical interface was picking quite a bad name.

cryptsetup luksOpen /dev/md1 md1_crypt
mount --bind /sys /mnt/encrypted-root/sys
mount --bind /dev /mnt/encrypted-root/dev
mount --bind /proc /mnt/encrypted-root/proc
chroot /mnt/encrypted-root
update-inintramfs -c -k all
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.