Hello,
I wondered if anybody has a solution for this: I have the hardware setup described below and want /dev/sdb to go to sleep and spin down its disks when it is not used to save power and extend disk lifetime.
RPi3 <–USB cable–> powered USB Hub <–USB cables–> M.2 key + USB adapter (SSD) /dev/sda + 2.5" HDD (magnetic) /dev/sdb
HA lives on /dev/sda.
/dev/sdb is a backup device rarely accessed, shared via Samba.
I am used to achieve my goal by using hdparm -S 12 /dev/sdb
. It worked with the same hardware setup, but different Linux (LibreELEC, which I had before I had HA).
However, on HA OS I get this:
# hdparm -i /dev/sdb
/dev/sdb:
hdparm: ioctl 0x304 failed: Invalid argument
hdparm: HDIO_GET_IDENTITY: Invalid argument
# hdparm -S 4 /dev/sdb
/dev/sdb:
setting standby to 4
(0 minutes 20 seconds)
hdparm: HDIO_DRIVE_CMD: Invalid argument
# hdparm -S 12 /dev/sdb
/dev/sdb:
setting standby to 12
(1 minutes 0 seconds)
hdparm: HDIO_DRIVE_CMD: Invalid argument
#
I automounted the partition using a new file in /etc/udev/rules.d/80-mount-usb-to-media-by-label.rules
.
# mount | grep sdb
/dev/sdb1 on /mnt/data/supervisor/media/Archive type ext4 (rw,relatime)
# df -hT /dev/sdb1
Filesystem Type Size Used Available Use% Mounted on
/dev/sdb1 ext4 3.6T 1008.2G 2.4T 29% /mnt/data/supervisor/media/Archive
#