How to Diagnose and Fix Common Linux Boot, Network, and File‑System Failures
This guide walks through typical Linux operational problems—including boot failures caused by fstab errors, root‑filesystem corruption, missing kernel files, MBR or GRUB issues, network hardware and configuration faults, DNS mis‑settings, service port problems, forgotten root passwords, and read‑only file‑system errors—providing step‑by‑step troubleshooting methods and command‑line fixes.
Linux System Boot Failure
Common boot problems stem from four main causes:
Incorrect or missing /etc/fstab – mis‑configured file‑system entries prevent the system from mounting partitions. Recover the file by booting into rescue mode and rebuilding it.
Root‑filesystem corruption after illegal shutdown – sudden power loss can leave the ext3/ext4 file system inconsistent. The system drops to a maintenance shell showing messages such as
checking root filesystemand
UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. Run
fsck -y /dev/sdXafter unmounting the affected partition.
Missing kernel or initramfs files – the boot loader cannot find
vmlinuzor
initrd.imgin the
/bootpartition. Restore the files from installation media or a backup and update
grub.cfg.
Hardware failure – defective motherboard, power supply, or disk can also stop booting; replace the faulty component.
<code># umount /dev/sdb5
# fsck.ext3 -y /dev/sdb5</code>Always unmount the partition before running
fsck.
Linux Network Failure
Network issues are tackled in four steps:
Verify physical hardware (NIC, cables, switch, router) and replace if defective.
Check that the NIC driver is loaded using
ifconfigor
ip a. Use
ethtoolto inspect link speed and status.
Confirm correct IP configuration and ensure no address conflicts.
Inspect the routing table; a wrong default route (e.g., pointing to a LAN‑only subnet) can block external access. Adjust with
route delete defaultand
route add default gw 10.10.1.254.
<code># route delete default
# route add default gw 10.10.1.254</code>Check DNS resolution by reviewing
/etc/host.confand
/etc/nsswitch.conf(e.g.,
hosts: files dns).
MBR Sector Failure
Symptoms include “Operating system not found” and boot interruption. Recovery steps:
Add a new virtual disk, partition it (e.g.,
fdisk -l,
fdisk /dev/sdb), format, and mount it.
Backup the MBR with
dd if=/dev/sda of=~/mbr.backup bs=512 count=1.
In rescue mode, restore the MBR using the backup file.
GRUB Boot Failure
Two typical causes:
Incorrect
grub.cfgentries – the kernel or initramfs paths are wrong, leading to “error: you need to load the kernel first”. Fix by editing
/boot/grub2/grub.cfgto point to the correct files.
Missing GRUB files – the boot loader cannot locate its modules. Reinstall GRUB with
grub2-install /dev/sdaand regenerate the config.
<code># grub2-install /dev/sda
# grub2-mkconfig -o /boot/grub2/grub.cfg</code>Forgot Linux Root Password
Two recovery methods:
Rescue mode reset – boot from rescue media, chroot into the system (
chroot /mnt/sysimage) and run
passwd rootto set a new password.
Single‑user mode – at the GRUB menu press
e, append
singleto the kernel line, boot, then change the password with
passwd.
<code># chroot /mnt/sysimage
# passwd root
# exit
# reboot</code>Read‑Only File System Error
When commands such as
cp,
mv, or
chmodfail with “Read‑only file system”, possible causes are file‑system damage, disk errors, or a wrong
/etc/fstabentry.
Remount the filesystem read‑write:
mount -o rw,remount /system.
If the FS is corrupted, run
fsckon the unmounted device.
Hardware failure may require disk replacement.
<code># mount -o rw,remount /system
# fsck -y /dev/VolGroup00/LogVol00</code>Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
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.