我的笔记本电脑上的第一个 SSD 磁盘和第二个 HDD 磁盘上都装有 Kubuntu。第二个磁盘我很少使用。当我打开笔记本电脑时,它不会发出任何声音,但 HDD 会发出声音,因为它在工作。我如何禁用 HDD,但在必要时打开它?即在禁用 HDD 的情况下运行 kubuntu,但在必要时启用它。
答案1
我想补充一点,我发现磁盘实用程序(Ubuntu 应用程序启动器中的磁盘)非常方便。您可以通过进入更多操作中的驱动器设置来选择 HDD 的待机选项。
答案2
您可以设置硬盘在进入睡眠状态前应等待多少秒的空闲时间-S
。hdparm
hdparm -S 128 /dev/sdb
来自 hdpram 手册
-S Put the drive into idle (low-power) mode, and also set the standby (spindown) timeout for the drive. This timeout value is used by the drive to determine how long to wait (with no disk activity) before turning off the spindle motor to save power. Under such circumstances, the drive may take as long as 30 seconds to respond to a subsequent disk access, though most drives are much quicker. The encoding of the timeout value is somewhat peculiar. A value of zero means "timeouts are disabled": the device will not automatically enter standby mode. Values from 1 to 240 specify multiples of 5 seconds, yielding timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes. A value of 253 sets a vendor-defined timeout period between 8 and 12 hours, and the value 254 is reserved. 255 is interpreted as 21 minutes plus 15 seconds. Note that some older drives may have very different interpre‐ tations of these values.
要让硬盘立即进入睡眠状态,请输入:
hdparm -y /dev/sdb
-y Force an IDE drive to immediately enter the low power consumption standby mode, usually causing it to spin down. The current power mode status can be checked using the -C option.
使用大写字母Y
,驱动器将进入更深的睡眠状态。
-Y Force an IDE drive to immediately enter the lowest power consumption sleep mode, causing it to shut down
completely. A hard or soft reset is required before the drive can be accessed again (the Linux IDE
driver will automatically handle issuing a reset if/when needed). The current power mode status can be
checked using the -C option.
当驱动器收到需要读取磁盘的命令时,驱动器应该开始旋转。这必须得到 BIOS 和驱动器本身的支持。
当你对选项满意时,可以通过插入命令使其自动化,最后一行之上,/etc/rc.local
以超级用户身份使用您最喜欢的文本编辑。