Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 547  / 2 Years ago, wed, june 8, 2022, 4:42:14

Situation


I've got a WD Element Drive that behaves oddly. It took forever for the Drive to spin down, And I'm not able to set the standby (spindown) timeout for the Drive using different methods.


For example using hdparm causes SG_IO error:


$ sudo hdparm -S 25 /dev/sdx

dev/sdx:
setting standby to 25 (2 minutes + 5 seconds)
SG_IO: bad/missing sense data, sb[]: ...

It seems that the Drive's controller doesn't support these methods.


However, strangely I'm able to put the drive into standby mode using -y switch:


$ sudo hdparm -y /dev/sdx

It gives the same SG_IO error but drive spins down. And I'm fine with that.


Real problem


It seems that suspending Ubuntu, causes an effect similar to unplugging and plugging the drive.


When I want to suspend Ubuntu, say using: systemctl suspend:



  • If drive is on standby mode, it spins up and never spins down again.

  • If it's not on standby mode, then it first spins down, after a second it spins up again and never spins down.


The only way to spin it down is to resume Ubuntu and run hdparm -y on the drive manually and if I suspend Ubuntu again, the same thing happens.


What I already tried


I tried to run hdparm -y on suspend to put the drive on standby mode:


$ cat /usr/lib/systemd/system-sleep/suspend_drive

#!/bin/sh
case $1 in
pre)
hdparm -y /dev/sdc ;;
esac

It does not have any effect. And as I already said, while Ubuntu is going to sleep, drive first spins downs for a second anyway, and then it starts working again.




What I'm looking for...


Is there anyway to troubleshot this problem?


I'm looking for a solution to prevent the drive from spinning up in the first place when the system is going to sleep. And if the drive is already awake, it should go to standby mode with the system.




Notes:





Updates



  • If I use udisksctl power-off /dev/sdc to safely remove the drive, suspending the Ubuntu acts like unplugging and re-pluging and I can mount and use the drive again (something that should not happen).



  • I was able to set a standby timer for the drive using sdparm but it did not solved the issue, after suspending Ubuntu drive spins-up and never spins down, even if the timer is set to a small value like one minute.



  • As I encountered different outcomes, I'm not 100% sure, but it seems that I'm only experiencing the problem while the drive is attached to a USB3 port.



    • But USB2 has it's own problems too, for example after resuming Ubuntu drive spins-up.



  • I can confirm than I'm also experiencing the same problem in Windows.




More From » hard-drive

 Answers
4

As I found out that putting the system in sleep mode acts like unplugging and re-plugging the drive, I got suspected that there might be some issues with the USB ports and their power source.


I went through the BIOS and set "Always On USB" to "Enable"; It seems that setting this parameter to Enable has fixed the issue.


enter image description here


[#2802] Wednesday, June 8, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amelican

Total Points: 162
Total Questions: 116
Total Answers: 108

Location: Guam
Member since Mon, May 29, 2023
1 Year ago
;