LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-08-2019, 07:30 PM   #1
GotLinux
LQ Newbie
 
Registered: Jan 2019
Posts: 4

Rep: Reputation: Disabled
USB 3.0 S.M.A.R.T monitoring my SSD via BOT


Hello,

I had a hard time getting valid values from smartctl on my raspbian. I am using a an external USB 3.0 enclosure on an USB 2.0 port. The raspbian does not allow the UAS driver to load for some reason - instead the dwc_otg driver is used.

Code:
[    3.091394] usb 1-1.3.4.2: new high-speed USB device number 6 using dwc_otg
[    3.302288] usb 1-1.3.4.2: New USB device found, idVendor=152d, idProduct=0578
[    3.307910] usb 1-1.3.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.313771] usb 1-1.3.4.2: Product: External Disk 3.0
[    3.316780] usb 1-1.3.4.2: Manufacturer: JMicron
[    3.319683] usb 1-1.3.4.2: SerialNumber: 3026E513203588
[    3.323115] usb 1-1.3.4.2: The driver for the USB controller dwc_otg_hcd does not support scatter-gather which is
[    3.328911] usb 1-1.3.4.2: required by the UAS driver. Please try an other USB controller if you wish to use UAS.
[    3.334868] usb 1-1.3.4.2: The driver for the USB controller dwc_otg_hcd does not support scatter-gather which is
[    3.340918] usb 1-1.3.4.2: required by the UAS driver. Please try an other USB controller if you wish to use UAS.
[    3.347230] usb-storage 1-1.3.4.2:1.0: USB Mass Storage device detected
[    3.351004] usb-storage 1-1.3.4.2:1.0: Quirks match for vid 152d pid 0578: 1000000
[    3.357663] scsi host0: usb-storage 1-1.3.4.2:1.0
[    4.391968] scsi 0:0:0:0: Direct-Access     SAMSUNG  SSD PM810 mSATA  0204 PQ: 0 ANSI: 6
[    4.399403] sd 0:0:0:0: [sda] 125045424 512-byte logical blocks: (64.0 GB/59.6 GiB)
[    4.406770] sd 0:0:0:0: [sda] Write Protect is off
[    4.410322] sd 0:0:0:0: [sda] Mode Sense: 47 00 00 08
[    4.410656] sd 0:0:0:0: [sda] Disabling FUA
[    4.414157] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    4.424020]  sda: sda1 sda2
[    4.429071] sd 0:0:0:0: [sda] Attached SCSI disk
But figured out that I can get the values via a "smartctl -d sat ..."
Without the d option the usb bridge type cannot be found automatically.

What I am asking me now is. Does USB 2.0 without UAS support S.M.A.R.T. at all? And how does smartctl can work without UAS?

I am wondering because the wiki article https://de.wikipedia.org/wiki/USB_Attached_SCSI (german) states that UAS introduces SMART capabilities with USB 3.0.
So why does it work at all in my case, as I am not loading the uas driver at all?

Regards,
GotLinux
 
Old 01-09-2019, 03:44 PM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
See https://github.com/raspberrypi/linux/issues/875 with regard to progress on UAS.

The English version of that Wikipedia page says "The Linux kernel has been supporting UAS since 8 June 2014 when the version 3.15 was released".
 
Old 01-09-2019, 04:10 PM   #3
GotLinux
LQ Newbie
 
Registered: Jan 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
Ok. But as it falls back to the usb-storage/dwc_otg modules I am still wondering why the S.M.A.R.T. functionality even works.
I am just curious.
 
