On Thu, May 28, 2015 at 4:55 PM, <cov...@ccs.covici.com> wrote:
> Canek Peláez Valdés <can...@gmail.com> wrote:
[...]
> > As I said, I did the following tests:
> >
> > 1. Adding "emergency" to the kernel command line, with a valid root=.
> > 2. Adding "rescue" to the kernel command line, with a valid root=.
> > 2. Leaving root= invalid without adding neither "emergency" nor
"rescue".
> >
> > If root= is valid, with emergency systemd drops you to a shell with your
> > root filesystem mounted read-only. With rescue, systemd drops you to a
> > shell with all your filesystems mounted read-write.
> >
> > If root= is invalid, it doesn't matter if you use emergency, rescue, or
> > neither, *dracut* drops you to a shell, still inside the initramfs
> > obviously. It takes a while; I didn't took the time, but I think it was
3
> > minutes. Inside this shell, you can use systemd normally, and if you
manage
> > to mount the root filesystem, I'm sure you could continue the normal
boot
> > process. You'll have to pivot root manually, though.
> >
> > Hope that makes it clear.
>
> How do you pivot route manually?

Basically, with pivot_root(8) [1]. Be aware that systemd does some things
before and after pivot_root'ing; in particular, it switches from the
instance running inside the initramfs to an instance running in the real
filesystem. I'm not sure how it does it, but the switching code is
relatively simple [2].

Regards.

[1] http://linux.die.net/man/8/pivot_root
[2]
http://cgit.freedesktop.org/systemd/systemd/tree/src/shared/switch-root.c
--
Canek Peláez Valdés
Profesor de asignatura, Facultad de Ciencias
Universidad Nacional Autónoma de México

Reply via email to