Linux Troubleshooting Scenarios - Part 2
Sagar R Ravkhande
Posted on January 6, 2023
Continuation from Part 1 of our Linux Troubleshooting Scenarios here is the Part-2 of the next scenarios to be discussed.
Issue 1: fstab file missing or bad entry
Approach / Solution:
├── One of the errors that cause the system unable to BOOT UP
├── Check /var/log/messages, dmesg, and other log files
├── If we have a bad sector log, we have to run fsck
│ ├── True:
│ │ ├── reboot the system into resuce mode as booting it from
CDROM by applying ISO
│ │ ├── proceed with option 1, which mounts the original root
filesystem under/mnt/sysimage
│ │ ├── edit fstab entries or create a new file with the help of
blkid and reboot
Issue 2: Can’t cd to the directory even if the user has sudo privileges
Approach / Solution:
├── Reasons and Resolution
│ ├── Directory does not exist
│ ├── Pathname conflict: relative vs absolute path
│ ├── Parent directory permission/ownership
│ ├── Doesn't have executable permission on the target directory
│ ├── Hidden directory
Issue 3: Can’t Create Links
Approach / Solution:
├── Reasons and Resolution
│ ├── Target directory/File does not exist
│ ├── Pathname conflict: relative vs absolute path - (should be
complete path)
│ ├── Parent directory permission/ownership
│ ├── Target file permission/ownership - (as there should be read
permission)
│ ├── Hidden directory/file
Issue 4: Running Out of Memory
Approach / Solution:
├── Types
│ ├── Cache (L1, L2, L3)
│ ├── RAM
│ │ ├── Usage
│ │ │ ├── #free -h
│ │ │ │ ├── Total (Total assigned memory)
│ │ │ │ ├── Used (Total actual used memory)
│ │ │ │ ├── Free (Actual free memory)
│ │ │ │ ├── Shared (Shared Memory)
│ │ │ │ ├── Buff/Cache (Pages cache memory)
│ │ │ │ ├── Available (Memory can be freed)
│ │ │ ├── /proc/meminfo
│ │ │ │ ├── file active
│ │ │ │ ├── file inactive
│ │ │ │ ├── anon active
│ │ │ │ ├── anon inactive
│ ├── Swap (Virtual Memory)
├── Resolution
│ ├── Identify the processes that are using high memory using top,
htop, ps etc.
│ ├── Check the OOM in logs and also check if there is a memory
commitment in sysctl.conf
│ ├── Kill or restart the process/service
│ ├── prioritize the process using nice
│ ├── Add/Extend the swap space
│ ├── Add more physical RAM
Issue 5: Add/ Extend the Swap Space
Approach / Solution:
├── Due to running out of memory, we would need to add more swap
space
│ ├── Create a file with #dd, as it will reserve the blocks of
disk for swap file
│ ├── Set permission 600 and give root ownership
│ ├── #mkswap
│ ├── Now Turned swap on #swapon
│ ├── fstab entry for persistent
💖 💪 🙅 🚩
Sagar R Ravkhande
Posted on January 6, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.