HDD keeps spinning down, even thought is it set not to

So, I am having an annoying issue with one of my HDDs.
I have two, setup as RAID-1. Exactly same type/model, less than 2 years old.
One of them, sda, keeps spinning down and that results on every single access to file system, I have to wait 4-5 seconds for it to spin up.

When I run “hdparm -B /dev/sda”, I am getting a value of 128, while sdb has 254.
I manually change the value to 254, but:

  1. On the next boot is 128
  2. After 4-5 minutes, I can hear it spin down. I check the value and it is 254, but it looks like it ignores it.

I created a “/etc/udev/rules.d/69-hdparm.rules” file that contains

ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN+="/usr/bin/hdparm -B 254 -S 0 /dev/sda"
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sdb", RUN+="/usr/bin/hdparm -B 254 -S 0 /dev/sdb"

Still, after boot, the value is 128.

More info:
inxi:

System:    Host: amd-manjaro Kernel: 5.14.10-1-MANJARO x86_64 bits: 64
           Desktop: KDE Plasma 5.22.5 Distro: Manjaro Linux
Machine:   Type: Desktop System: Gigabyte product: X570 AORUS MASTER v: -CF serial: N/A
           Mobo: Gigabyte model: X570 AORUS MASTER v: x.x serial: N/A UEFI: American Megatrends LLC.
           v: F33a date: 01/22/2021
CPU:       Info: 12-Core model: AMD Ryzen 9 5900X bits: 64 type: MT MCP cache: L2: 6 MiB
           Speed: 2879 MHz min/max: 2200/3700 MHz Core speeds (MHz): 1: 2879 2: 2879 3: 2882 4: 2882
           5: 3520 6: 3027 7: 4551 8: 4667 9: 2878 10: 2878 11: 2882 12: 2879 13: 3651 14: 2891
           15: 4136 16: 2864 17: 2880 18: 3633 19: 2996 20: 2878 21: 2880 22: 2868 23: 3645 24: 3724
Graphics:  Device-1: AMD Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] driver: vfio-pci v: 0.2
           Device-2: AMD Navi 14 [Radeon RX 5500/5500M / Pro 5500M] driver: amdgpu v: kernel
           Device-3: Logitech HD Pro Webcam C920 type: USB driver: usbfs
           Display: x11 server: X.Org 1.20.13 driver: loaded: amdgpu,ati
           unloaded: modesetting,radeon resolution: 1: 2560x1440~60Hz 2: 1200x1920~60Hz
           OpenGL: renderer: Radeon RX 5500 XT (NAVI14 DRM 3.42.0 5.14.10-1-MANJARO LLVM 12.0.1)
           v: 4.6 Mesa 21.2.3
Audio:     Device-1: AMD Navi 21 HDMI Audio [Radeon RX 6800/6800 XT / 6900 XT] driver: vfio-pci
           Device-2: AMD Navi 10 HDMI Audio driver: snd_hda_intel
           Device-3: Creative Sound Blaster GC7 type: USB
           driver: cdc_acm,hid-generic,snd-usb-audio,usbhid
           Device-4: Logitech HD Pro Webcam C920 type: USB driver: usbfs
           Sound Server-1: ALSA v: k5.14.10-1-MANJARO running: yes
           Sound Server-2: PipeWire v: 0.3.38 running: yes
Network:   Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi
           IF: wlp6s0 state: down mac: f6:f2:19:80:d1:e6
           Device-2: Intel I211 Gigabit Network driver: vfio-pci
           Device-3: Realtek RTL8125 2.5GbE driver: r8169
           IF: enp8s0 state: up speed: 1000 Mbps duplex: full mac: b4:2e:99:f7:40:68
           IF-ID-1: virbr0 state: up speed: 10 Mbps duplex: unknown mac: 52:54:00:02:fc:46
           IF-ID-2: vnet2 state: unknown speed: 10 Mbps duplex: full mac: fe:54:00:6b:44:3a
Bluetooth: Device-1: Intel AX200 Bluetooth type: USB driver: btusb
           Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: enabled,running rfk-block:
           hardware: no software: yes address: see --recommends
RAID:      Device-1: md127 type: mdraid level: mirror status: active size: 3.64 TiB report: 2/2 UU
           Components: Online: 0: sda1 1: sdb1
Drives:    Local Storage: total: raw: 9.57 TiB usable: 5.93 TiB used: 1.78 TiB (30.0%)
           ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO 500GB size: 465.76 GiB
           ID-2: /dev/nvme1n1 vendor: Seagate model: XPG GAMMIX S50 Lite size: 953.87 GiB
           ID-3: /dev/nvme2n1 vendor: Samsung model: SSD 970 EVO 250GB size: 232.89 GiB
           ID-4: /dev/sda vendor: Toshiba model: HDWE140 size: 3.64 TiB
           ID-5: /dev/sdb vendor: Toshiba model: HDWE140 size: 3.64 TiB
           ID-6: /dev/sdc vendor: Samsung model: SSD 840 EVO 250GB size: 232.89 GiB
           ID-7: /dev/sdd vendor: Samsung model: SSD 850 EVO 500GB size: 465.76 GiB
