Checking your Disks

johnw's picture

From the mailing list. Needs formatting.

> Just something I do now before installing any system these days is to 
> boot a system with Knoppix and look at the disk smart logs. Maybe ubuntu 
> has this tool in the boot cd too? 
> smartctl -l error /dev/hda 
> You'll have to make a judgement on the errors (eg are they early in the 
> disks life) but ideally the log should be empty. 
> Run an extended test: 
> smartctl -t long /dev/hda 
> After the reported time, check the logs: 
> smartctl -l selftest /dev/hda 
> If there are new errors discovered in the tests then find another disk :-) 
> The smart tests are non-destructive so can be done after installing too. 
> There is also the badblocks tool which is useful for older disks without 
> smart capability. This can be run in a destructive mode. 

 use badblocks for older disks:- 


badblocks - search a device for bad blocks 

badblocks [ -svwnf ] [ -b block-size ] [ -c blocks_at_once 
] [ -i 
input_file ] [ -o output_file ] [ -p num_passes ] [ -t 
test_pattern ] 
device [ last-block ] [ start-block ] 

badblocks is used to search for bad blocks on a device (usually 
a disk 
partition). device is the special file corresponding to the 
(e.g /dev/hdc1). last-block is the last block to be checked; if 
it is 
not specified, the last block on the device is used as a 
start-block is an optional parameter specifying the starting 
block num- 
ber for the test, which allows the testing to start in the 
middle of 
the disk. If it is not specified the first block on the disk 
is used 
as a default.