Master Linux Troubleshooting: 9 Common Errors and Their Fixes
This guide walks you through a systematic approach to diagnosing and resolving nine frequent Linux system problems—from read‑only file systems and argument‑list limits to inode exhaustion, space‑not‑released files, too many open files, and Apache startup failures—providing clear command‑line solutions for each.
Like Windows, Linux can encounter many issues that intimidate newcomers, but a clear troubleshooting mindset and solid knowledge enable rapid resolution.
Effective Linux administration follows a four‑step process:
Pay attention to error messages – they often pinpoint the problem.
Examine log files – both system logs (/var/log) and application logs provide deeper insight.
Analyze and locate the cause – combine error output, logs, and context.
Apply the fix – once the root cause is known, the solution is straightforward.
Problem 1: "Read‑only file system" error
The filesystem may become read‑only after unrecoverable errors to protect data. Unmount the affected partition before running # umount /www/data. If the device is busy, identify the holding process:
# fuser -m /dev/sdb1 # ps -ef | grep 8800Stop the offending service (e.g., Apache) and retry unmounting, then repair:
# /usr/local/apache2/bin/apachectl stop # umount /www/data # fsck -V -a /dev/sdb1 # mount /dev/sdb1 /www/dataProblem 2: "Argument list too long" error
This occurs when a command receives more arguments than the kernel allows. Check disk usage first: # df -h Identify large directories, e.g., /var/spool/clientmqueue, then remove files using patterns, find, or a shell script. If necessary, increase ARG_MAX by recompiling the kernel.
Problem 3: Inode exhaustion causing application failure
Even with free disk space, a lack of free inodes prevents file creation. Verify with: # df -i Inspect inode details:
# dumpe2fs -h /dev/sda3 | grep 'Inode count' # ls -i filename # stat install.logFree inodes by deleting unnecessary files, e.g.:
# find /var/spool/clientmqueue/ -name "*" -exec rm -rf {} \;Problem 4: Deleted file not freeing space
On Linux, a file may remain allocated if a process still holds it open. Identify such files: # lsof | grep delete If /tmp/access_log is held by httpd, either restart the service or truncate the file without deleting it:
# echo "" > /tmp/access_logProblem 5: "Too many open files" error
The application exceeds the allowed number of file descriptors. Verify the limit: $ ulimit -n Ensure the limit is applied to the service user (e.g., www) via /etc/security/limits.conf and restart the service after changes.
Problem 6: Apache "no space left on device" despite free disk
When disk space and inodes are sufficient, the issue may be exhausted System‑V semaphores. Check semaphore settings:
# cat /proc/sys/kernel/sem # ipcs -s | grep daemonClear unused semaphores:
# ipcs -s | grep nobody | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm -s $a[1]` }'Problem 7: Linux system fails to boot
Common causes include corrupted root filesystem, misconfigured /etc/fstab or /etc/inittab, missing kernel files, broken GRUB, or hardware faults.
Problem 8: Filesystem corruption preventing boot
Boot messages such as "Checking root filesystem" followed by errors indicate corruption. Repair with:
# umount /dev/sda6 # fsck.ext3 -y /dev/sda6Problem 9: Access‑permission issues
When services cannot be reached, verify firewall rules:
# iptables -L -n # iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT # iptables -A OUTPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPTBy following these systematic steps, Linux administrators can quickly diagnose and resolve a wide range of common system errors.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
