# storage-drives

<sub>

This content is provided under the GNU Free Documentation License, Version 1.3, 3 November 2008

NONE OF THIS IS COMPUTER ADVICE.

Please do not set fire to your processor, break the Computer Misuse Act, or harm others' computers.

THESE CHICKEN SCRATCHES ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE CONTENT HEREIN.

</sub>


Tools:
- [sdparm](https://man.archlinux.org/man/sdparm.8.en)
- [openSeaChest](https://github.com/Seagate/openSeaChest)
- [iostat](https://man.archlinux.org/man/iostat.1.en)
- [lsof](https://man.archlinux.org/man/lsof.8)


_SATA and -- probably even moreso -- SCSI are things you ought to RTFM for._



## LSI/SAS/HBA/RAID cards

I experienced a world of hurt attempting to get a SAS3008 card with its default firmware (supporting RAID+JBOD modes) to work.

```bash
[    4.297045] megaraid_sas 0000:01:00.0: FW now in Ready state
[    4.297048] megaraid_sas 0000:01:00.0: 63 bit DMA mask and 32 bit consistent mask
[    4.297056] mc: Linux media interface: v0.10
[    4.297304] megaraid_sas 0000:01:00.0: firmware supports msix        : (96)
[    4.302519] iTCO_vendor_support: vendor-support=0
[    4.307340] PTP clock support registered
[    4.311236] megaraid_sas 0000:01:00.0: requested/available msix 9/9 poll_queue 0
[    4.311244] megaraid_sas 0000:01:00.0: current msix/max num queues   : (9/8)
[    4.311247] megaraid_sas 0000:01:00.0: RDPQ mode     : (disabled)
[    4.311250] megaraid_sas 0000:01:00.0: Current firmware supports maximum commands: 272        LDIO threshold: 237
[    4.312327] megaraid_sas 0000:01:00.0: Performance mode :Latency (latency index = 1)
[    4.312332] megaraid_sas 0000:01:00.0: FW supports sync cache        : No
[    4.312336] megaraid_sas 0000:01:00.0: megasas_disable_intr_fusion is called outbound_intr_mask:0x40000009
[    4.320322] iTCO_wdt iTCO_wdt.1.auto: Found a Lynx Point TCO device (Version=2, TCOBASE=0x1860)
[    4.322563] iTCO_wdt iTCO_wdt.1.auto: initialized. heartbeat=30 sec (nowayout=0)
[    4.326624] e1000e: Intel(R) PRO/1000 Network Driver
[    4.326627] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    4.332843] e1000e 0000:00:19.0: Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
[    4.333399] megaraid_sas 0000:01:00.0: Init cmd return status FAILED for SCSI host 6
[    4.343977] megaraid_sas 0000:01:00.0: Failed from megasas_init_fw 6553
```

My eventual "fix" was to give up and flash IT mode firmware, but some of the diagnostic steps I tried that may work for you:
- Booting with kernel parameter combinations:
- - `iommu=on`
- - `iommu=pt`
- - `iommu=soft`
- - `iommu=on intel_iommu=pt`
- - `iommu=pt intel_iommu=on`
- Booting in CSM mode
- Booting in UEFI mode
- Factory resetting BIOS
- Factory resetting SAS card
- Changing SAS card's config of exposed drives to host
- Setting all drives as "JBOD" in SAS card
- Setting all drives as "unconfigured" for RAID mode in SAS card
- Creating RAID array in SAS card
- Unplugging drives and/or SFF8643/SFF8087 cable
- Changing PCIe slot
- Booting Ubuntu 24.04
- Booting Windows 10 (got error `Code 10` in Device Manager)
- Booting Ubuntu in a different machine (got `megasas_init_fw 6550` instead, but still not working)



## Drive and File activity

See files being accessed:

```bash
lsof | grep /folder
```

![](./md-assets/2026-03-08_00-54_lsof-grep.png)


See disk activity

```bash
iostat -x 1
```

![](./md-assets/2026-03-08_00-55_iostat.png)



## SATA spin down
This sets drive to spin down after 5m

https://bbs.archlinux.org/viewtopic.php?id=216832

```bash
sudo hdparm -B 128 -S 60 /dev/sdd
```



## SAS EPC settings

References:
- https://manpages.debian.org/testing/openseachest/openSeaChest_PowerControl.8.en.html
- https://www.truenas.com/community/threads/exos-x16-high-head-cycle-count-due-to-toggle-between-epc-idle_a-and-idle_b-power-states.90751/
- https://www.reddit.com/r/homelab/comments/1cjzcxm/spindown_sas_drives_connected_via_a_passthrough/
- http://pwet.fr/man/linux/administration_systeme/sdparm/
- https://www.seagate.com/staticfiles/support/disc/manuals/Interface%20manuals/100293068c.pdf
- https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068h.pdf

**Ensure you know what the idle/standby states do and that you know what you are doing.**

This is used instead of APM on SAS drives.

The enabled modes will have an asterisk by them. This is important. If none are enabled, the drive won't spin down.

For example, here `standby_z` is the only enabled state:

```
==========================================================================================
 openSeaChest_PowerControl - openSeaChest drive utilities - NVMe Enabled
 Copyright (c) 2014-2025 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
 openSeaChest_PowerControl Version: 3.7.2 X86_64
 Build Date: Mar  6 2026
 Today: 20260307T120113 User: root
==========================================================================================

/dev/sde - ST6000NM0034   X - S4D0TSBZ0000K64564C4 - BC6G - SCSI

===EPC Settings===
        * = timer is enabled
        C column = Changeable
        S column = Savable
        All times are in 100 milliseconds

Name       Current Timer Default Timer Saved Timer   Recovery Time C S
Idle A      1200          10            1200         1             Y Y
Idle B      2400          2400          2400         3             Y Y
Idle C      6000          6000          6000         70            Y Y
Standby Y   6000          6000          6000         70            Y Y
Standby Z  *9000          9000          9000         150           Y Y

```

| **Power Condition Name** | **Description** |
| --- | --- |
| Idle_a | Reduced electronics |
| Idle_b | Heads unloaded. Disks spinning at full RPM |
| Idle_c | Heads unloaded. Disks spinning at reduced RPM |
| Standby_z	| Heads unloaded. Motor stopped (disks not spinning) |

_Explanation of the idle/standby states grabbed from https://www.seagate.com/www-content/product-content/enterprise-hdd-fam/exos-x-16/en-us/docs/100845789j.pdf_

The plastic of my keycaps has rubbed off on my fingers and I still haven't figured out a reliable way to get different types of drives to just spin down... I wish better luck to your ventures than I have had.

![](./md-assets/2026-03-08_01_54_history.png)



### Show info and settings

```bash
sudo openSeaChest_Info -d /dev/sde -i
sudo openSeaChest_PowerControl -d /dev/sde --showEPCSettings
sudo sdparm --flexible -6 -l --all /dev/sde
```



## Configure spindown

The short and sweet explanation:
- EPC may be enabled/disabled as a whole. It needs to be enabled
- Each individual idle/standby state may be enabled/disabled independently. I do not know the implications, if any, of enabling one but not another.
- Each idle/standby state will have a different timer. Be wary of setting the times too short, know your environment.
- The time units are in 100ms, e.g., "9000" == 900000ms == 15m
- What works for one drive may not work for another, and perhaps nothing may work for some drives (the bitter part)

I was getting errors when using the `openSeaChest_PowerControl` functions

The sdparm functions worked for me

If you need to, enable EPC:

```bash
sudo openSeaChest_PowerControl -d /dev/sde --EPCfeature enable
```

Change the time to enter a given idle/standby state (openSeaChest, didn't work for me):

```bash
sudo openSeaChest_PowerControl -d /dev/sde --standby_z 9000
```

Enable an idle/standby state:

_This worked for my "IBM-ESXS" `ST6000NM0034   X` drive, but not my Seagate `DKS2F-H6R0SS` drive_

```bash
sudo sdparm --flexible -6 -l --set standby_z=1 /dev/sde
```

If these options still do not work, and you have two identical drives, with one misbehaving, you could _try_ and compare their settings (`sdparm --all /dev/sde`). Albeit to no avail, I changed the `PERF` and `PM` attributes in one such attempt.

![](./md-assets/2026-03-08_00-50_sdparm-perf.png)

![](./md-assets/2026-03-08_01-21sdparm-pm.png)



## Force SAS spindown manually

The openSeaChest command spun the drive down but it immediately spun back up

```bash
sudo openSeaChest_PowerControl -d /dev/sde --spinDown
```

This worked but the drive doesn't come back up automatically

```bash
sudo sdparm --command=stop /dev/sde
```

