设置hdparm让硬盘在空闲时间休眠。 作者:Lain 时间:2020年10月17日 分类:服务器 字数:446 warning: 这篇文章距离上次修改已过1635天,其中的内容可能已经有所变动。 为了延长硬盘使用寿命,当硬盘不使用时,需要让硬盘休眠,ubuntu server 20.04已自带Hdparm软件。#查看硬盘设备名 sudo fdisk -l #检查硬盘是否支持写缓存功能 sudo hdparm -I /dev/sdc | grep 'Write cache' sudo hdparm -I /dev/sdb | grep 'Write cache' sudo hdparm -I /dev/sdd | grep 'Write cache' #如果看到 * (星号),表示支持 * Write cache #编辑配置文件 sudo nano /etc/hdparm.conf #在文件末尾加入 /dev/sdc { write_cache = on spindown_time = 240 #spindown_time=需要休眠的时间乘以60除以5的数值,这里是20分钟。 }PHPCopy
1
1
1
1
1
1
1
1
1
1
1
1
1
555
1
1
1
1
1
1