RHCSA Rapid Track
In this exercise, you will determine the default target into which a system boots, and boot that system into other targets.
Outcomes
You should be able to update the system default target and use a temporary target from the boot loader.
Log in as the student user on workstation using student as the password.
On workstation, run the lab boot-selecting start command.
This command runs a start script that prepares workstation for the exercise.
[student@workstation ~]$lab boot-selecting start
On
workstation, open a terminal and confirm that the default target isgraphical.target.[student@workstation ~]$systemctl get-defaultgraphical.targetOn
workstation, 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 using the relevant button or menu entry. Log in as
rootusingredhatas the password.Note
Reminder: If you are using the terminal through a webpage you can click the Show Keyboard icon under your web browser’s url bar and then to the right of the machine’s IP address.
workstation login:
rootPassword:redhat[root@workstation ~]#Configure
workstationto automatically boot into themulti-usertarget, and then rebootworkstationto verify. When done, change the defaultsystemdtarget back to thegraphicaltarget.Use the
systemctl set-defaultcommand to 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
workstation.[root@workstation ~]#systemctl rebootNotice that after reboot the system presents a text-based console and not a graphical login anymore.
Log in as
rootusingredhatas the password.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 concludes the first part of the exercise where you practice setting the default
systemdtarget.
In this second part of the exercise, you will practice 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.Press Ctrl+x to boot using the modified configuration.
Log in to rescue mode. The
rootpassword isredhatYou may need to hit 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/vda3 on/type xfs (rw,relatime,seclabel,attr2,inode64,noquota) ...output omitted...Press Ctrl+d to continue with the boot process.
The system presents a graphical login. Log in as
studentusingstudentas the password.