Table of contents
- Issue 1: Server Connectivity Problem ๐ Approach / Solution:
- Issue 2: Unable to Connect to Website/Application ๐ Approach / Solution:
- Issue 3: Unable to SSH ๐ Approach / Solution:
- Issue 4: Full Disk Space or Disk Extension ๐ Approach / Solution:
- Issue 5: Corrupted Filesystem ๐ Approach / Solution:
- Issue 6: Fstab File Errors ๐ Approach / Solution:
- Issue 7: Can't cd to Directory ๐ Approach / Solution:
- Issue 8: Can't Create Links ๐ Approach / Solution:
- Issue 9: Running Out of Memory ๐ Approach / Solution:
- Issue 10: Add/Extend Swap Space ๐ Approach / Solution:
- Issue 11: Unable to Run Commands ๐ Approach / Solution:
- Issue 12: Unexpected System Reboot and Process Restart ๐ Approach / Solution:
- Issue 13: Unable to Get IP Address ๐ Approach / Solution:
- Issue 14: Backup and Restore File Permissions ๐ Approach / Solution:
- ๐ก Useful Disk Partition Tip ๐ก:
When it comes to troubleshooting on Unix/Linux systems, having the right approach is key. Whether you're a Software Developer, DevOps Engineer, or Architect, understanding the problems and their resolutions is vital in this widespread environment.
Let's dive into some common scenarios and their solutions:
Issue 1: Server Connectivity Problem ๐ Approach / Solution:
โ Ping server by Hostname and IP Address.
โ Check if Hostname/IP Address is pingable.
โ If only IP is pingable, it might be a DNS issue.
๐ Check
/etc/hosts
,/etc/resolv.conf
, and/etc/nsswitch.conf
.๐ Optionally, check DNS in
/etc/sysconfig/network-scripts/ifcfg-<interface>
.
โ If neither is pingable, investigate network side or server-specific problems.
๐ Check uptime, IP status, routes, Selinux, and Firewall rules.
๐ Examine physical cable connections.
Issue 2: Unable to Connect to Website/Application ๐ Approach / Solution:
โ Ping server by Hostname and IP Address.
โ If pingable, use telnet to check service availability.
- โ If service is running, inspect firewall, logs, and configuration.
Issue 3: Unable to SSH ๐ Approach / Solution:
โ Ping server by Hostname and IP Address.
โ If pingable, use telnet to check service availability.
- โ If service is running, verify user status, shell, and root login.
๐ Check service status, firewall, logs, and configuration.
Issue 4: Full Disk Space or Disk Extension ๐ Approach / Solution:
โ Detect system performance degradation.
โ Identify space issues with
df
and find large files withdu
.๐ Compress/remove large files, move items, check disk health.
๐ Add new disk, create partitions (LVM), extend filesystems.
Issue 5: Corrupted Filesystem ๐ Approach / Solution:
โ Check logs for errors causing boot failure.
โ Run
fsck
for bad sectors.- ๐ง Reboot into rescue mode, fix filesystem, edit
fstab
entries.
- ๐ง Reboot into rescue mode, fix filesystem, edit
Issue 6: Fstab File Errors ๐ Approach / Solution:
โ Check logs for boot errors.
โ Run
fsck
for bad sectors.- ๐ง Reboot into rescue mode, fix filesystem, edit
fstab
entries.
- ๐ง Reboot into rescue mode, fix filesystem, edit
Issue 7: Can't cd to Directory ๐ Approach / Solution:
- ๐ Check directory existence, path conflicts, permissions, and executability.
Issue 8: Can't Create Links ๐ Approach / Solution:
- ๐ Check target existence, path conflicts, permissions, ownership.
Issue 9: Running Out of Memory ๐ Approach / Solution:
๐ Monitor cache and RAM usage with commands like
free -h
.โ Identify memory-hungry processes, adjust priorities, extend swap space.
Issue 10: Add/Extend Swap Space ๐ Approach / Solution:
โ Create swap file, set permissions, enable swap with
swapon
.๐ Update
fstab
for persistence.
Issue 11: Unable to Run Commands ๐ Approach / Solution:
- โ Troubleshoot permission, sudo access, paths, installation issues.
Issue 12: Unexpected System Reboot and Process Restart ๐ Approach / Solution:
๐ Investigate system crash reasons (CPU, RAM, kernel, hardware).
๐ Understand process restart methods and watchdog applications.
Issue 13: Unable to Get IP Address ๐ Approach / Solution:
๐ Check IP assignment methods (DHCP, Static).
โ Troubleshoot network settings, NIC status, and restart network service.
Issue 14: Backup and Restore File Permissions ๐ Approach / Solution:
๐ Create ACL file before changing permissions, restore with
setfacl
.๐ธ Consider VM snapshots or rebuilds for restoring permissions.
๐ก Useful Disk Partition Tip ๐ก:
๐ Rescan new disk status with
echo 1 > /sys/block/sda/device/rescan
.๐ Expanding existing disks appends space, doesn't affect existing data.
๐ Recreate filesystems to format old data, share
.vmdk
for replication.
Mastering Linux troubleshooting helps ensure smooth operations and efficient problem-solving in your IT journey! ๐๐ง