Filed under:

How do I test / check my hard disk ?

Your server will periodically (at least once every 180 days) check the validity of your hard-drive partitions and filesystems.
If you have had to hard-reboot your machine for any reason, we highly recommend doing a bad-block test and then a forced filesystem check, to prove the integrity of your drives ...

bad-block check

from an SSH prompt as root, find out the device names of your disk(s) with
df -H
this will list all your partitions and which device they occupy.
device names will be /dev/hda (ide exposed disks) /dev/sdb (scsi exposed disks) /dev/md (sw raid disks) etc - the number at the end is *NOT* part of the device name, it is the partition number on that device and can be ignored.

for each of the data partitions (not swap or memory [/dev/shm] types)
/sbin/badblocks -sv /dev/sda etc.

forced filesystem check

once you have completed the badblock tests and recovered any files, or restored anything missing, then you should perform a full filesystem check - please note this will take approximately 2 minutes for every Gb of used disk space.
from an SSH prompt as root, shutdown the box, with the reboot and Force checks ...
shutdown -rF now
the server will then restart and check the disks, you shoudl examine dmesg and /var/log/messages and /var/log/boot when it comes back up.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read