1 |
On Thu, May 28, 2015 at 12:46 PM, Rich Freeman <rich0@g.o> wrote: |
2 |
> |
3 |
> On Thu, May 28, 2015 at 11:57 AM, Canek Peláez Valdés <caneko@×××××.com> |
4 |
wrote: |
5 |
> > Others have already answered, but I will add that if you put "emergency" |
6 |
> > anywhere in the kernel command line, then systemd will boot to the |
7 |
rescue |
8 |
> > target; that's why I suggested to do it in my first answer. |
9 |
> |
10 |
> I'm pretty sure that won't work for an initramfs - they're almost |
11 |
> certainly designed to ignore that instruction. |
12 |
|
13 |
Actually, it does work (see attached screenshot). I set my root= kernel |
14 |
command line parameter wrong on purpose, and systemd (inside dracut) |
15 |
dropped me inside a rescue shell. |
16 |
|
17 |
That's a full systemd instance, I could journalctl'd things and start and |
18 |
stop services... only those inside the initramfs, of course. |
19 |
|
20 |
> Usually when somebody |
21 |
> wants a rescue shell, they want it in their root filesystem, and not |
22 |
> in their initramfs before it has pivoted. That is why dracut has |
23 |
> options like rd.break. |
24 |
|
25 |
But that doesn't help you at all when the problem is exactly that you |
26 |
cannot mount your root filesystem. With the rescue shell of systemd (inside |
27 |
dracut), you can analyze the problem, or perhaps even mount your root |
28 |
filesystem and continue the boot process; the initramfs should have all the |
29 |
necessary tools to do that. |
30 |
|
31 |
> If the problem were with systemd/services/etc in the actual root |
32 |
> filesystem (once the actual distro has started booting), then putting |
33 |
> emergency on the command line should get you a rescue shell. |
34 |
|
35 |
Again, what if the problem is before *that*? |
36 |
|
37 |
> The same generally applies to openrc - if the initramfs isn't mounting |
38 |
> your root filesystem, then passing instructions to openrc won't do |
39 |
> anything since in that case openrc isn't even running. |
40 |
|
41 |
But in this case, systemd *is* inside the initramfs: |
42 |
|
43 |
# ls usr/lib/systemd/ |
44 |
network systemd-cgroups-agent systemd-journald systemd-shutdown |
45 |
systemd-vconsole-setup |
46 |
system systemd-fsck systemd-modules-load systemd-sysctl |
47 |
system-generators |
48 |
systemd systemd-hibernate-resume systemd-reply-password systemd-udevd |
49 |
|
50 |
That's my initramfs. With dracut, systemd *is* the initramfs init system. |
51 |
|
52 |
Regards. |
53 |
-- |
54 |
Canek Peláez Valdés |
55 |
Profesor de asignatura, Facultad de Ciencias |
56 |
Universidad Nacional Autónoma de México |