Want to diagnose corrupt disk issues on a server? Want to find out why you are getting “disk full” messages on screen? Want to learn how to solve full/corrupt and failed disk issues. Try these eight tips to diagnose a Linux and Unix server hard disk drive problems.
When the Disk is full on Unix-like system you get an error message on screen. In this example, I’m running fallocate command and my system run out of disk space:
The first step is to run the df command to find out information about total space and available space on a file system including partitions:$ df
OR try human readable output format:$ df -h
Sample outputs:
From the df command output it is clear that /dev/sda10 has 4.0Gb of total space of which 4.0Gb is used.
You may end up getting an error such as follows when you try to create a file or save a file:$ cat > file
-bash: file: Read-only file system
Run mount command to find out if the file system is mounted in read-only mode:$ mount
$ mount | grep '/ftpusers'
To fix this problem, simply remount the file system in read-write mode on a Linux based system:# mount -o remount,rw /ftpusers/tmp
Another example, from my FreeBSD 9.x server to remount / in rw mode:# mount -o rw /dev/ad0s1a /
Sometimes, df command reports that there is enough free space but system claims file-system is full. You need to check for the inode which identifies the file and its attributes on a file systems using the following command:$ df -i
$ df -i /ftpusers/
Sample outputs:
So /ftpusers has 62,50,496 total inodes but only 11,568 are used. You are free to create another 62,38,928 files on /ftpusers partition. If 100% of your inodes are used, try the following options:
I/O errors in log file (such as /var/log/messages) indicates that something is wrong with the hard disk and it may be failing. You can check hard disk for errors using smartctl command, which is control and monitor utility for SMART disks under Linux and UNIX like operating systems. The syntax is:
You can also use “Disk Utility” to get the same information
High temperatures can cause server to function poorly. So you need to maintain the proper temperature of the server and disk. High temperatures can result into server shutdown or damage to file system and disk. Use hddtemp or smartctl utility to find out the temperature of your hard on a Linux or Unix based system by reading data from S.M.A.R.T. on drives that support this feature. Only modern hard drives have a temperature sensor. hddtemp supports reading S.M.A.R.T. information from SCSI drives too. hddtemp can work as simple command line tool or as a daemon to get information from all servers:
You can use the smartctl command as follows too:
You can use Linux hardware monitoring tool such as lm_sensor to get the cpu temperature on a Linux based system:
File system on server may be get corrupted due to a hard reboot or some other error such as bad blocks. You can repair corrupted file systems with the following fsck command:
See how to surviving a Linux filesystem failures for more info.
To find the current status of a Linux software raid type the following command:
You need to replace a failed hard drive. You must u remove the correct failed drive. In this example, I’m going to replace /dev/sdb (2nd hard drive of RAID 6). It is not necessary to take the storage offline to repair the RAID on Linux. This only works if your server support hot-swappable hard disk:
See our tips on increasing RAID sync speed on Linux for more information.
You can use the samrtctl command or vendor specific command to find out the status of RAID and disks in your controller:
See your vendor specific documentation to replace a failed disk.
Article Number: 674
Posted: Fri, May 15, 2020 11:43 AM
Last Updated: Fri, May 15, 2020 11:43 AM
Online URL: http://kb.ictbanking.net/article.php?id=674