how to spin down always connected external 3.5 inch usb hard drive

Hello,

I am running a manjaro architect home server. An 3.5 usb hard drive is attached to it for external secondary backup.

My problem is the usb drive is always spinning and active

It is device path is /dev/sdf1 and based on arch wiki at

achwiki , I have applied following configuration

/etc/udev/rules.d/69-hdparm.rules

ACTION=="add", SUBSYSTEM=="block", KERNEL=="sdf", ENV{ID_SERIAL_SHORT}=="XXXXX", RUN+="/usr/bin/hdparm -B 127 -S 240 /dev/sdf"

ENV{ID_SERIAL_SHORT}=="XXXXX" is device serial number extracted by udevadm info -n /dev/sdf

However this configuration is working/effective for sata drives, but not working for external usb drives.

Any help much appreciated.

When you execute the command:

sudo hdparm -B 1 -S 1 -Y /dev/sdf

What is the output of

sudo hdparm -C /dev/sdf

:question:

1 Like

Is it mounted in fstab? Can we see the line for it? I can't remember off top rn but, there's options there to make the disk "timeout" if not being accessed. Different approach but maybe more simple.

1 Like

Hello,

Thank you for the response, and I apologize for not replying back quickly.

sudo hdparm -B 1 -S 1 -Y /dev/sdf 

/dev/sdf:
 setting Advanced Power Management level to 0x01 (1)
 setting standby to 1 (5 seconds)
 APM_level      = 1
 issuing sleep command

sudo hdparm -C /dev/sdf

/dev/sdf:
 drive state is:  standby
# /dev/sdf1 
UUID=60cc4969-e0db-4805-a7dc-bb5cabc86319      /storage/usb/disk1       ext4            nofail,rw,relatime     0 0

Did hdparm -B 1 -S 1 -Y /dev/sdf solve the issue? I.E.: is the HDD now spinning down correctly?

:innocent:

I think yes, thank you.

There is power light on the external disk drive which is always on. When accessed it flashes. I can feel drive spinning by touching the case. It does not spin after this command.

However, I used to use qnap and later build my own nas on top of manjaro architech. This drive when attached to qnap did not even light the power led. Only it is accessed the power led becomes active and the drive started to spin.

Is it possible to get such a control?

I don't understand what you're trying to ask with this:

But if you change the RUN command here:

to this:

That should resolve your original question.

If you would have additional questions, please feel free to ask a new one here or clarify the above ask.

Forum kindly sponsored by