Comments on How to monitor harddisk health with smartmontools on Ubuntu
In this article I will give you an overveiw on the smartmontools which is a set of applications that can test hard drives and read their hardware SMART statistics to detect harddisk failures early. I will cover installation, usage on the shell and the smartmon gui in this tutorial.
7 Comment(s)
Comments
There's a mistype in short test command:
here: sudo smartctl -short /dev/sda (for short test)
correct:
sudo smartctl -t short /dev/sdaThere are many things I don't understand about Linux. This tutorial, like most Linux tutorials, is a tease. There is sufficient information to confirm that I want to use smartmontools but not enough information to help me understand what I want to do, why I want to do it and especially how to go about it.
What does DEVICESCAN mean. I have a PC with 1 internal drive and 4 usb drives. Will they all be monitored? What does "offline" mean. Usually "offline" means disconnected. How can a drive be disconnected and still working? Then there's "-m root". What is root's email address? How does root receive the messages? How does root read the messages? Must they be sent to root? I find man pages are frequently unhelpful. They seem to be written by experts for the consultation of other experts. The jargon is mostly impenetrable and useful explanations are scarce.
Your use of English is sometimes confusing. If I could understand what you are trying to say, I could help you rewrite it.
Is there a way to eliminate the check on a USB drive? Every ten minutes I get data added to the output of 'dmesg' which I'm not sure is valid. I tried '/dev/sdb -d ignore' in the smartd.conf file but still get a message every 10 minutes, 4 lines beginning "[sdb] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_SENSE' etc. It overloads the 'dmesg' information and makes it hard to see anything else.
Hello,
Can some one help me with this issue? We have a storage that has 224 disks. To check the detailed info on each disk, we enter the following command:
smartctl -a /dev/da1 (to check the first drive and there is 223 more to go).
Is it possible to have one command to check ALL of the disks with a single command, like using a wildcard or something?
Thanks.
Hi Bob,
Try this:
for i in `sudo fdisk -l | grep "^Disk /dev/sd" | awk '{print $2}'| cut -d":" -f 1`; do sudo smartctl -i "$i"; sleep 1; done
fdisk -l | will list all the devicesGrep ^Disk will only display lines starting with Diskawk will grab the 2nd colum of the linecut -d will use the trailing ":" on the line displayed as a field separator and delimit on the field 1 - this way we only get the the output /dev/sdX of all the matching devices in you case we hope that shows 224 disksThe for is a loop that takes all those 244 device name and loops over the results of the fdisk by using the smartd and the device names we extracted from fdisk.I added a sleep 1 to slow it down, you could replace with read instead which will wait for a return key or you could remove the sleep or set to 0 and and this at the end to write all output into a file >mydevicestatus.txt
Thank you very much for this article. I am very happy that I've learned a bit more about smartctl and my disks.
Very well written.
Thank you
"sudo smartctl -a -d ata /dev/sda (for SATA drives)"
throws an error on my system, "Read Device Identity failed: Invalid argument".
"sudo smartctl -a -d sat /dev/sda" works.