Unit 3 Bonus - Storage
NOTE: This is an optional bonus section. You do not need to read it, but if you're interested in digging deeper, this is for you.
When storage issues arise, troubleshooting step by step ensures a quick resolution. This guide flows logically, covering the most common issues you might face, from slow performance to filesystem corruption.
🔍 Step 1: Is Storage Performance Slow?
If everything feels sluggish, your disk might be the bottleneck.
Check:
# Monitor disk I/O, latency, and throughput
iostat -xz 1
# Identify processes consuming high I/O
pidstat -d 1
# Real-time disk activity monitoring
iostat -dx 1
- If I/O wait is high, it means the CPU is waiting on slow disk operations.
- If certain processes are consuming all disk bandwidth, they might be the cause.
Fix:
- Identify and stop unnecessary high I/O processes:
- Optimize filesystem writes (for ext4):
- Reduce excessive metadata writes:
- If using LVM, extend the volume to reduce fragmentation:
🔍 Step 2: Is the Filesystem Full? ("No Space Left on Device")
👉 Disk space exhaustion is one of the most common causes of storage failures.
Check:
- If a filesystem is 100% full, it prevents writes and can cause application crashes.
- If there's space but files still won't write, check Step 4 (Corrupted Filesystem).
Fix:
- Find and remove large unnecessary files:
- Truncate logs safely without deleting them:
# Clear log contents while preserving file
truncate -s 0 /var/log/syslog
# Limit journal size
journalctl --vacuum-size=100M
- Expand disk space if using LVM:
# Extend logical volume
lvextend -L +10G /dev/examplegroup/lv_data
# Resize filesystem
resize2fs /dev/examplegroup/lv_data # for ext4
xfs_growfs /mnt/data # for XFS
🔍 Step 3: Are Mounts Failing? (LVM, fstab, NFS, SMB)
If files suddenly disappear or applications complain about missing storage, a mount issue may be the cause.
Check:
# View current mounts
mount | grep /mnt/data
# Check block devices
lsblk
# Verify permanent mount configuration
cat /etc/fstab
Fix:
- Manually remount the filesystem (if missing):
- Ensure correct fstab entry for persistence:
- If an LVM mount is missing after reboot, reactivate it:
# Activate volume groups
vgchange -ay
# Mount the logical volume
mount /dev/examplegroup/lv_data /mnt/data
- For NFS issues, check connectivity and restart services:
🔍 Step 4: Is the Filesystem Corrupted?
👉 Power losses, unexpected shutdowns, and failing drives can cause corruption.
Check:
# Check kernel error messages
dmesg | grep -i "error"
# Check filesystem integrity (non-destructive)
fsck.ext4 -n /dev/sdX # for ext4
xfs_repair -n /dev/sdX # for XFS
Fix:
- Repair the filesystem (if unmounted):
# Unmount first
umount /dev/sdX
# Run filesystem repair
fsck -y /dev/sdX # for ext4
xfs_repair /dev/sdX # for XFS
- If corruption is severe, restore from backup:
🔍 Step 5: Are You Out of Inodes?
You might have disk space but still can't create files? Check your inodes!
Check:
- If inode usage shows 100%, you can't create new files even with free space.
- This happens when you have too many small files.
Fix:
- Clean up temporary files:
- Find and remove unnecessary files: