Checking your Disks
johnw - Tue, 2006-10-10 18:16
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(8) BADBLOCKS(8) NAME badblocks - search a device for bad blocks SYNOPSIS 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 ] DESCRIPTION badblocks is used to search for bad blocks on a device (usually a disk partition). device is the special file corresponding to the device (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 default. 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.