For troubleshooting purposes, sometimes it is required to boot into a non-default target.
So how does that work?
Well, first you need a target that is isolatable.
A systemd target that is not isolatable is just a group of unit files.
So if you have the isolate is yes option in the systemd target unit file,
you can boot into that target.
And four common targets are used.
But there is nothing preventing you from creating your own targets if you want.
The commonly used targets are emergency target, rescue target, multi-user target and graphical target.
And you can enter the group to boot menu by pressing E.
And then you add systemd.unit is whatever.target to boot into a non-default target.
Alternatively, use systemctl set default to set your default.
Let me show you.
So let me use systemctl cat printer.target.
Because in the end, a target is just a group of unit files.
And here we can see it is quite minimal configuration.
Now what happens if we do rescue.target, for instance?
There we can see the last option in the configuration.
And that's the option that matters.
Allow isolate is yes.
If a target has allow isolate is yes, then you can boot into it.
And I'm going to show you how to do that from the group bootloader menu.
So first we need to reboot.
And press escape at the right moment.
If you see the firmware, and we just did,
it's right after the loading of the firmware where you press escape.
And then you get the group boot menu, as you can see right here.
So from here I'm going to use E for edit.
I'm going to the end of the line that loads Linux.
And I'm using systemd.unit is rescue.target.
And then control X to boot with normal options.
So rescue target, as well as emergency target,
are going to prompt for a root password.
It's a little bit hard to see.
Because after the prompt,
which is about 12 lines from the bottom of the screen,
some more messages were printed,
but it is really prompting give root password for maintenance.
If you don't have a root password,
you cannot use these options for troubleshooting.
But I did set a root password on this one.
So here I am in my root shell.
Now I'm going to use systemctl start graphical.target.
From a minimal target, just use systemctl start
to go to a target that is offering more.
So here I am back in my graphical target
where I can log in again.