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

WDC WD50NDZW-11MR8S1 spin up problem #104

Closed
stksz opened this issue Jul 24, 2021 · 2 comments
Closed

WDC WD50NDZW-11MR8S1 spin up problem #104

stksz opened this issue Jul 24, 2021 · 2 comments

Comments

@stksz
Copy link

stksz commented Jul 24, 2021

Hi,
I have the disk mentioned in the subject connected to a Raspi4 (OS: Raspbian 11 / smartmontools-version: 7.2) via USB 3. After a few days of operation I realized that the disk got woken up (from a "self spin-down") by smartd. The according log shows entries like this one:

smartd[1280]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 123 to 122

For debugging purposes the spin-down was then set with the following command to a lower value (and I used smartctl for further testing):

sdparm --flexible -6 -l --set SCT=900 /dev/sda

After some playing around with hdparm (especially with "-y" and "-Y") it seems that setting the disk to sleep/standby-mode has different effects in regards to how smartctl handles the disk when called with "-n"-parameter. I did the following three test-scenarios with the appended output:

Disk set to standby

root@raspi2:~# hdparm -y /dev/sda

/dev/sda:
 issuing standby command
SG_IO: bad/missing sense data, sb[]:  f0 00 01 00 50 40 00 0a 80 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
root@raspi2:~# smartctl -r ioctl -n standby /dev/sda
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.10.27-v8+] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org


REPORT-IOCTL: Device=/dev/sda Command=CHECK POWER MODE
 Input:   FR=...., SC=...., LL=...., LM=...., LH=...., DEV=...., CMD=0xe5
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [ata pass-through(16): 85 06 2c 00 00 00 00 00 00 00 00 00 00 00 e5 00 ]
  scsi_status=0x2, sg_transport_status=0x0, sg_driver_status=0x8
  sg_info=0x1  sg_duration=0 milliseconds  resid=0
  status=2: sense_key=1 asc=0 ascq=1d
 [Duration: 0.001s]
 Output: ERR=0x00, SC=0x00, LL=0x00, LM=0x00, LH=0x00, DEV=0x00, STS=0x50
REPORT-IOCTL: Device=/dev/sda Command=CHECK POWER MODE returned 0
Device is in STANDBY mode, exit(2)

Disk set to sleep

root@raspi2:~# hdparm -Y /dev/sda

/dev/sda:
 issuing sleep command
SG_IO: bad/missing sense data, sb[]:  f0 00 01 00 50 40 00 0a 80 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
root@raspi2:~# smartctl -r ioctl -n standby /dev/sda
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.10.27-v8+] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org


REPORT-IOCTL: Device=/dev/sda Command=CHECK POWER MODE
 Input:   FR=...., SC=...., LL=...., LM=...., LH=...., DEV=...., CMD=0xe5
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [ata pass-through(16): 85 06 2c 00 00 00 00 00 00 00 00 00 00 00 e5 00 ]
  scsi_status=0x0, sg_transport_status=0x3, sg_driver_status=0x0
  sg_info=0x1  sg_duration=70496 milliseconds  resid=0
>>>> do_scsi_cmnd_io: sg_io_ver=4
 [ata pass-through(16): 85 06 2c 00 00 00 00 00 00 00 00 00 00 00 e5 00 ]
  SG_IO ioctl failed, errno=22 [Invalid argument], SG_IO_V4
 [ata pass-through(16): 85 06 2c 00 00 00 00 00 00 00 00 00 00 00 e5 00 ]
  status=2: sense_key=1 asc=0 ascq=1d
 [Duration: 75.959s]
 Output: ERR=0x00, SC=0xff, LL=0x00, LM=0x00, LH=0x00, DEV=0x00, STS=0x50
REPORT-IOCTL: Device=/dev/sda Command=CHECK POWER MODE returned 0
Device is in ACTIVE or IDLE mode

Running smartctl after spin-down done by the disk itself

root@raspi2:~# smartctl -r ioctl -n standby /dev/sda
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.10.27-v8+] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org


REPORT-IOCTL: Device=/dev/sda Command=CHECK POWER MODE
 Input:   FR=...., SC=...., LL=...., LM=...., LH=...., DEV=...., CMD=0xe5
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [ata pass-through(16): 85 06 2c 00 00 00 00 00 00 00 00 00 00 00 e5 00 ]
  scsi_status=0x2, sg_transport_status=0x0, sg_driver_status=0x8
  sg_info=0x1  sg_duration=5152 milliseconds  resid=0
  status=2: sense_key=1 asc=0 ascq=1d
 [Duration: 5.150s]
 Output: ERR=0x00, SC=0xff, LL=0x00, LM=0x00, LH=0x00, DEV=0x00, STS=0x50
REPORT-IOCTL: Device=/dev/sda Command=CHECK POWER MODE returned 0
Device is in ACTIVE or IDLE mode

Currently the situation seem to be the following:

  • smartctl (and probably smartd also) "realized" when the disk is in standby and handle everything accordingly
  • when the disk is in sleep-mode this is not recogined and the disk is woken up
  • the default mode when the disk spins down itself seems to be sleep mode as it got also woken up

Therefore it would be great if you could have a short look on the output I provided (I hope it helps in debugging) and give feedback to this. If needed it would really like to provide you with some additional information to hopefully fix this issue.

All the best,
Stefan

@stksz stksz changed the title WDC WD50NDZW-11MR8S1 spin up probelm WDC WD50NDZW-11MR8S1 spin up problem Jul 24, 2021
@chrfranke
Copy link

Disk set to sleep
...
Device is in ACTIVE or IDLE mode

SLEEP mode means that the ATA command GET POWER MODE fails because the drive does not reply to commands. In this case, the USB bridge firmware might detect this I/O-error, spin up the drive, retry GET POWER MODE and return its result.

Running smartctl after spin-down done by the disk itself
...
Device is in ACTIVE or IDLE mode

The command sdparm ... --set SCT=900 ... configures the SCSI Standby Condition Timer provided by the SAT layer of the USB bridge firmware. It may not configure the ATA Standby Timer. The command smartctl -s standby,12 ... would do this.

If set to STANDBY mode by SCSI/USB-layer, the firmware might always spin up the drive if the SCSI command ATA PASS-THROUGH arrives.

@chrfranke
Copy link

No feedback from reporter.

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

No branches or pull requests

2 participants