RHCSA Rapid Track
In this exercise, you will recover a system from a misconfiguration in /etc/fstab that causes the boot process to fail.
Outcomes
You should be able to diagnose /etc/fstab issues and use emergency mode to recover the system.
Log in as the student user on workstation using student as the password.
On workstation, run the lab boot-repairing start command.
This command runs a start script that determines if the servera machine is reachable on the network.
It also introduces a file-system issue, sets a higher timeout for the GRUB2 menu, and reboots servera.
[student@workstation ~]$lab boot-repairing start
Access the
serveraconsole and notice that the boot process is stuck early on.Locate the icon for the
serveraconsole, as appropriate for your classroom environment. Open the console.Notice that a start job does not seem to complete. Take a minute to speculate about a possible cause for this behavior.
To reboot, send a Ctrl+Alt+Del to your system using the relevant button or menu entry. With this particular boot problem, this key sequence may not immediately abort the running job, and you may have to wait for it to time out before the system reboots.
If you wait for the task to time out without sending a Ctrl+Alt+Del, the system eventually spawns an emergency shell by itself.
When the boot-loader menu appears, press any key to interrupt the countdown, except Enter.
Looking at the error from the previous boot, it appears that at least parts of the system are still functioning. Because you know the
rootpassword,redhat, attempt an emergency boot.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.targetto the end of the line.Press Ctrl+x to boot using the modified configuration.
Log in to emergency mode. The
rootpassword isredhat.Give root password for maintenance (or press Control-D to continue):
redhat[root@servera ~]#Determine which file systems are currently mounted.
[root@servera ~]#mount...output omitted... /dev/vda1 on/type xfs (ro,relatime,seclabel,attr2,inode64,noquota) ...output omitted...Notice that the root file system is mounted read-only.
Remount the root file system read/write.
[root@servera ~]#mount -o remount,rw /Use the mount -a command to attempt to mount all the other file systems. With the
--all(-a) option, the command mounts all the file systems listed in/etc/fstabthat are not yet mounted.[root@servera ~]#mount -amount: /RemoveMe: mount point does not exist.Edit
/etc/fstabto fix the issue.Remove or comment out the incorrect line.
[root@servera ~]#vim /etc/fstab...output omitted...#/dev/sdz1 /RemoveMe xfs defaults 0 0Update
systemdfor the system to register the new/etc/fstabconfiguration.[root@servera ~]#systemctl daemon-reload
Verify that your
/etc/fstabis now correct by attempting to mount all entries.[root@servera ~]#mount -aReboot the system and wait for the boot to complete. The system should now boot normally.
[root@servera ~]#systemctl reboot