Right now my external drive does not has any errors but I just want to check manually to make sure.
As seen from image below, the option for SMART data and Self-Test is greyed out. Also see the details about the hard drive in image itself.
I tried running
gksu gnome-disks
but still the option is greyed out.I ran
sudo smartctl --all /dev/sdb --test=short -T permissive
I got this error:smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.19.0-15-generic] (local build) Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org Read Device Identity failed: scsi error unsupported field in scsi command === START OF INFORMATION SECTION === Device Model: [No Information Found] Serial Number: [No Information Found] Firmware Version: [No Information Found] Device is: Not in smartctl database [for details use: -P showall] ATA Version is: [No Information Found] Local Time is: Wed Jun 17 11:33:46 2015 IST SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported. SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled. A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
I had the same problem. In my case, S.M.A.R.T had been working properly on the device for years while using Ubuntu 12.04, and then under Ubuntu 14.04 it happened exactly what you tell in the question.
The problem is related to a new kernel module that was introduced in Linux Kernel 3.15 called
uas
(USB Attached SCSI) (see release announcement).That module is now the responsible of managing USB Mass Storage Devices. There is a thread where people complain that
uas
in kernel 3.15 is causing their USB devices to fail. Another one says that it might be the cause of S.M.A.R.T problems.Fortunately, those problems seem to be gone at kernel 3.19 (which I am using), as my device is being detected correctly. Only the S.M.A.R.T problem remains.
To fix it, you need to disable the use of
uas
module for the given device.Disable
uas
without rebootingFirst, unplug all USB devices that might be using it. Then, remove the
uas
andusb-storage
modules:Then, load
usb-storage
module with a parameter that tells it to not useuas
for a given device:VendorId
andProductId
must be replaced by your device vendor and product id, which can be obtained withlsusb
command (they are the characters afterID
).For example, I have the following device:
So my vendor id is
0bc2
, and my product id is3320
. My command is:The last
u
tellsusb-storage
to ignoreuas
for the device (see source).At this point, you can insert the USB device, and it will know not to use
uas
, making S.M.A.R.T work properly. You will see lines like these indmesg
when inserting the USB device:Make the change permanent
The previous quirk will only last until you reboot the system. To make it persistent, you need to follow the steps described here, which I copy below:
First, create a file named
ignore_uas.conf
in the/etc/modprobe.d/
directory with the following content:As before, substitute
VendorId
andProductId
by your device vendor and product id obtained fromlsusb
.Next, regenerate your inital ramdisk:
or, on newer Ubuntu versions:
Finally, reboot your computer.
Edit: More background on the issue, and another way to get around it without disabling uas (which has better throughput than usb-storage) can be found here: https://www.smartmontools.org/ticket/971#comment:12
It seems that kernel is blacklisting
SAT ATA PASS-THROUGH
on some devices when running in uas mode, as they have broken firmware.So, the blacklisting can be disabled (at your own risk) by using the previous method I mention in the answer, but removing the final
u
from the quirk, ie:Please note, however, that I have not tested this approach.
External drives (via USB, I assume) are tricky with SMART. Some don't work at all. The
smartmontools
people posted a list of hard drives with command-line switches to add tosmartctl
(see fifth column).For Seagate Expansion drives in particular, it looks like you need either
-d sat
or-d sat,12
. Try the following:If one of those works, it tells you which
-d
switch to add to yoursmartctl
commands.I had two Seagate drives connected so I modified @Terrance command to:
echo "options usb-storage quirks=$(lsusb | awk '/Seagate/ {print $6":u"}' | tr '\n' ',' | head -c-1)" | sudo tee -a /etc/modprobe.d/ignore_uas.conf
Which gives a correct separator (and flag repetition) for multiple elements:
options usb-storage quirks=0bc2:3320:u,0bc2:2323:u
This substitution of 'newline' characters by ',' is probably not made in the most elegant way (requires to remove the extra separator using
head
), but it seems to work.Then:
sudo update-initramfs -u
And reboot as in original answer.
Just an update I am adding on to Alvaro's answer
Just tested this in Ubuntu 18.04 for an external Seagate drive that I have where I could not get
smartctl
to read the drive at all. It did require a reboot because I did not want to get behind my system and mess with the USB connections.First ran
lsusb
and got all my info for the drive:As you can see my drive has the name
Seagate
in it, so all I had to do is to run the following line to add the info to the/etc/modprode.d/ignore_uas.conf
file:Just remember to replace
Seagate
with the name of your drive. Now when I look at/etc/modprode.d/ignore_uas.conf
I see it as:Then just run the
update-initramfs
for the changes to become permanent:Then reboot your system. Now the smartctl is able to read my external drive.
Hope this helps!
check the table with supported USB Devices ...
the switch
-d sat
indicates, that it's supposed to be a drive with SATA port.there are specific switches for certain USB bridges -
lsusb
might show the concrete name. if the bridge controller might have a bad implementation - just try to connect it native through SATA instead of USB.SCSI and ATA (according to the shell output) are probably not what you are looking for :)