Wednesday, September 03, 2014

Hard Disk Maintenance on Linux

How to check/repair ( fsck) filesystem after crash or power outage:

http://linuxpoison.blogspot.ca/2009/04/how-to-checkrepair-fsck-filesystem.html
http://linuxpoison.blogspot.tw/2008/01/howto-check-disk-drive-for-errors-and.html

The command 'fsck' when run with no options will check all devices in /etc/fstab.

With options, run
$ sudo fsck -t ext3 -l bad-blocks /dev/hda1

For better diagnosis, run fsck from single-user mode (You need to be "root" to use any command)
* Take system down to runlevel one: # init 1

Please note if any files are recovered then they are placed in /home/lost+found directory by fsck command.

I/O errors in /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 / UNIX like operating systems.
smartctl for servers
http://www.cyberciti.biz/tips/linux-find-out-if-harddisk-failing.html

smartctl -a shows a disk's SMART diagnostics.

You cn also do Linux Performance Monitoring with Vmstat and Iostat Commands:
http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/

If vmstat and iostat commands are not available on your box, please install sysstat package. The vmstat, sar and iostat commands are the collection of package included in sysstat – the system monitoring tools. The iostat generates reports of CPU & all device statistics.

Download sysstat package ( Latest sysstat version is 11.0.0 (2014-06-17)) sysstat package is available as RPM, tar.gz and tar.bz2 files. This development version contains all the latest features included in sysstat:

http://sebastien.godard.pagesperso-orange.fr/download.html

No comments:

Post a Comment