使用 sdparm 关闭 Seagate 扩展硬盘上的省电模式

使用 sdparm 关闭 Seagate 扩展硬盘上的省电模式

我正在尝试查看是否可以禁用通过 USB 连接到运行 Ubuntu 服务器的 NUC 的外部 Seagate 扩展硬盘的节能功能。我使用时遇到问题,hdparm因为它给了我一条错误消息,所以我发现sdparm这似乎适用于我的特定驱动器这个帖子

我运行sudo sdparm -l -a /dev/sda并得到以下输出:

    /dev/sda: Seagate   Expansion Desk    0915
    Direct access device specific parameters: WP=0  DPOFUA=0
Caching (SBC) [ca] mode page:
  IC            0  [cha: n, def:  0, sav:  0]  Initiator control
  ABPF          0  [cha: n, def:  0, sav:  0]  Abort pre-fetch
  CAP           0  [cha: n, def:  0, sav:  0]  Caching analysis permitted
  DISC          1  [cha: n, def:  1, sav:  1]  Discontinuity
  SIZE          0  [cha: n, def:  0, sav:  0]  Size enable
  WCE           1  [cha: y, def:  1, sav:  1]  Write cache enable
  MF            0  [cha: n, def:  0, sav:  0]  Multiplication factor
  RCD           0  [cha: n, def:  0, sav:  0]  Read cache disable
  DRRP          0  [cha: n, def:  0, sav:  0]  Demand read retention priority
  WRP           0  [cha: n, def:  0, sav:  0]  Write retention priority
  DPTL          -1  [cha: n, def: -1, sav: -1]  Disable pre-fetch transfer length
  MIPF          0  [cha: n, def:  0, sav:  0]  Minimum pre-fetch
  MAPF          -1  [cha: n, def: -1, sav: -1]  Maximum pre-fetch
  MAPFC         -1  [cha: n, def: -1, sav: -1]  Maximum pre-fetch ceiling
  FSW           0  [cha: n, def:  0, sav:  0]  Force sequential write
  LBCSS         0  [cha: n, def:  0, sav:  0]  Logical block cache segment size
  DRA           0  [cha: n, def:  0, sav:  0]  Disable read ahead
  SYNC_PROG     0  [cha: n, def:  0, sav:  0]  Synchronous cache progress indication
  NV_DIS        0  [cha: n, def:  0, sav:  0]  Non-volatile cache disable
  NCS           255  [cha: n, def:255, sav:255]  Number of cache segments
  CSS           0  [cha: n, def:  0, sav:  0]  Cache segment size
Control [co] mode page:
  TST           0  [cha: n, def:  0, sav:  0]  Task set type
  TMF_ONLY      0  [cha: n, def:  0, sav:  0]  Task management functions only
  DPICZ         0  [cha: n, def:  0, sav:  0]  Disable protection information check if protect field zero
  D_SENSE       0  [cha: n, def:  0, sav:  0]  Descriptor format sense data
  GLTSD         0  [cha: n, def:  0, sav:  0]  Global logging target save disable
  RLEC          0  [cha: n, def:  0, sav:  0]  Report log exception condition
  QAM           1  [cha: n, def:  1, sav:  1]  Queue algorithm modifier
  NUAR          0  [cha: n, def:  0, sav:  0]  No unit attention on release
  QERR          0  [cha: n, def:  0, sav:  0]  Queue error management
  RAC           0  [cha: n, def:  0, sav:  0]  Report a check
  UA_INTLCK     0  [cha: n, def:  0, sav:  0]  Unit attention interlocks control
  SWP           0  [cha: n, def:  0, sav:  0]  Software write protect
  ATO           0  [cha: n, def:  0, sav:  0]  Application tag owner
  TAS           0  [cha: n, def:  0, sav:  0]  Task aborted status
  ATMPE         0  [cha: n, def:  0, sav:  0]  Application tag mode page enabled
  RWWP          0  [cha: n, def:  0, sav:  0]  Reject write without protection
  SBLP          0  [cha: n, def:  0, sav:  0]  Supported block lengths and protection information
  AUTOLOAD      0  [cha: n, def:  0, sav:  0]  Autoload mode
  BTP           0  [cha: n, def:  0, sav:  0]  Busy timeout period (100us)
  ESTCT         0  [cha: n, def:  0, sav:  0]  Extended self test completion time (sec)
Power condition [po] mode page:
  PM_BG         0  [cha: n, def:  0, sav:  0]  Power management, background functions, precedence
  STANDBY_Y     0  [cha: n, def:  0, sav:  0]  Standby_y timer enable
  IDLE_C        0  [cha: n, def:  0, sav:  0]  Idle_c timer enable
  IDLE_B        0  [cha: n, def:  0, sav:  0]  Idle_b timer enable
  IDLE          0  [cha: n, def:  0, sav:  0]  Idle_a timer enable
  STANDBY       0  [cha: y, def:  1, sav:  0]  Standby_z timer enable
  ICT           0  [cha: n, def:  0, sav:  0]  Idle_a condition timer (100 ms)
  SCT           4294967286  [cha: y, def:9000, sav:4294967286]  Standby_z condition timer (100 ms)
  IBCT          0  [cha: n, def:  0, sav:  0]  Idle_b condition timer (100 ms)
  ICCT          0  [cha: n, def:  0, sav:  0]  Idle_c condition timer (100 ms)
  SYCT          0  [cha: n, def:  0, sav:  0]  Standby_y condition timer (100 ms)
  CCF_IDLE      0  [cha: n, def:  0, sav:  0]  check condition on transition from idle
  CCF_STAND     0  [cha: n, def:  0, sav:  0]  check condition on transition from standby
  CCF_STOPP     0  [cha: n, def:  0, sav:  0]  check condition on transition from stopped

我对硬盘驱动器的术语非常陌生,但我的猜测是,这STANDBY将是一个布尔值,表示驱动器是否应该在待机模式下运行?是否会将此设置为1而不是0告诉磁盘不要“入睡”,还是相反?

列表中是否还有其他我应该查看的设置,或者我这样做完全错误吗?

答案1

我最近偶然发现想要回答同一个问题。我有几台 WD My Book 25ED,即使在写入操作期间也会进入睡眠模式。不管怎样,经过一番研究,我写了一个脚本,sdparm-disable_sleep.sh执行后解决了我的问题:

#!/bin/bash
# Usage: sdparm-disable_sleep.sh <device>
[[ -n "${1}" && -b "${1}" ]] \
  && sdparm --flexible --page=po -l -a "${1}" \
  && { sdparm --flexible --set=STANDBY_Z=0 -S "${1}" \
       && sdparm --flexible --page=po -l -a "${1}"; }

本质上,该sdparm --set=STANDBY_Z=0 -S <device>命令将设置STANDBY_Z0,从而禁用计时器,并保存该设置。

在您的情况下,参数似乎只是命名为STANDBY,并且根据您粘贴的输出,它已经被禁用(因为保存的值为0)。也许固件有问题,无论如何我都会尝试发出该命令 - 也许没有-S- 并看看该命令是否至少持续到驱动器重新启动/重新初始化。

相关内容