# Linux-Troubleshooting Scenarios

Listen to this Post

Here are some key points for troubleshooting common issues in Linux systems:

1. Server Connectivity Issues

  • Ping the server by Hostname and IP Address:
    ping <hostname_or_ip> 
    
  • Check service availability with telnet command:
    telnet <ip> <port> 
    
  • Verify service status, firewall settings, logs, and configuration:
    systemctl status <service_name> 
    firewall-cmd --list-all 
    journalctl -xe 
    

2. Disk Space Full Issue

  • Detect system performance degradation:
    df -h 
    
  • Identify large files/directories:
    du -sh * | sort -h 
    
  • Check disk health:
    badblocks -v /dev/sdX 
    iotop 
    

3. Filesystem Corruption

  • Check log files for errors:
    cat /var/log/syslog | grep -i error 
    
  • Run fsck to repair filesystem:
    fsck /dev/sdX 
    

4. Fstab File Issues

  • Verify fstab entries:
    cat /etc/fstab 
    mount -a 
    

5. Memory Issues

  • Monitor memory usage:
    free -m 
    top 
    htop 
    
  • Manage high-memory processes:
    kill -9 <PID> 
    

6. Swap Space Management

  • Create and enable swap file:
    sudo fallocate -l 1G /swapfile 
    sudo chmod 600 /swapfile 
    sudo mkswap /swapfile 
    sudo swapon /swapfile 
    echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab 
    

# You Should Know:

Advanced Troubleshooting Commands

  • Network Diagnostics:
    netstat -tuln 
    ss -tuln 
    
  • Check Open Files:
    lsof | grep deleted 
    
  • System Performance:
    vmstat 1 
    sar -u 1 3 
    
  • Kernel Logs:
    dmesg | grep -i error 
    

Automated Log Analysis

grep -i "error|fail|critical" /var/log/*.log 

### **Recovering Deleted Files**

extundelete /dev/sdX --restore-file /path/to/file 

### **Checking for Hardware Failures**

smartctl -a /dev/sdX 

# What Undercode Say

Linux troubleshooting requires a systematic approach—check logs, verify configurations, and use the right tools. Key commands like df, du, top, fsck, and `journalctl` are essential. Always monitor system health with vmstat, iostat, and dmesg. For persistent issues, consider rescue mode or live USB diagnostics. Automation with scripts (bash, awk, sed) can streamline debugging.

# Expected Output:

A fully structured troubleshooting guide with verified Linux commands for resolving common system issues.

References:

Reported By: Manoj K – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image