RHCSA Rapid Track
Course update
An updated version of this course is available that uses a newer version of Red Hat Enterprise Linux in the lab environment. Therefore, the RHEL 9.0 version of the lab environment will retire on December 31, 2024. Please complete any work in this lab environment before it is removed on December 31, 2024. For the most up-to-date version of this course, we recommend moving to the RHEL 9.3 version.
In this exercise, you determine the default target into which a system boots, and boot that system into other targets.
Outcomes
Update the system default target and use a temporary target from the boot loader.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command ensures that all required resources are available.
[student@workstation ~]$ lab start boot-selecting
Instructions
On the
workstationmachine, open a terminal and confirm that the default target isgraphical.target.[student@workstation ~]$
systemctl get-defaultgraphical.targetOn the
workstationmachine, switch to themulti-usertarget manually without rebooting. Use thesudocommand and if prompted, usestudentas the password.[student@workstation ~]$
sudo systemctl isolate multi-user.target[sudo] password for student:studentAccess a text-based console. Use the Ctrl+Alt+F1 key sequence by using the relevant button or menu entry. Log in as the
rootuser by usingredhatas the password.Note
Reminder: If you are using the terminal through a web page, then you can click the
Show Keyboardicon in the menu on the right side of the screen under your web browser's URL bar.workstation login:
rootPassword:redhat[root@workstation ~]#Configure the
workstationmachine to automatically boot into themulti-usertarget, and then reboot theworkstationmachine to verify. When done, change the defaultsystemdtarget back to thegraphicaltarget.Set the default target.
[root@workstation ~]#
systemctl set-default multi-user.targetRemoved /etc/systemd/system/default.target. Created symlink /etc/systemd/system/default.target -> /usr/lib/systemd/system/multi-user.target.Reboot the
workstationmachine. After reboot, the system presents a text-based console and not a graphical login screen.[root@workstation ~]#
systemctl rebootLog in as the
rootuser.workstation login:
rootPassword:redhatLast login: Thu Mar 28 14:50:53 on tty1 [root@workstation ~]#Set the default
systemdtarget back to thegraphicaltarget.[root@workstation ~]#
systemctl set-default graphical.targetRemoved /etc/systemd/system/default.target. Created symlink /etc/systemd/system/default.target -> /usr/lib/systemd/system/graphical.target.This step concludes the first part of the exercise, where you practice setting the default
systemdtarget.
In this second part of the exercise, you practice by using rescue mode to recover the system.
Access the boot loader by rebooting
workstationagain. From within the boot loader menu, boot into therescuetarget.Initiate the reboot.
[root@workstation ~]#
systemctl rebootWhen the boot loader menu appears, press any key to interrupt the countdown (except Enter, which would initiate a normal boot).
Use the cursor keys to highlight the default boot loader entry.
Press e to edit the current entry.
Using the cursor keys, navigate to the line that starts with
linux.Press End to move the cursor to the end of the line.
Append
systemd.unit=rescue.targetto the end of the line.Note
If it is difficult for you to read the text in the console, then consider changing the resolution when you edit the kernel line in the boot loader entry.
To change the console resolution, add either
video=640x480orvga=askto the line that starts with thelinuxword, aftersystemd.unit=rescue.target. With thevideo=640x480argument, the text console should be displayed at approximately an 80-column width. If you usevga=askinstead, then you can choose the resolution that best suits your environment at boot time.Press Ctrl+x to boot by using the modified configuration.
Log in to rescue mode. You might need to press Enter to get a clean prompt.
Give root password for maintenance (or press Control-D to continue):
redhat[root@workstation ~]#
Confirm that in rescue mode, the root file system is in read/write mode.
[root@workstation ~]#
mount...output omitted... /dev/vda4 on/type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota) ...output omitted...Press Ctrl+d to continue with the boot process.
The system presents a graphical login. Log in as the
studentuser.
This concludes the section.