Performance Checklist
In this lab, you will reset the root password on a system, recover from a misconfiguration, and set the default boot target.
Outcomes
You should be able to:
Reset a lost root password.
Diagnose and fix boot issues.
Set the default systemd target.
Log in to workstation as student using student as the password.
On workstation, run the lab boot-review start command.
This command runs a start script that determines if the serverb machine is reachable on the network.
It also introduces a file-system issue, resets the root password, sets a higher timeout for the GRUB2 menu, and reboots serverb.
[student@workstation ~]$lab boot-review start
On serverb, reset the root password to redhat.
Locate the icon for the serverb console, as appropriate for your classroom environment.
Work from that console.
Send a Ctrl+Alt+Del to your system using the relevant button or menu entry.
When the boot-loader menu appears, press any key to interrupt the countdown, except Enter.
Use the cursor keys to highlight the default boot loader entry.
Press e to edit the current entry.
Use the cursor keys to navigate to the line that starts with linux.
Press End to move the cursor to the end of the line.
Append rd.break to the end of the line.
Press Ctrl+x to boot using the modified configuration.
At the switch_root prompt, remount the /sysroot file system read/write, then use chroot to go into a chroot jail at /sysroot.
switch_root:/#mount -o remount,rw /sysrootswitch_root:/#chroot /sysroot
Set the root password to redhat.
sh-4.4#passwd rootChanging password for user root. New password:redhatBAD PASSWORD: The password is shorter than 8 characters Retype new password:redhatpasswd: all authentication tokens updated successfully.
Configure the system to automatically perform a full SELinux relabel after boot.
sh-4.4#touch /.autorelabel
Type exit twice to continue booting your system. The system fails to boot because of an issue you resolve in the next step.
The system fails to boot. A start job does not seem to complete. From the console, fix the issue.
Boot the system into emergency mode.
To do so, reboot serverb by sending a Ctrl+Alt+Del to your system using the relevant button or menu entry.
When the boot-loader menu appears, press any key to interrupt the countdown, except Enter.
Use the cursor keys to highlight the default boot loader entry.
Press e to edit the current entry.
Use the cursor keys to navigate to the line that starts with linux.
Press End to move the cursor to the end of the line.
Append systemd.unit=emergency.target to the end of the line.
Press Ctrl+x to boot using the modified configuration.
Log in to emergency mode.
The root password is redhat.
Give root password for maintenance (or press Control-D to continue):redhat[root@serverb ~]#
Remount the / file system read/write.
[root@serverb ~]#mount -o remount,rw /
Use the mount -a command to attempt to mount all the other file systems.
[root@serverb ~]#mount -amount: /olddata: can't find UUID=4d5c85a5-8921-4a06-8aff-80567e9689bc.
Edit /etc/fstab to remove or comment out the incorrect line.
[root@serverb ~]#vim /etc/fstab...output omitted...#UUID=4d5c85a5-8921-4a06-8aff-80567e9689bc /olddata xfs defaults 0 0
Update systemd for the system to register the new /etc/fstab configuration.
[root@serverb ~]#systemctl daemon-reload[root@serverb ~]#
Verify that your /etc/fstab is now correct by attempting to mount all entries.
[root@serverb ~]#mount -a[root@serverb ~]#
Reboot the system and wait for the boot to complete.
Because you created the /.autorelabel file in the first step, after setting the root password, the system runs an SELinux relabel, then reboots again by itself.
The system should now boot normally.
[root@serverb ~]#systemctl reboot
Change the default systemd target on serverb for the system to automatically start a graphical interface when it boots.
No graphical interface is installed yet on serverb.
For this exercise, only set the default target and do not install the packages.
Log in to serverb as the root user.
Use redhat as the password.
Use the systemctl set-default command to set graphical.target as the default target.
[root@serverb ~]#systemctl set-default graphical.target
Use the systemctl get-default command to verify your work.
[root@serverb ~]#systemctl get-defaultgraphical.target
Log off from serverb.
[root@serverb ~]#exit