Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S.M.A.R.T. support for USB multi-disk enclosure QNAP TR-004 #1302

Closed
jlanza opened this issue May 6, 2022 · 5 comments
Closed

S.M.A.R.T. support for USB multi-disk enclosure QNAP TR-004 #1302

jlanza opened this issue May 6, 2022 · 5 comments

Comments

@jlanza
Copy link

jlanza commented May 6, 2022

Is your feature request related to a problem? Please describe.
I have a QNAP TR-004 configured as a JBOD with 4 6TB disks connected to a RPI4. Although the device support hardware RAID I prefer to use snapRAID with mergeFS to manage the disks.
The disks and partitions are properly discovered and managed by OMV, however when I want to cofigure S.M.A.R.T. the GUI is not displaying the information. I know that normal drives connected to SATA are discovered and manage.

From the command line I have been able to read the information about my disks. Below you can find the information about one of them /dev/sda.

$ sudo smartctl -d jmb39x-q,0 -x /dev/sda
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.15.32-v8+] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD60EFZX-68B3FN0
Serial Number:    WD-C82B9M2K
LU WWN Device Id: 5 0014ee 26a2ab987
Firmware Version: 81.00A81
User Capacity:    6,001,175,126,016 bytes [6.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5640 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri May  6 16:22:26 2022 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
AAM feature is:   Unavailable
APM feature is:   Unavailable
Rd look-ahead is: Enabled
Write cache is:   Enabled
DSN feature is:   Unavailable
ATA Security is:  Disabled, NOT FROZEN [SEC1]
Write SCT (Get) Feature Control Command failed: DATA OUT ATA commands not implemented [JMB39x]
Wt Cache Reorder: Unknown (SCT Feature Control command failed)

=== START OF READ SMART DATA SECTION ===
SMART Status not supported: NO DATA ATA commands not implemented [JMB39x]
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever 
					been run.
Total time to complete Offline 
data collection: 		(63540) seconds.
Offline data collection
capabilities: 			 (0x11) SMART execute Offline immediate.
					No Auto Offline data collection support.
					Suspend Offline collection upon new
					command.
					No Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					No Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 ( 672) minutes.
SCT capabilities: 	       (0x303d)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
  1 Raw_Read_Error_Rate     POSR-K   100   253   051    -    0
  3 Spin_Up_Time            POS--K   253   221   021    -    4025
  4 Start_Stop_Count        -O--CK   100   100   000    -    12
  5 Reallocated_Sector_Ct   PO--CK   200   200   140    -    0
  7 Seek_Error_Rate         -OSR-K   100   253   000    -    0
  9 Power_On_Hours          -O--CK   100   100   000    -    9
 10 Spin_Retry_Count        -O--CK   100   253   000    -    0
 11 Calibration_Retry_Count -O--CK   100   253   000    -    0
 12 Power_Cycle_Count       -O--CK   100   100   000    -    5
192 Power-Off_Retract_Count -O--CK   200   200   000    -    3
193 Load_Cycle_Count        -O--CK   200   200   000    -    23
194 Temperature_Celsius     -O---K   125   119   000    -    27
196 Reallocated_Event_Count -O--CK   200   200   000    -    0
197 Current_Pending_Sector  -O--CK   200   200   000    -    0
198 Offline_Uncorrectable   ----CK   100   253   000    -    0
199 UDMA_CRC_Error_Count    -O--CK   200   200   000    -    0
200 Multi_Zone_Error_Rate   ---R--   100   253   000    -    0
                            ||||||_ K auto-keep
                            |||||__ C event count
                            ||||___ R error rate
                            |||____ S speed/performance
                            ||_____ O updated online
                            |______ P prefailure warning

ATA_READ_LOG_EXT (addr=0x00:0x00, page=0, n=1) failed: 48-bit ATA commands not implemented [JMB39x]
Read GP Log Directory failed

SMART Log Directory Version 1 [multi-sector log support]
Address    Access  R/W   Size  Description
0x00           SL  R/O      1  Log Directory
0x01           SL  R/O      1  Summary SMART error log
0x02           SL  R/O      5  Comprehensive SMART error log
0x04           SL  R/O      8  Device Statistics log
0x06           SL  R/O      1  SMART self-test log
0x09           SL  R/W      1  Selective self-test log
0x30           SL  R/O      9  IDENTIFY DEVICE data log
0x80-0x9f      SL  R/W     16  Host vendor specific log
0xa0-0xa7      SL  VS      16  Device vendor specific log
0xa8-0xb6      SL  VS       1  Device vendor specific log
0xb7           SL  VS      82  Device vendor specific log
0xbd           SL  VS       1  Device vendor specific log
0xc0           SL  VS       1  Device vendor specific log

SMART Extended Comprehensive Error Log (GP Log 0x03) not supported

SMART Error Log Version: 1
No Errors Logged

SMART Extended Self-test Log (GP Log 0x07) not supported

Read SMART Self-test Log failed: ATA command not implemented due to truncated response [JMB39x]

Selective Self-tests/Logging not supported

SCT Status Version:                  3
SCT Version (vendor specific):       258 (0x0102)
Device State:                        Active (0)
Current Temperature:                    26 Celsius
Power Cycle Min/Max Temperature:     20/26 Celsius
Lifetime    Min/Max Temperature:     19/33 Celsius
Under/Over Temperature Limit Count:   0/0

Write SCT Data Table failed: DATA OUT ATA commands not implemented [JMB39x]
Read SCT Temperature History failed

Write SCT (Get) Error Recovery Control Command failed: DATA OUT ATA commands not implemented [JMB39x]
SCT (Get) Error Recovery Control command failed

ATA_SMART_READ_LOG failed: ATA command not implemented due to truncated response [JMB39x]
Read Device Statistics page 0x00 failed

Pending Defects log (GP Log 0x0c) not supported

ATA_READ_LOG_EXT (addr=0x11:0x00, page=0, n=1) failed: 48-bit ATA commands not implemented [JMB39x]
Read SATA Phy Event Counters failed

However the information displayed with OMV interface is different and not the correct one.

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC xxxxxxx
Serial Number:    WD-xxxxxx
Firmware Version: 0965
User Capacity:    6,001,175,126,016 bytes [6.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA/ATAPI-7 (minor revision not indicated)
Local Time is:    Mon Apr 25 13:31:18 2022 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
AAM feature is:   Unavailable
APM feature is:   Disabled
Rd look-ahead is: Disabled
Write cache is:   Disabled
DSN feature is:   Unavailable
ATA Security is:  Disabled, frozen [SEC2]
Wt Cache Reorder: Unavailable

=== START OF READ SMART DATA SECTION ===
SMART Status not supported: Incomplete response, ATA output registers missing
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.

General SMART Values:
Offline data collection status:  (0x00)    Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Total time to complete Offline
data collection:         (    0) seconds.
Offline data collection
capabilities:              (0x00)     Offline data collection not supported.
SMART capabilities:            (0x0000)    Automatic saving of SMART data                    is not implemented.
Error logging capability:        (0x00)    Error logging NOT supported.
                    No General Purpose Logging support.

General Purpose Log Directory not supported

SMART Log Directory Version 0
Address    Access  R/W   Size  Description
0x00           SL  R/O      1  Log Directory

SMART Extended Comprehensive Error Log (GP Log 0x03) not supported

SMART Error Log not supported

SMART Extended Self-test Log (GP Log 0x07) not supported

SMART Self-test Log not supported

Selective Self-tests/Logging not supported

SCT Commands not supported

Device Statistics (GP/SMART Log 0x04) not supported

Pending Defects log (GP Log 0x0c) not supported

SATA Phy Event Counters (GP Log 0x11) not supported

Describe the solution you'd like
I would like to be able to get the S.M.A.R.T information from OMV GUI, and to configure it to properly send email errors, information, etc.

Describe alternatives you've considered
As you can see in this thread in OMV forum I have tried to manually modify smartd.conf, the .inc files, etc. so the disks are properly identified by OMV.

However, I must be doing something wrong as the information is not displayed.

As an alternative I'm thinking on disable S.M.A.R.T and manually configure everything using the console. Actually in that case maybe OMV is not required :( (just kidding)

Additional context

Following the suggestion from this thread in OMV forum, I'm including the output of the following commands that might help on identifying the devices.

$  ls -alh /sys/block/sda/
total 0
drwxr-xr-x 9 root root    0 May  6 16:02 .
drwxr-xr-x 3 root root    0 May  6 16:02 ..
-r--r--r-- 1 root root 4.0K May  6 16:14 alignment_offset
lrwxrwxrwx 1 root root    0 May  6 16:14 bdi -> ../../../../../../../../../../../../../../virtual/bdi/8:0
-r--r--r-- 1 root root 4.0K May  6 16:14 capability
-r--r--r-- 1 root root 4.0K May  6 16:02 dev
lrwxrwxrwx 1 root root    0 May  6 16:14 device -> ../../../0:0:0:0
-r--r--r-- 1 root root 4.0K May  6 16:14 discard_alignment
-r--r--r-- 1 root root 4.0K May  6 16:14 diskseq
-r--r--r-- 1 root root 4.0K May  6 16:14 events
-r--r--r-- 1 root root 4.0K May  6 16:14 events_async
-rw-r--r-- 1 root root 4.0K May  6 16:14 events_poll_msecs
-r--r--r-- 1 root root 4.0K May  6 16:14 ext_range
-r--r--r-- 1 root root 4.0K May  6 16:14 hidden
drwxr-xr-x 2 root root    0 May  6 16:14 holders
-r--r--r-- 1 root root 4.0K May  6 16:14 inflight
drwxr-xr-x 3 root root    0 May  6 16:14 mq
drwxr-xr-x 2 root root    0 May  6 16:14 power
drwxr-xr-x 3 root root    0 May  6 16:02 queue
-r--r--r-- 1 root root 4.0K May  6 16:14 range
-r--r--r-- 1 root root 4.0K May  6 16:02 removable
-r--r--r-- 1 root root 4.0K May  6 16:14 ro
drwxr-xr-x 5 root root    0 May  6 16:02 sda1
-r--r--r-- 1 root root 4.0K May  6 16:14 size
drwxr-xr-x 2 root root    0 May  6 16:02 slaves
-r--r--r-- 1 root root 4.0K May  6 16:14 stat
lrwxrwxrwx 1 root root    0 May  6 16:02 subsystem -> ../../../../../../../../../../../../../../../class/block
drwxr-xr-x 2 root root    0 May  6 16:14 trace
-rw-r--r-- 1 root root 4.0K May  6 16:02 uevent
$ ls -alh /sys/block/sda/device/
total 0
drwxr-xr-x 8 root root    0 May  6 16:02 .
drwxr-xr-x 7 root root    0 May  6 16:02 ..
-r--r--r-- 1 root root 4.0K May  6 16:14 blacklist
drwxr-xr-x 3 root root    0 May  6 16:02 block
drwxr-xr-x 3 root root    0 May  6 16:02 bsg
--w------- 1 root root 4.0K May  6 16:14 delete
-r--r--r-- 1 root root 4.0K May  6 16:14 device_blocked
-r--r--r-- 1 root root 4.0K May  6 16:14 device_busy
lrwxrwxrwx 1 root root    0 May  6 16:14 driver -> ../../../../../../../../../../../../../bus/scsi/drivers/sd
-rw-r--r-- 1 root root 4.0K May  6 16:14 eh_timeout
-r--r--r-- 1 root root 4.0K May  6 16:14 evt_capacity_change_reported
-r--r--r-- 1 root root 4.0K May  6 16:14 evt_inquiry_change_reported
-r--r--r-- 1 root root 4.0K May  6 16:14 evt_lun_change_reported
-r--r--r-- 1 root root 4.0K May  6 16:14 evt_media_change
-r--r--r-- 1 root root 4.0K May  6 16:14 evt_mode_parameter_change_reported
-r--r--r-- 1 root root 4.0K May  6 16:14 evt_soft_threshold_reached
lrwxrwxrwx 1 root root    0 May  6 16:14 generic -> scsi_generic/sg0
-r--r--r-- 1 root root    0 May  6 16:14 inquiry
-r--r--r-- 1 root root 4.0K May  6 16:14 iocounterbits
-r--r--r-- 1 root root 4.0K May  6 16:14 iodone_cnt
-r--r--r-- 1 root root 4.0K May  6 16:14 ioerr_cnt
-r--r--r-- 1 root root 4.0K May  6 16:14 iorequest_cnt
-rw-r--r-- 1 root root 4.0K May  6 16:14 max_sectors
-r--r--r-- 1 root root 4.0K May  6 16:14 modalias
-r--r--r-- 1 root root 4.0K May  6 16:02 model
drwxr-xr-x 2 root root    0 May  6 16:14 power
-r--r--r-- 1 root root 4.0K May  6 16:14 queue_depth
-rw-r--r-- 1 root root 4.0K May  6 16:14 queue_type
--w------- 1 root root 4.0K May  6 16:14 rescan
-r--r--r-- 1 root root 4.0K May  6 16:02 rev
drwxr-xr-x 3 root root    0 May  6 16:02 scsi_device
drwxr-xr-x 3 root root    0 May  6 16:02 scsi_disk
drwxr-xr-x 3 root root    0 May  6 16:02 scsi_generic
-r--r--r-- 1 root root 4.0K May  6 16:14 scsi_level
-rw-r--r-- 1 root root 4.0K May  6 16:14 state
lrwxrwxrwx 1 root root    0 May  6 16:02 subsystem -> ../../../../../../../../../../../../../bus/scsi
-rw-r--r-- 1 root root 4.0K May  6 16:14 timeout
-r--r--r-- 1 root root 4.0K May  6 16:02 type
-rw-r--r-- 1 root root 4.0K May  6 16:02 uevent
-r--r--r-- 1 root root 4.0K May  6 16:02 vendor
-r--r--r-- 1 root root 4.0K May  6 16:14 wwid
$ cat /sys/block/sda/device/vendor
QNAP    
$ cat /sys/block/sda/device/model
TR-004 DISK00   
$ udevadm info --query=property --name=sda
DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2:1.0/host0/target0:0:0/0:0:0:0/block/sda
DEVNAME=/dev/sda
DEVTYPE=disk
DISKSEQ=26
MAJOR=8
MINOR=0
SUBSYSTEM=block
USEC_INITIALIZED=28590011
ID_VENDOR=QNAP
ID_VENDOR_ENC=QNAP\x20\x20\x20\x20
ID_VENDOR_ID=1c04
ID_MODEL=TR-004_DISK00
ID_MODEL_ENC=TR-004\x20DISK00\x20\x20\x20
ID_MODEL_ID=0013
ID_REVISION=6108
ID_SERIAL=QNAP_TR-004_DISK00_51323139423030333130-0:0
ID_SERIAL_SHORT=51323139423030333130
ID_TYPE=disk
ID_INSTANCE=0:0
ID_BUS=usb
ID_USB_INTERFACES=:080650:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=usb-storage
ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:2:1.0-scsi-0:0:0:0
ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_2_1_0-scsi-0_0_0_0
ID_PART_TABLE_UUID=22b6846e-9368-4ecd-8962-d0069fea5eff
ID_PART_TABLE_TYPE=gpt
DEVLINKS=/dev/disk/by-id/usb-QNAP_TR-004_DISK00_51323139423030333130-0:0 /dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:2:1.0-scsi-0:0:0:0
TAGS=:systemd:
CURRENT_TAGS=:systemd:
jlanza@nas:~ $ cat /proc/partitions
major minor  #blocks  name

   1        0       4096 ram0
   1        1       4096 ram1
   1        2       4096 ram2
   1        3       4096 ram3
   1        4       4096 ram4
   1        5       4096 ram5
   1        6       4096 ram6
   1        7       4096 ram7
   1        8       4096 ram8
   1        9       4096 ram9
   1       10       4096 ram10
   1       11       4096 ram11
   1       12       4096 ram12
   1       13       4096 ram13
   1       14       4096 ram14
   1       15       4096 ram15
 179        0   62367744 mmcblk0
 179        1     262144 mmcblk0p1
 179        2   62101504 mmcblk0p2
   8       16 5860522584 sdb
   8       17 5860521543 sdb1
   8        0 5860522584 sda
   8        1 5860521543 sda1
   8       32 5860522584 sdc
   8       33 5860521543 sdc1
   8       48 5860522584 sdd
   8       49 5860521543 sdd1
@jlanza jlanza added the feature label May 6, 2022
@votdev
Copy link
Member

votdev commented May 6, 2022

All 4 disks are accessible via device files?

1. disk is /dev/sda
2. disk is /dev/sdb
3. disk is /dev/sdc
4. disk is /dev/sdd

Can you confirm that running the following commands are reporting the correct data?

$ sudo smartctl -d jmb39x-q,0 -x /dev/sda
$ sudo smartctl -d jmb39x-q,1 -x /dev/sdb
$ sudo smartctl -d jmb39x-q,2 -x /dev/sdc
$ sudo smartctl -d jmb39x-q,3 -x /dev/sdd

Can you confirm the following output?

$ cat /sys/block/sda/device/model
TR-004 DISK00
$ cat /sys/block/sdb/device/model
TR-004 DISK01
$ cat /sys/block/sdc/device/model
TR-004 DISK02
$ cat /sys/block/sdd/device/model
TR-004 DISK03

@votdev votdev added the 6.x label May 6, 2022
@jlanza
Copy link
Author

jlanza commented May 6, 2022

All 4 disks are accessible via device files?

1. disk is /dev/sda
2. disk is /dev/sdb
3. disk is /dev/sdc
4. disk is /dev/sdd

Yes

Can you confirm that running the following commands are reporting the correct data?

$ sudo smartctl -d jmb39x-q,0 -x /dev/sda
$ sudo smartctl -d jmb39x-q,1 -x /dev/sdb
$ sudo smartctl -d jmb39x-q,2 -x /dev/sdc
$ sudo smartctl -d jmb39x-q,3 -x /dev/sdd

I can confirm that the output of these commands is different. Actually the serial numbers differ from one command to the other and they properly match the serial numbers of the corresponding disk in each bay. Besides the statistics are also different, and correspond to the disk usages (I have written in one to check and so on).

Can you confirm the following output?

$ cat /sys/block/sda/device/model
TR-004 DISK00
$ cat /sys/block/sdb/device/model
TR-004 DISK01
$ cat /sys/block/sdc/device/model
TR-004 DISK02
$ cat /sys/block/sdd/device/model
TR-004 DISK03
$ cat /sys/block/sda/device/model
TR-004 DISK00   
$ cat /sys/block/sdb/device/model
TR-004 DISK01   
$ cat /sys/block/sdc/device/model
TR-004 DISK02   
$ cat /sys/block/sdd/device/model
TR-004 DISK03   

@votdev votdev closed this as completed in 778ceb1 May 8, 2022
@votdev
Copy link
Member

votdev commented May 8, 2022

Feature will be available in openmediavault 6.0.27.

@jlanza
Copy link
Author

jlanza commented May 9, 2022

I will provide you feedback as soon as possible. Thanks a lot for the quick response to the new feature.
I think the only problem from the new commit could be the case where not all the bays in the TR-004 are used. I will check it anyway.

@votdev
Copy link
Member

votdev commented May 9, 2022

I've attached the latest package here. If you want you can give it a try, so we can check if it works before it is official released.

openmediavault_6.0.27-1_all.zip

$ wget https://github.com/openmediavault/openmediavault/files/8649773/openmediavault_6.0.27-1_all.zip
$ sudo apt-get install unzip
$ unzip openmediavault_6.0.27-1_all.zip
$ sudo dpkg -i openmediavault_6.0.27-1_all.deb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants