hdparm poweron_standby 有多危险?

hdparm poweron_standby 有多危险?
jacks@Gen4:~$ sudo hdparm -s 1 -S 4 /dev/sdb

/dev/sdb:
Use of -s1 is VERY DANGEROUS.
This requires BIOS and kernel support to recognize/boot the drive.
Please supply the --yes-i-know-what-i-am-doing flag if you really want this.
Program aborted.

-s 是 conf 中的 poweron_standby

   -s     Enable/disable the power-on in standby feature, if supported by the  drive.   VERY  DANGEROUS.
          Do  not  use unless you are absolutely certain that both the system BIOS (or firmware) and the
          operating system kernel (Linux >= 2.6.22) support probing for drives that  use  this  feature.
          When  enabled, the drive is powered-up in the standby mode to allow the controller to sequence
          the spin-up of devices, reducing the instantaneous current draw burden when many drives  share
          a power supply.  Primarily for use in large RAID setups.  This feature is usually disabled and
          the drive is powered-up in the active mode (see -C above).  Note that a drive may  also  allow
          enabling  this  feature  by a jumper.  Some SATA drives support the control of this feature by
          pin 11 of the SATA power connector. In these cases, this command may  be  unsupported  or  may
          have no effect.

这有什么危险的?在我看来,你直到下次启动之前都无法启动它。这对我来说不是问题。我只是想在使用 Linux 时关闭我的 Windows 驱动器。

答案1

由于“待机开机”设置可以存储在驱动器中,并且在重新启动和电源循环后仍然存在。该设置确实会告诉驱动器不要开始旋转,而是等到收到正确的命令后才开始旋转。因此,打开电源后磁盘消耗的电量会大大减少。

危险在于,当您的 BIOS 和操作系统都无法向驱动器发送正确的启动命令时,您的驱动器将无法被检测到。现在您无法运行hdparm以禁用“待机开机”功能,因为设备/dev/sdX丢失了。

简而言之,在某些情况下,启用“待机时开机”功能无法轻易撤消。

使用 mpt2sas Linux 驱动程序 P15.x 的 LSI SAS2008 控制器就是这样的情况(2013 年 1 月),在设置 PUIS 后,驱动器将不再可供操作系统使用。有关详细信息,请参阅https://unix.stackexchange.com/questions/58922/how-to-fix-mpt2sas-port-enable-failed-with-timeout-timeout-300s

答案2

这类似于硬盘在可预测的时间间隔内发生故障。基本上,您授予硬盘在需要时关闭电源的权限。它不会向底层操作系统发出任何已关闭电源的指示……这取决于 BIOS 是否足够智能,以跟踪硬盘状态,并在您尝试读取/写入硬盘时启动硬盘。如果 BIOS 或磁盘控制器没有……Linux 会说将更改提交到磁盘……而硬盘不会给出任何响应。数据丢失和/或损坏的可能性非常大。

相关内容