Partition: ID-1: / size: 424.96 GiB used: 69.27 GiB (16.3%) fs: ext4 dev: /dev/nvme0n1p2
           ID-2: /boot/efi size: 1022 MiB used: 300 KiB (0.0%) fs: vfat dev: /dev/nvme0n1p3
Swap:      ID-1: swap-1 type: partition size: 32 GiB used: 0 KiB (0.0%) dev: /dev/nvme0n1p1
Sensors:   System Temperatures: cpu: 42.2 C mobo: 16.8 C gpu: amdgpu temp: 53.0 C
           Fan Speeds (RPM): N/A gpu: amdgpu fan: 0
Info:      Processes: 512 Uptime: 2h 27m Memory: 62.74 GiB used: 38.84 GiB (61.9%) Shell: Bash
           inxi: 3.3.08

hdparm -I /dev/sda (even this command takes 4-5 seconds to return info, while on sdb is instant)

/dev/sda:

ATA device, with non-removable media
        Model Number:       TOSHIBA HDWE140                         
        Serial Number:      105EK3.....
        Firmware Revision:  FP1R    
        Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
        Supported: 8 7 6 5 
        Likely used: 8
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:    16514064
        LBA    user addressable sectors:   268435455
        LBA48  user addressable sectors:  7814037168
        Logical  Sector size:                   512 bytes
        Physical Sector size:                  4096 bytes
        Logical Sector-0 offset:                  0 bytes
        device size with M = 1024*1024:     3815447 MBytes
        device size with M = 1000*1000:     4000787 MBytes (4000 GB)
        cache/buffer size  = unknown
        Form Factor: 3.5 inch
        Nominal Media Rotation Rate: 7200
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 16
        Advanced power management level: 254
        DMA: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4 
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    NOP cmd
           *    DOWNLOAD_MICROCODE
           *    Advanced Power Management feature set
                SET_MAX security extension
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    General Purpose Logging feature set
           *    WRITE_{DMA|MULTIPLE}_FUA_EXT
           *    64-bit World wide name
           *    WRITE_UNCORRECTABLE_EXT command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
                unknown 119[7]
           *    Gen1 signaling speed (1.5Gb/s)
           *    Gen2 signaling speed (3.0Gb/s)
           *    Gen3 signaling speed (6.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Host-initiated interface power management
           *    Phy event counters
           *    Host automatic Partial to Slumber transitions
           *    Device automatic Partial to Slumber transitions
           *    READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
           *    DMA Setup Auto-Activate optimization
           *    Device-initiated interface power management
           *    Software settings preservation
           *    SMART Command Transport (SCT) feature set
           *    SCT Write Same (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
           *    Extended number of user addressable sectors 
           *    DOWNLOAD MICROCODE DMA command
Security: 
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
                supported: enhanced erase
        526min for SECURITY ERASE UNIT. 526min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50000399cbd8033d
        NAA             : 5
        IEEE OUI        : 000039
        Unique ID       : 9cbd8033d
Checksum: correct

I also found this thread , the problem seems to be exact the same, I did try the accepted solution, but didn’t work for me.

Any ideas how to fix this cause it is very annoying and possible it will kill my HDD sooner than later?

Anyone…?

The problem happens with Kernels 5.15.2-2 & 5.14.18-1 & 5.13.9-2.
I tried to boot with 5.10.79-1 (LTS) and works as it should be.
Should this be reported as bug?

I’ve been dealing with a similar issue with a new laptop - but not using raid. Found this thread when research the problem.

Looking at the journald log I noticed that spin down and spin up commands were being regularly issued to /dev/sda, the problem drive. These always seemed to occur with reports of a pci bus error on the pci bridge device.

Researching this error msg suggested it was related to active-state power management of the pci bus. The suggested fix was to add pcie_aspm=off to the grub default boot options in /etc/default/grub and reboot.

This seems to have fixed the issue for me. May be worth a try.

This option turns off active-state power management on the PCIe bus, which will increase power usage somewhat.

Hope this helps. DJ

1 Like

Thank you for the suggestion, but I can still hear the HDD spin up/down with “pcie_aspm=off” and kernel 5.15.2-2.

The thing is that I tried to submit this as a bug, but it failed with a reply that my message looked like phising/scam and was rejected…

Edit: it also added a lot of stuttering in my Windows VM.