Redhat – Boot Target

redhat

A Linux systems can boot up in various modes based on user preference. For example we can configure a node to start on GUI mode, where once the node boots, the user will get a GUI based login screen, and will open a GUI window for user to start using it. It may be a preference on user who want to use the Linux node as a workstation for example. On the other hand, a server administration may prefer his system to start in multi-user CLI mode were the system will save resources on loading all GUI modules.

The below command verifies the default environment on which a system boots. Different pre-set modes available are:

  • graphical.target
  • multi-user.target
  • rescue.target
  • emergency.target

[root@centos9test1 ~]# systemctl get-default
graphical.target

====== ===

Though the above node is presently on gui mode, which can be observed if a serial console or monitor is connected, the below command will switch the mode for GUI to multi-user CLI, that will be noticed on the console too.

[root@centos9test1 ~]# systemctl isolate multi-user.target

Please note that this command will not change the default setting, so that it goes back to GUI after a reboot.

The below command needs to be used if the default target needs to be changed

[root@centos9test1 ~]# systemctl set-default multi-user.target
Removed “/etc/systemd/system/default.target”.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/multi-user.target.

===== ==

In case we need the system to boot in a GUI mode before loading the OS, the below process can be used.

As the server is powered-on and starts-up, at the grub window, enter to the edit option. On the line that starts with linux append the following, and press ctrl+X

  • systemd.unit=graphical.target

Similarly we can boot to a rescue or emergency mode too using the respective target.