Web Hosting Talk







View Full Version : Linux check hard disk command?


ckpeter
06-10-2002, 11:53 PM
I have been working with linux for a while now, but I still haven't figure out a way to check and see if a HD has failed/is failing. Does anyone knows a command to check that? I did at one point a found something, but it requires the disk to be unmounted, which was not acceptable for me, since my whole HD is partitioned as a single file system. Are there any command that doesn't require unmount? (like scandisk in windows).

Also, any other utilities for testing other system components? (network, CPU, memory?)

Thanks,

Peter

ffeingol
06-11-2002, 12:03 AM
The only command that I know of is fsck and yes, the file system must be unmounted for that.

Normally linux will put messages in /var/log/messages if there are hardware problems with a drive.

Frank

Haze
06-11-2002, 03:25 AM
I don't know if this is exactly what your after or if it will help, but the badblocks command might help. i.e. badblocks -sv /dev/hda6

ckpeter
06-11-2002, 11:08 AM
Well, so there are no commands that can check a HD without it being unmounted?

What are my options if I have a server at rackshack and I want to check the HD?

Would it be safe/sufficient to just wait for the error in logs?

Thanks,

Peter

ffeingol
06-11-2002, 11:52 AM
Well typically Unix file systems do not suffer from the same file system problems as a Windows box. I'm not really aware of any commands to test the hardware for errors.

A lot of people use journaling file systems (EXT3) so fsck's are almost never necessary.

Frank

ckpeter
06-11-2002, 12:13 PM
I know ext3 will help reduce fsck, but does it also help when there is a HD failure?

Thanks,

Peter

admin0
06-12-2002, 07:18 AM
If you have physical access to the server, then 1 way of running fsck to check your hard-disk is to boot from the CD on resuce mode and then running fsck.

When you have no access to the server, then your messages or the kernel log will report any hard-disk abnormalities.

But the best thing is that on reboot, fsck will run to check the integrity of the hard-drive. This does not happen at every reboot, but as specified in /etc/rc.sysconfig.

You can modify the file to have fsck run at every reboot.


Hope this helps.

ckpeter
06-12-2002, 07:46 AM
Thanks a lot for all your help. I think I will just wait until something happens. Scheduling boot-time scan will be too much downtime for my clients. (which is why I asked about "hot-check")

Thanks,

Peter