[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
This is a somewhat old LP bug, but for completeness it worth mentioning here that recently some patches were merged on initramfs-tools and cryptsetup, that allow a good experience booting with LUKS-encrypted rootfs on top of a degraded RAID1 array; for details, please check: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/1879980 Cheers, Guilherme -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
I also can confirm this bug on 14.04 First time notices on Ubuntu 8.04.2. Take a look here: https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/324997 and here: http://feeding.cloud.geek.nz/posts/the-perils-of-raid-and-full-disk- encryption-on-ubuntu/ -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
There is a similar solution mentioned here: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1196693, which proposes to link /usr/share/initramfs-tools/scripts/local- premount/mdadm -> /etc/initramfs-tools/scripts/local-top/mdadm. Looks like it's the simplest, but I'm not sure it doesn't break something else. Forgot to mention in the previous post: the EFI partition disk change should be made in /etc/fstab. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
Actually, the solution proposed by François Marier should work, but only if you have one RAID array and this array is called md0. A completely flexible and at the same time simple solution is to use the function mountroot_fail located at /usr/share/initramfs-tools/scripts /mdadm-functions, which correctly detects the bootdegraded options passed via a kernel param or in the mdadm.conf and knows how to activate all the arrays in the system. This is how degraded arrays are treated when there is no cryptsetup (which interferes in the middle of the mdadm handling scripts). So, just run this command (adjust the line numbers if your version differs): echo -e '205a206,212 > \t\t. /scripts/mdadm-functions > \t\t. /scripts/functions > \t\tmountroot_fail > \t\techo "mountroot_fail returned $?\\n" > \tfi > > \tif [ ! -e $cryptsource ]; then' | patch -n > /usr/share/initramfs-tools/scripts/local-top/cryptroot and then update-initramfs -u -k all And your system will boot with degraded arrays. If not yet done, you'll need to change the ID of the disk for EFI partition to its dev name so the system can mount it independently of the disk it boots from, e.g. /dev/sda1 /boot/efi -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
My problem (encrypted RAID1 drive refusing to boot when degraded) was fixed by adding a new initramfs boot script to start the RAID array before cryptsetup runs: http://feeding.cloud.geek.nz/posts/the-perils-of-raid-and-full-disk- encryption-on-ubuntu/ That's on 12.04.3. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
** This bug is no longer a duplicate of bug 1003309 Boot fails after installing updates, error: “cryptsetup: evms_activate is not available" -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
*** This bug is a duplicate of bug 1003309 *** https://bugs.launchpad.net/bugs/1003309 ** This bug has been marked a duplicate of bug 1003309 Boot fails after installing updates, error: “cryptsetup: evms_activate is not available" -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
I confirm behavior described by Teemu Toivola (vergo) in Ubuntu server 12.10. After removing one (no matter which one) drive from RAID1 i got: cryptsetup evms_activate is not available Begin: Waiting for encrypted source device. If Raid1 is valid (with both drives connected) initram asks correctly for password. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
** Also affects: cryptsetup Importance: Undecided Status: New ** No longer affects: cryptsetup -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
I am sorry I had to find out the same as Teemu for 12.04.1. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
Commenting here since bug #324997 has been marked as duplicate and the behaviour appears to have changed since the original report. With Ubuntu 12.04, booting with a degraded raid (due to missing disk) causes the boot process to stop at "Begin: Waiting for encrypted source device... ...". There's a timeout of around 180 seconds after which a busybox prompt becomes available. It's possible to continue from that prompt by commanding "mdadm --run /dev/mdX" followed with ctrl-d. That causes cryptsetup to find the device, prompt for a passphrase and continue the boot procedure. I noticed that this problem occurs only when a disk is missing from the raid. Setting one disk as failed and then booting with all disks but still in degraded state will result in some warnings during the boot process but there will be no waiting for timeouts or busybox prompts. Another suggestion I found in several places and ended up testing was to replace the UUID in /etc/crypttab with the device itself (/dev/mdX). That results in no timeout and cryptsetup asking for the passphrase but it will not accept the correct passphrase as long as any disk from the raid is missing. There's no busybox prompt available either resulting in a system that can't boot. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
Looking at the timouts suggested in Comment #15, I think they may actually be realizable with modular scripts. A base rootdelay script, and separate mdadm and cryptsetup sripts (that get called by their udev rules) can halt/extend the regular rootdelay (exported variable? named pipe?), if waiting for user input or a new level of raid degrading timeout. (As pipes block, reading from pipes may do good for event based processing.) Phillip, your idea of handling udev events by modular event handlers (that may again trigger udev events, if I interpret you correctly) may also be what appears in part of the OpenRC discussion. On init in Debian http://lists.debian.org/debian-devel/2012/03/msg00452.html RFC: OpenRC as Init http://lists.debian.org/debian-devel/2012/04/msg00547.html -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
Can't the udev rule fork and let the child wait for the timeout, then activate the array degraded? I think the source of my confusion is that upstart is bluring the line between udev, which was designed to do event driven processing in response to hardware detection, and conventional sysvinit, which was designed to run things at startup. Doing this sort of thing with an upstart job makes it dependent on upstart, which means we won't be able to use systemd or sysvinit as alternatives ( which I think makes it a deal breaker for Debian doesn't it? ). If possible, it would be better to find a way for this processing to be kicked off via udev without depending on upstart, either for later system init, or especially in the initramfs, where adding it would have significant overhead. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
On Mon, May 14, 2012 at 02:15:10PM -, Phillip Susi wrote: > mdadm is event driven via udev. The special part in the initramfs is > the failure hook so that a degraded array will only be activated after a > timeout. I'm not sure if we want to auto degrade arrays post boot, but > I suppose if we did, we could move that logic from the failure hook to > the udev rule. It can't be done in a udev rule. Udev rules have a short timeout of their own, after which the outstanding process will be killed. The handling has to be passed off to something else - such as an upstart job. > What confuses me is cryptsetup. I see that there is an upstart job that > appears to try and prompt for the password and unlock the device, but as > an upstart task, it has no stdin/out, so that prompt can't work. The upstart job talks to plymouth. The initramfs script *also* talks to plymouth. > After the system goes multi user you can no longer do a console password > prompt. If you want an interactive prompt at that point, you will need > something that can interact with the X desktop, and anything that does > that obviously isn't going in the initramfs. The client-side logic is the same; what we're missing is a way to let cryptsetup do plymouth interaction with something on the desktop after X is started. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
mdadm is event driven via udev. The special part in the initramfs is the failure hook so that a degraded array will only be activated after a timeout. I'm not sure if we want to auto degrade arrays post boot, but I suppose if we did, we could move that logic from the failure hook to the udev rule. What confuses me is cryptsetup. I see that there is an upstart job that appears to try and prompt for the password and unlock the device, but as an upstart task, it has no stdin/out, so that prompt can't work. After the system goes multi user you can no longer do a console password prompt. If you want an interactive prompt at that point, you will need something that can interact with the X desktop, and anything that does that obviously isn't going in the initramfs. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
I believe the initramfs only sets up the rootfs, other partitions (/home) are set up afterwards. If I remeber correct cryptsetup is called by udev rules. In any case, that is the way it has to be, event driven, to catch on upon (/home) devices appearing without polling loops and sleep delays. When I looked, I think bootwait, mdadm and cryptsetup where all looping and sleeping in initramfs independently in whatever course they get called. Therefore I suggested the watchdog timers I mentioned above and in the wiki. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
If the udev rule calls cryptsetup, then it would be trying to prompt, and so it can't do that. What invokes cryptsetup in the normal system? Don't you have to do it by hand right now if you hot plug a luks disk? The order doesn't have to match the setup as long as they keep being called as long as any one indicates that it managed to take some corrective action. AFAICS, there is only one wait, and then it goes into failure hook mode. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
> Since udev already provides an event driven framework in the initramfs, why add another one? Hmm, if you would like to realize event driven init scripts, I believe you may be able to rework the scripts from doing linear pre...post things to just call a watchdog script that mostly sleeps and checks how things are going on. And then have separate task scripts that get only called by udev events, or the watchdog. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
The udev rules don't need to prompt, the cryptsetup that gets called will prompt. Actually, these things work quite well in the normal system. It seems preferable to me to adjust/improve the regular tools to be usable in initramfs as well, rather then trying to script up and maintain! another thing inherently limited. Failure hooks for example will be called in a specific order (not necessarily matching the setup), if you are looping this should time out with a message, then if the user plugs in the missing disk it won't come up automatically (and if it does possibly only with a large delay as all unrelated loops need to time out first), etc. Thus, its better to go event driven, and then why not favor a proven tool. Reasonable timeouts (see above and https://wiki.ubuntu.com/ReliableRaid) are another reason to go event driven, they should not be several waiting loops stacked up and possibly blocking each other. Bug #491463 "support upstart within an initramfs" https://launchpad.net/~csurbhi/+archive/natty-initramfs -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
Cryptsetup has to be done via script rather than udev rule since it has to prompt for input, and udev rules can't do that. I think just two things need done to fix this: 1) cryptsetup needs a failure hook 2) try_failure_hooks needs to continue trying all failure hooks rather than return as soon as one succeeds This would allow the failure hooks to activate one or more degraded raid arrays, and finally cryptsetup to unlock the volume. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/251164 Title: boot impossible due to missing initramfs failure hook / event driven initramfs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
** Branch linked: lp:~csurbhi/+junk/mdadm.fixes -- boot impossible due to missing initramfs failure hook / event driven initramfs https://bugs.launchpad.net/bugs/251164 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
** Description changed: the cryptsetup package needs proper integration into the initramfs failure hooks The system must not assume a particular layered setup or sequence of appearance of (hotplug/udev/crypt/md/degraded-md/lvm) devices. It must be able to boot with any possible combination raid, lvm, crypt combination that the debian-installer can produce. + + + Description of solution in comment #15 -- boot impossible due to missing initramfs failure hook / event driven initramfs https://bugs.launchpad.net/bugs/251164 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
** Also affects: mdadm (Ubuntu) Importance: Undecided Status: New ** Changed in: mdadm (Ubuntu) Status: New => Confirmed -- boot impossible due to missing initramfs failure hook / event driven initramfs https://bugs.launchpad.net/bugs/251164 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
Scott, I put you on here because from your upstart/mountall experience you may well spot flaws and benefits in the design. https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/251164/comments/15 -- boot impossible due to missing initramfs failure hook / event driven initramfs https://bugs.launchpad.net/bugs/251164 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 251164] Re: boot impossible due to missing initramfs failure hook / event driven initramfs
** Summary changed: - boot impossible due to missing initramfs failure hook integration + boot impossible due to missing initramfs failure hook / event driven initramfs -- boot impossible due to missing initramfs failure hook / event driven initramfs https://bugs.launchpad.net/bugs/251164 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs