16th October, 2020
Step 1: Boot into single-user mode by appending the command line during but with the following
Step 2: when you are presented with a command prompt, change the root user password.
Step3: Reboot the system and validate that the new root password works correctly:
When you enter single-user mode, you may encounter an issue where the root user’s password can’t be changed.
Step1: Verify the existence of the /etc/shadow file:
#ls /etc/ grep shadow
Step 2: If the /etc/shadow file doesn’t exist, use the pwconv cmd to re-create the /etc/shadow file:
Step 3: Now execute the passwd command to reset or change the root user’s password:
Step 4: Reboot the system and validate that the new root password works correctly:
If you are having trouble booting the system and you have determined that the master boot record (MBR) is corrupt you need to boot into rescue mode. Use the Red Hat DVD, boot from it, and choose the option to enter rescue mode.
Step 1: After you boot, enter the GRUB shell:
Step 2: Locate the root drive:
Step 3: Reinstall the MBR from the GRUB shell:
Grub> setup (hdʘ)
Step 4: Reboot the system to validate that the system boots properly:
When we have an inconsistency to the file /etc/fstab and the file systems listed by blkid utility. Then the system will go to rescue mode
---> To troubleshoot this problem provide the root password for the maintenance
---> When we provide the root password correctly then a shell prompt will be opened
---> At this movement the file system is mounted in read-only mode, hence we can’t change the file system table (fstab file)
---> So mount the file system in rw mode
#mount –o remount, rw/
---> Now open the file /etc/fstab
Now remove (or) change the file systems which leads to inconsistency and save the fstab file and reboot the pc
Inclined to build a profession as Linux Developer? Then here is the blog post on, explore Linux Training
The grub password is to be maintained in the file
#grub-md5-crypt >> /boot / grub /grub.conf
When we type the above command then an encrypted password comes to the last line of the file
We have to copy that encrypted password and paste in the same file under the line “hidden menu”
Password – md5 <encrypted passwd>
Here we have to paste the encrypted password
Step 1: use the Red Hat DVD, boot from it, and choose the option to enter Rescue mode
Boot: Linux rescues
Select keyboard => select language => select networking
Then a shell will be opened
At this moment to give the privilege to the root user to maintain the file system
Here we can follow the above-mentioned procedures of recovering the root password and grub password.
If the superblock on your system has become corrupt, you can re-create it with one of the backup superblocks. If the primary file system has the corruption you may need to use single-user mode or the rescue environment to perform the recovery.
Step 1: Check the state of the file system:
#dumpe2fs h /dev/sda 1
Step 2: Find a valid backup superblock:
#dumpe2fs /dev/sda 1 / grep –i superblock
Step 3: Repair the file system with a backup superblock:
#e2fsck -f -b 8193 /dev/sda1
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills .
Write For Us