[smartmontools-support] Smartd is not running selective tests

Anthony Desmarais anthony at tunguydesmarais.com
Sat Apr 8 13:51:15 CEST 2023


HI I think I may have resolved the issue. Adding solution here for 
anyone who may encounter it:

My smartd.conf file had the following lines:

/dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907 -I 194 -d 
ata -f -l error -l selftest -l selfteststs  -m 
anthony at tunguydesmarais.com  -n standby,12,q -s (S/>
/dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z -I 194 -d ata -a -m 
anthony at tunguydesmarais.com -n standby,12,q -s 
(S/../../2/03|n/../../(1|3|5)/01)
/dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M -I 194 -d ata -a -m 
anthony at tunguydesmarais.com -n standby,12,q -s 
(S/../../2/03|n/../../(1|3|5)/02)


Note that I had passed in the argument "-d ata" for the two drives in 
question  - these are SATA drives connected to the motherboards SATA 
connectors (ASUS B150 Pro  gaming aurora motherboard)
I had assumed that this the correct argument to pass.

I however have removed that argument and run Christians suggestion and 
this time smartd launched the selective test just fine. I will make the 
change in my normal smartd.conf file and leave the service runninga dn 
report back here it is now works.

Thanks

Anthony



On 2023/04/08 13:38, Anthony Desmarais wrote:
> Thanks for the help Christain.
>
> I did what you asked for and the below is what the output was. Dont 
> know why it is complaining about inappropriate ioctl for device when I 
> run fin manually with smartctl
>
> [root at gateway ~]# smartd -c /root/smartd.conf  -q onecheck
> smartd 7.3 2022-02-28 r5338 [x86_64-linux-6.2.8-200.fc37.x86_64] 
> (local build)
> Copyright (C) 2002-22, Bruce Allen, Christian Franke, 
> www.smartmontools.org
>
> Opened configuration file /root/smartd.conf
> Configuration file /root/smartd.conf parsed.
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907 
> [ata], unique name: /dev/sda
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907, 
> opened
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907, 
> SQF-S25M8-256G-SAC, S/N:2FA6078110F500505907, FW:SAFM02A3, 256 GB
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907, 
> not found in smartd database 7.3/5319.
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907, 
> can't monitor Current_Pending_Sector count - no Attribute 197
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907, 
> can't monitor Offline_Uncorrectable count - no Attribute 198
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907, 
> is SMART capable. Adding to "monitor" list.
> Device: /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z [ata], 
> unique name: /dev/sdc
> Device: /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z, opened
> Device: /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z, WDC 
> WD80PURZ-85YNPY0, S/N:R6GE804Z, WWN:5-000cca-263c606df, FW:80.H0A80, 
> 8.00 TB
> Device: /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z, found in 
> smartd database 7.3/5319: Western Digital Purple
> Device: /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z, is SMART 
> capable. Adding to "monitor" list.
> Device: /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M [ata], unique 
> name: /dev/sdb
> Device: /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M, opened
> Device: /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M, 
> ST6000VX001-2BD186, S/N:ZR13347M, WWN:5-000c50-0e3da56c5, FW:CV12, 
> 6.00 TB
> Device: /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M, found in 
> smartd database 7.3/5319: Seagate Skyhawk
> Device: /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M, is SMART 
> capable. Adding to "monitor" list.
> Monitoring 3 ATA/SATA, 0 SCSI/SAS and 0 NVMe devices
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907, 
> opened ATA device
> Device: /dev/disk/by-id/ata-SQF-S25M8-256G-SAC_2FA6078110F500505907, 
> previous self-test completed without error
> Device: /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z, opened ATA 
> device
> Device: /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z, previous 
> self-test completed without error
> Write Selective Self-test Log failed: Inappropriate ioctl for device
> Device: /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z, prepare 
> Selective Self-Test failed
> Device: /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M, opened ATA 
> device
> Device: /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M, previous 
> self-test completed without error
> Write Selective Self-test Log failed: Inappropriate ioctl for device
> Device: /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M, prepare 
> Selective Self-Test failed
> Started with '-q onecheck' option. All devices successfully checked once.
> smartd is exiting (exit status 0)
>
>
> On 2023/04/05 19:44, Christian Franke wrote:
>> Anthony Desmarais wrote:
>>> On 2023/03/28 09:05, Christian Franke wrote:
>>>> Anthony Desmarais wrote:
>>>>> Hi wonder if anyone can help me.
>>>>>
>>>>> I have two drives in my one linux box running Fedora 37. I also 
>>>>> have smartmontools ver 7.3-3.
>>>>>
>>>>> The box has a western digital purple 8TB drive as well as a 
>>>>> Seagate Skyhawk 6TB drive.
>>>>>
>>>>> I am trying to get smartd to run a selective test every monday at 
>>>>> 1am, performing a test of about a quarter of the drive every week.
>>>>>
>>>>> To start with I executed the first selective test manually with 
>>>>> the following commands:
>>>>>
>>>>> smartctl -t select,0-3907013292 
>>>>> /dev/disk/by-id/ata-WDC_WD80PURZ-85YNPY0_R6GE804Z
>>>>> smartctl -t select,0-2930261292 
>>>>> /dev/disk/by-id/ata-ST6000VX001-2BD186_ZR13347M
>>>>>
>>>>> Both of these ran just fine and I can see in the smart report that 
>>>>> the tests completed successfully (see attached text file 
>>>>> containing both reports).
>>>>>
>>>>
>>>> Do these disks preserve Selective Self-test log across power cycles?
>>>> If not, is smartd state persistence enabled (see -s option on 
>>>> smartd man page for details) ?
>>>
>>> Yes on both the Fedora and Debian boxes smartd is being run with the 
>>> -s option:
>>>
>>> /[root at gateway ~]# ps aux |grep smartd//
>>> //root       10512  0.0  0.0  10640  6016 ?        Ss Mar27 0:00 
>>> /usr/sbin/smartd -n -q never --interval=3600 -s 
>>> /var/lib/smartmontools///
>>> /
>>>
>>> /root at debian:~# ps aux | grep smartd//
>>> //root       466  0.0  0.0   7428  1448 ?        Ss Mar15 0:01 
>>> /usr/sbin/smartd -n -q never --interval=5400 -s 
>>> /var/lib/smartmontools//
>>>
>>> And on both of them the /var/lib/smartmontools folder has regularly 
>>> updated .state files.
>>>
>>
>> Then I have no idea why this does not work.
>>
>> Please Prepare a temporary smartd-test.conf file with a '-s' 
>> directive which matches current hour and then run
>>
>>   smartd -c smartd-test.conf -q onecheck
>>
>> and provide its output.
>>
>>
>>> ...
>>>
>>> I also note that smartd is being run as root so should have 
>>> permissions to run smartctl.
>>>
>>
>> Smartd does not run smartctl. It directly calls the selective 
>> self-test functions also used by smartctl.
>>
>>
>> Regards,
>> Christian
>>


More information about the Smartmontools-support mailing list