# RH342 - Red Hat Enterprise Linux Diagnostics and Troubleshooting Cheat sheets extracted from the RH342 (RHEL 8.4) student guide. ## Contents 1. [[01 Collecting Information and Logs]] - journalctl, rsyslog, log locations 2. [[02 Boot Loader Troubleshooting]] - GRUB2, grubby, efibootmgr, rescue mode 3. [[03 Hardware Identification]] - dmesg, lscpu, dmidecode, rasdaemon 4. [[04 Storage Stack and Troubleshooting]] - LVM, device mapper, XFS repair, Stratis 5. [[05 Network Troubleshooting]] - nmcli, ping, nmap, firewalld, tcpdump 6. [[06 SELinux Troubleshooting]] - contexts, booleans, ports, ausearch, sealert 7. [[07 Kernel Crash Dumps (kdump)]] - kdump configuration, vmcore analysis ## Quick Reference ### Logs ```bash journalctl -b # Current boot logs journalctl -u httpd.service # Service logs ausearch -m avc -ts recent # SELinux denials ``` ### Boot Issues ```bash grubby --default-kernel # Show default kernel grubby --set-default /boot/vmlinuz-xxx systemd.unit=rescue.target # Boot to rescue mode ``` ### Hardware ```bash lscpu # CPU info dmidecode -t memory # Memory info dmesg -T # Kernel messages ``` ### Storage ```bash lsblk -f # Block devices xfs_repair /dev/xxx # Repair XFS lvs; vgs; pvs # LVM info ``` ### Network ```bash nmcli device status # Network devices ss -tuln # Listening ports firewall-cmd --list-all # Firewall rules ``` ### SELinux ```bash getenforce # SELinux mode ausearch -m avc -ts recent # Recent denials restorecon -Rv /path # Fix contexts setsebool -P boolean on # Set boolean ``` ### Kdump ```bash kdumpctl status # Kdump status echo c > /proc/sysrq-trigger # Test crash (dangerous!) crash vmlinux vmcore # Analyze dump ```