Old 01-09-2019, 05:27 PM   #4
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
See the man page for smartctl, especially for the -d option:-
Quote:
...usbjmicron[,p][,x][,PORT] - this device type is for SATA disks that are behind a JMicron USB to
PATA/SATA bridge. The 48-bit ATA commands (required e.g. for ´-l xerror´, see below) do not work with
all of these bridges and are therefore disabled by default. These commands can be enabled by ´-d usb‐
jmicron,x´. If two disks are connected to a bridge with two ports, an error message is printed if no
PORT is specified. The port can be specified by ´-d usbjmicron[,x],PORT´ where PORT is 0 (master) or 1
(slave). This is not necessary if the device uses a port multiplier to connect multiple disks to one
port. The disks appear under separate /dev/ice names then. CAUTION: Specifying ´,x´ for a device
which does not support it results in I/O errors and may disconnect the drive. The same applies if the
specified PORT does not exist or is not connected to a disk.
Note that Manufacturer: JMicron (in your 1st post) - this presumably refers to the USB?
 
Old 01-09-2019, 05:41 PM   #5
GotLinux
LQ Newbie
 
Registered: Jan 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
Ah I didn´t saw that. I tried it but it cannot connect to the bridge.

Code:
pi@raspberrypi:~ $ sudo smartctl -d usbjmicron /dev/sda -a
smartctl 6.6 2016-05-31 r4324 [armv7l-linux-4.14.79-v7+] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sda [USB JMicron] failed: No device connected
but a "-d sat" does...
 
Old 01-09-2019, 05:49 PM   #6
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Well that one doesn't mention USB.
Quote:
sat[,auto][,N] - the device type is SCSI to ATA Translation (SAT). This is for ATA disks that have a
SCSI to ATA Translation (SAT) Layer (SATL) between the disk and the operating system. SAT defines two
ATA PASS THROUGH SCSI commands, one 12 bytes long and the other 16 bytes long. The default is the 16
byte variant which can be overridden with either ´-d sat,12´ or ´-d sat,16´.
 
Old 01-09-2019, 09:36 PM   #7
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
S.M.A.R.T is designed for HDD (mechanical drives), not SSD.

SSDs have the advantage that they do not require head seeks to another track when the hard drive is re-mapped. It should be noted that many of the S.M.A.R.T. utilities were originally designed for hard disk drives, which means they do not report SSD data correctly. When an attribute value is below the manufacturer’s threshold, the hard disk is considered unreliable. Often the attributes are incorrectly identified and a perfectly healthy SSD is reported as failing.

Therefore it is extremely important to use a utility that specifically supports SSDs.

Last edited by Brains; 01-09-2019 at 09:39 PM.
 
1 members found this post helpful.
Old 01-10-2019, 07:33 AM   #8
GotLinux
LQ Newbie
 
Registered: Jan 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
After some research I think I found out how it works in general.

The usb-storage driver wraps the SSD drive access behind a scsi layer. Which seems to be common for USB storage.
http://www.linux-usb.org/USB-guide/x498.html

As there may be some bugs/nonconformity (?) with the USB controller in the enclosure, UAS is not supported. Also there may be lacking support in the dwc_otg driver.
https://github.com/raspberrypi/linux/issues/875

So the way to go is "SAT" - which sends ATA commands via 2 SCSI commands to the drive. Some kind of tunneling.
https://en.wikipedia.org/wiki/SCSI_/_ATA_Translation
https://en.wikipedia.org/wiki/USB_ma...ce_class#Linux

@Brains
Hm.. but there are thresholds attributed in the SSD itself. I don´t see anything wrong about using S.M.A.R.T. for SSDs at all. As it still can determine read/write failures, temperatures etc.. What utilities do you have in mind?
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New User added, bot not able to login via SSH Kumaresanpvk77 Linux - Server 15 03-10-2016 02:25 AM
[SOLVED] I have a SSD a 500GB drive and a 2TB drive and want to move Ubuntu from 500GB to SSD greatormesby Linux - Newbie 12 07-06-2015 09:58 AM
To SSD or not to SSD jlinkels Linux - Hardware 14 10-02-2012 07:36 AM
SSD raid1 vs SSD raid10 advice ? wonker Linux - Hardware 8 05-23-2012 01:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration