RHCSA Rapid Track
In this lab, you will recover from an error in /etc/fstab.
| Resources: | |
|---|---|
| Machines: |
serverX
|
Outcomes
After completing this exercise, your machine should boot normally again, without user intervention.
Reset your
serverXsystem.Log in and set up your
serverXsystem:[student@serverX ~]$lab bootbreakfs setup
You had a new admin in your team, but it was decided that it would be in everybody's best interest if that admin pursued a different career.
Now that your staffing issue has been solved, there are a couple of remaining issues. One of them is a machine that had been “fixed” by this admin.
Take a good look at the console of your
serverXmachine. It seems it is stuck early on.Take a minute to speculate about a possible cause for this behavior, then reboot the machine and interrupt the boot loader menu countdown. (If you wait long enough, the system will eventually spawn a rescue shell by itself, but that can take a while.)
Usually you would send a Ctrl+Alt+Del to your system to reboot it. This particular boot problem causes that key sequence to retry the boot sequence again without rebooting. In this case, either wait for the task to timeout or use the power switch to force a reboot.
When the boot loader menu appears after the BIOS self-test, press any key to interrupt the countdown.
Looking at the error you had during the previous boot, it appears that at least parts of the system are still functioning. Since you know the
rootpassword (redhat), attempt anemergencyboot.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
linux16.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 config.
Log into the emergency mode. Pay close attention to any errors you might receive.
At the
Give root password for maintenanceprompt, enterredhat.
Inspect what file systems are currently mounted.
[root@localhost ~]#mount... /dev/vda1 on / type xfs (ro,relatime,seclabel,attr2,inode64,noquota)
It appears that the root file system is mounted read-only; mount it read-write.
[root@localhost ~]#mount -o remount,rw /
Attempt to mount all the other file systems:
[root@localhost ~]#mount -amount: mount point /RemoveMe does not exist
Open
/etc/fstabin an editor and fix the issue.[root@localhost ~]#vi /etc/fstabRemove the invalid line (the one with
RemoveMe).Save your changes, then exit your editor.
Verify that your
/etc/fstabis now correct by attempting to mount all entries.[root@localhost ~]#mount -a
Exit your
emergencyshell and reboot the system by typing reboot. Your system should now boot normally.