You are not logged in.

#1 2015-10-31 16:36:02

tonnz
Member
Registered: 2015-08-02
Posts: 38

[Solved]Deliberately boot into emergency shell (once).

Hello!

I'm currently experimenting with the systemd-hook in /etc/mkinitcpio.conf.
My systemd-version is 227.

The wiki-page of mkinitcpio warns that the emergency shell is not provided by the systemd-hook alone, and requires base for the shell and a driver for the keyboard.
Before i settle in on the systemd-hook, i would like to verify that my emergency shell is working.

How can i deliberately boot into the emergency-shell once?
With "once" i mean that the system should boot normally after a reboot.

Is it possible?


Another little related question for which i did not want to create a new thread:
Do i need the keyboard hook if i add a keyboard driver module like atkbd to the modules array (or vice versa)?
According to the wiki, the keyboard hook "adds the necessary modules for keyboard devices".
(eg for keyboard functionality in emergency mode i assume)

Also, do i have to add /etc/sulogin(does not exist in my install?) /etc/shadow and /etc/gshadow to the FILES array or the BINARIES array in mkinitcpio.conf?

Last edited by tonnz (2015-10-31 19:49:33)

Offline

#2 2015-10-31 16:49:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: [Solved]Deliberately boot into emergency shell (once).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#3 2015-10-31 16:54:24

tonnz
Member
Registered: 2015-08-02
Posts: 38

Re: [Solved]Deliberately boot into emergency shell (once).

# systemctl set-default rescue.target

Would this option change the boot target permanently (until i set it to something else)?
I don't want to be stuck in the rescue shell if it turns out to be non-functional... I know i could revert it after booting from the installation-cd, but i'd like to know if there is a more convenient way.

Last edited by tonnz (2015-10-31 16:56:36)

Offline

#4 2015-10-31 18:10:36

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [Solved]Deliberately boot into emergency shell (once).

tonnz wrote:

# systemctl set-default rescue.target

Would this option change the boot target permanently (until i set it to something else)?

Yes.

Either add "systemd.unit=rescue.target" as a kernel parameter (as mentioned in the link Trilby provided) or use:

# systemctl isolate rescue.target

To drop to a rescue shell immediately (ie, without rebooting).

Offline

#5 2015-10-31 18:52:29

tonnz
Member
Registered: 2015-08-02
Posts: 38

Re: [Solved]Deliberately boot into emergency shell (once).

Head_on_a_Stick wrote:

Either add "systemd.unit=rescue.target" as a kernel parameter (as mentioned in the link Trilby provided) or use:

# systemctl isolate rescue.target

To drop to a rescue shell immediately (ie, without rebooting).

I wonder if the second method you mentioned would be representative of a fault scenario where i involuntarily boot into the rescue shell (i would assume that with that method modules for the keyboard etc. are already loaded).

But i decided to not be too paranoid about the rescue shell. I'll try if it works, and if i get stuck in the shell because of a problem, i'll still have the cd to recover. I have been using Arch for about 4 month now, and until now i only had to rely on the rescue shell once ("forgot" to compile the necessary iocharset for FAT into my custom kernel). If something horrible happens and i don't have the rescue shell, i'll simply use the installation-cd to recover.

Thank you both for your answers!

Last edited by tonnz (2015-10-31 19:53:49)

Offline

#6 2015-10-31 18:59:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: [Solved]Deliberately boot into emergency shell (once).

tonnz wrote:

Thank you both for your answers!

EDIT: sorry, I misunderstood.  You are welcome.

Last edited by Trilby (2015-10-31 19:44:32)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#7 2015-10-31 19:38:00

tonnz
Member
Registered: 2015-08-02
Posts: 38

Re: [Solved]Deliberately boot into emergency shell (once).

[resolved]

Last edited by tonnz (2015-10-31 19:49:48)

Offline

#8 2015-10-31 19:45:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: [Solved]Deliberately boot into emergency shell (once).

Sorry I misunderstood, much is lost in text-only communication.

If you have what you need from this, please remember to mark the thread as solved by clicking 'edit' on your first post so you can prepend [SOLVED] to the title.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

Board footer

Powered by FluxBB