From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 591A0138CD3 for ; Thu, 28 May 2015 22:28:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CBD48E0932; Thu, 28 May 2015 22:28:14 +0000 (UTC) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 55E56E0897 for ; Thu, 28 May 2015 22:28:13 +0000 (UTC) Received: by pacwv17 with SMTP id wv17so33435015pac.2 for ; Thu, 28 May 2015 15:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=NjlU4JJaN8bYXR6om/Q7IiWJ3PQePz9XnQlV8TkzC20=; b=TBjkIodVzTEu6FzTzpXcldpyt/jsW3ryp8QAWNNgefWLHXu0KXggRguNhsVG6ZjjQW BKcf9hgOl2UAlKIvyNwMcGHyo9/HwHJj7mvpcabZrdsHeRoeg0+TW2u0IbNV3ND6y54M jrYYPR3a2PsIeqpS4UfW4+BMQpiGqZf3P5OSxEb52tioza4NJjjTeloeIypThtgrFn0c lnr0ER1XQBHWe19eN5S7fZ87ljEphm55TFZaE6IRfw696r7w/FJ48i1ODyi3Ydt6MHGL cCeVC/G3ZjxR2jZu7BrzqNKy4av1BQadIqee7ZeOyhyRr1rqXhqvIXS5R4QkS1B+xuCI suAA== X-Received: by 10.68.237.40 with SMTP id uz8mr9373822pbc.140.1432852092503; Thu, 28 May 2015 15:28:12 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.66.82.195 with HTTP; Thu, 28 May 2015 15:27:51 -0700 (PDT) In-Reply-To: <16577.1432850139@ccs.covici.com> References: <28995.1432789799@ccs.covici.com> <30995.1432793754@ccs.covici.com> <5566BFF9.7040004@xunil.at> <1823.1432798791@ccs.covici.com> <5566CA9F.5040608@xunil.at> <5450.1432801814@ccs.covici.com> <16577.1432850139@ccs.covici.com> From: =?UTF-8?B?Q2FuZWsgUGVsw6FleiBWYWxkw6lz?= Date: Thu, 28 May 2015 17:27:51 -0500 Message-ID: Subject: Re: [gentoo-user] problems debugging a systemd problem To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=047d7b33d4c2fd4ebd05172bdfe3 X-Archives-Salt: b8ea6c39-683d-4968-a5dd-251bf9c0a10e X-Archives-Hash: 9cd3b72dd70302b92f1f7a420836426f --047d7b33d4c2fd4ebd05172bdfe3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, May 28, 2015 at 4:55 PM, wrote: > Canek Pel=C3=A1ez Vald=C3=A9s wrote: [...] > > As I said, I did the following tests: > > > > 1. Adding "emergency" to the kernel command line, with a valid root=3D. > > 2. Adding "rescue" to the kernel command line, with a valid root=3D. > > 2. Leaving root=3D invalid without adding neither "emergency" nor "rescue". > > > > If root=3D is valid, with emergency systemd drops you to a shell with y= our > > root filesystem mounted read-only. With rescue, systemd drops you to a > > shell with all your filesystems mounted read-write. > > > > If root=3D 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=C3=A1ez Vald=C3=A9s Profesor de asignatura, Facultad de Ciencias Universidad Nacional Aut=C3=B3noma de M=C3=A9xico --047d7b33d4c2fd4ebd05172bdfe3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, May 28, 2015 at 4:55 PM, <covici@ccs.covici.com> wrote:
> Canek Pel= =C3=A1ez Vald=C3=A9s <caneko@gmail.c= om> wrote:
[...]
> > As I said, I did the following tes= ts:
> >
> > 1. Adding "emergency" to the kernel= command line, with a valid root=3D.
> > 2. Adding "rescue&qu= ot; to the kernel command line, with a valid root=3D.
> > 2. Leavi= ng root=3D invalid without adding neither "emergency" nor "r= escue".
> >
> > If root=3D 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=3D = 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 th= ink it was 3
> > minutes. Inside this shell, you can use systemd n= ormally, 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 m= akes it clear.
>
> How do you pivot route manually?

Basi= cally, with pivot_root(8) [1]. Be aware that systemd does some things befor= e and after pivot_root'ing; in particular, it switches from the instanc= e running inside the initramfs to an instance running in the real filesyste= m. I'm not sure how it does it, but the switching code is relatively si= mple [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=C3=A1ez Vald= =C3=A9s
Profesor de asignatura, Facultad de Ciencias
Universidad Naci= onal Aut=C3=B3noma de M=C3=A9xico
--047d7b33d4c2fd4ebd05172bdfe3--