aptitude install smartmontools
The first hard drive that I diagnosed with smartctl was my laptop's primary hard disk:
smartctl -a /dev/hdaThis showed a few unsettling results, but luckily no reallocation errors or other critical errors.
I got similar results for my external Western Digital Elements hard disk. That was good, because that's my backup disk. Phew.
My other external hard disk is an old Western Digital hard disk that's in a USB connected disk enclosure. I tried diagnosing it and got the following error:
root@machine-cycle:~# smartctl -a /dev/sdaI did as I was told (i.e. read the usage summary) and then tried the following:
smartctl 5.39 2009-10-10 r2955 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-9 by Bruce Allen, http://smartmontools.sourceforge.net
/dev/sda: Unsupported USB bridge [0x04b4:0x6830 (0x001)]
Smartctl: please specify device type with the -d option.
Use smartctl -h to get a usage summary
smartctl -a -d usbcypress /dev/sdaCypress happens to be the manufacturer of this enclosure's USB to IDE bridge, but smartctl doesn't seem to recognize it without my help.
Well, now I got a report from smartctl but it showed that one DMA CRC error was logged.
I ran tests on all hard disks with smartctl -t short ... for each device and they were all completed successfully. Phew. /Me wiping cold sweat off brow/
Next thing to do was to enable smartd to monitor all my hard disks:
- edit /etc/default/smartmontools and make sure you have the following line in it:
- start the daemon:
invoke-rc.d smartmontools start
- comment out the line that starts with DEVICESCAN (i.e. prepend it with a sharp sign #)
- add lines per each hard disk to be tested:
# primary diskNote that this schedules short self tests to run each morning at 5AM and long self tests to run on Sunday mornings at 4AM.
/dev/hda -a -o on -S on -s (S/../.././05|L/../../7/04) -m root -M exec /usr/share/smartmontools/smartd-runner
# /dev/gigapod (multimedia)
/dev/disk/by-path/pci-0000:02:00.2-usb-0:1.4:1.0-scsi-0:0:0:0 -a -d usbcypress -d removable -o on -S on -s (S/../.././05|L/../../7/04) -m root -M exec /usr/share/smartmontools/smartd-runner
# /dev/elements (backup)
/dev/disk/by-path/pci-0000:02:00.2-usb-0:1.1:1.0-scsi-0:0:0:0 -a -d sat -d removable -o on -S on -s (S/../.././05|L/../../7/04) -m root -M exec /usr/share/smartmontools/smartd-runner
Also note that I use the /dev/disk/by-path links to the external disk block device, in order not to be hit by udev's tendency to reorder device names.
Testing, 1, 2, 3 !