Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] problems debugging a systemd problem
Date: Thu, 28 May 2015 22:28:19
Message-Id: CADPrc81VVyXOqAzGhGeqH_dR9hcqxvTGLtyh74Opus_SN=+mNw@mail.gmail.com
In Reply to: Re: [gentoo-user] problems debugging a systemd problem by covici@ccs.covici.com
1 On Thu, May 28, 2015 at 4:55 PM, <covici@××××××××××.com> wrote:
2 > Canek Peláez Valdés <caneko@×××××.com> wrote:
3 [...]
4 > > As I said, I did the following tests:
5 > >
6 > > 1. Adding "emergency" to the kernel command line, with a valid root=.
7 > > 2. Adding "rescue" to the kernel command line, with a valid root=.
8 > > 2. Leaving root= invalid without adding neither "emergency" nor
9 "rescue".
10 > >
11 > > If root= is valid, with emergency systemd drops you to a shell with your
12 > > root filesystem mounted read-only. With rescue, systemd drops you to a
13 > > shell with all your filesystems mounted read-write.
14 > >
15 > > If root= is invalid, it doesn't matter if you use emergency, rescue, or
16 > > neither, *dracut* drops you to a shell, still inside the initramfs
17 > > obviously. It takes a while; I didn't took the time, but I think it was
18 3
19 > > minutes. Inside this shell, you can use systemd normally, and if you
20 manage
21 > > to mount the root filesystem, I'm sure you could continue the normal
22 boot
23 > > process. You'll have to pivot root manually, though.
24 > >
25 > > Hope that makes it clear.
26 >
27 > How do you pivot route manually?
28
29 Basically, with pivot_root(8) [1]. Be aware that systemd does some things
30 before and after pivot_root'ing; in particular, it switches from the
31 instance running inside the initramfs to an instance running in the real
32 filesystem. I'm not sure how it does it, but the switching code is
33 relatively simple [2].
34
35 Regards.
36
37 [1] http://linux.die.net/man/8/pivot_root
38 [2]
39 http://cgit.freedesktop.org/systemd/systemd/tree/src/shared/switch-root.c
40 --
41 Canek Peláez Valdés
42 Profesor de asignatura, Facultad de Ciencias
43 Universidad Nacional Autónoma de México