LINUX TROUBLESHOOTING

Basic System level checking

#lscpu
#lsmem
#lsblk
#ip addr
#ifconfig

Kernel level messages

#dmesg –T
#dmesg –T |less

System Processes


#top                                    

Check recent messages in system log messages


#journalctl -l -b | less
#less /var/log/messages
#less /var/log/secure

Booting related troubleshooting

Mostly you can find out some useful information about your system by looking at the boot.log file on your Linux machine. Some files required root access, so you may need to run the sudo command before these examples.


#cat /var/log/boot.log
#head /var/log/boot.log
#tail /var/log/boot.log

Diagnosing hardware failures


#lshw
#lsblk –a
#lscpu
#free -h

Reset root password on CentOS 7 & CentOS 8

Step 1- Restart the Linux machine

Step 2- Now edit GRUB Bootloader

Step 3- Now change root directory to /sysroot


chroot /sysroot

Step 4- Change root user password

Passwd

Step 5- At this stage relabel the filesystem for SELinux Security


touch /.autorelabel

Step 6- Exit the chroot environment

Exit

Step 7- Reboot

reboot