Detect a failing hard-disk on a Linux server

Posted on January 9, 2020 at 4:33 pm

When there is an hard-disk failing issue generally the file system will be read-only.

You would get errors like these:

rm: cannot remove 'error.log': Read-only file system
cannot create temp file for here-document: Read-only file system
-bash: df: command not found

To detect these kind of issues you can check if / is mounted as read-only, i.e:

root@server:/root# egrep " ro,|,ro " /proc/mounts | grep "/ ext4"
/dev/sda2 / ext4 ro,noatime,errors=remount-ro,data=ordered 0 0

Another check is to see if “df” command returns “command not found”:

root@server:/root# df
-bash: df: command not found

Hope that helps!

Receive updates via email

Other Posts

Updated Posts