我刚刚用几个三星 HD103UJ 1TB 硬盘组装了一个新的 Linux 文件服务器,我目前正在优化它。
我找不到答案的问题是:为驱动器设置减速超时(使用 hdparm -S)是否合理?从长远来看,spindown/spinup 会对磁盘有害吗?
我以前的文件服务器没有这个超时,并且硬盘驱动器已经运行了 3 年多没有问题(始终打开),所以我不确定我是否需要这种优化。
你对此有何看法?
谢谢!
我可以使用以下命令设置 APM 和降速时间:
hdparm -S 246 -B 128 /dev/sda
Run Code Online (Sandbox Code Playgroud)
不幸的是,我只能在信息输出中找到 APM 值:
hdparm -I /dev/sda | grep Advanced
Run Code Online (Sandbox Code Playgroud)
如何查看降速时间值?我怀疑我的光盘忽略了我的价值。我想看看。尝试过 smartctl 但没有运气,帮助。
更新:事实证明调整是非常积极的。当我把它调低时,我的光盘不旋转。它正在那里设置一些东西。
SMART 指出我服务器硬盘上的一个待处理扇区。我已经阅读了很多推荐使用 hdparm 来“轻松”强制磁盘重新定位坏扇区的文章,但我找不到正确的使用方法。
我的“smartctl”中的一些信息:
Error 95 occurred at disk power-on lifetime: 20184 hours (841 days + 0 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 d7 55 dd 02 Error: UNC at LBA = 0x02dd55d7 = 48059863
Commands leading to the command that caused the error were:
CR FR …Run Code Online (Sandbox Code Playgroud) 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.
Run Code Online (Sandbox Code Playgroud)
-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 …Run Code Online (Sandbox Code Playgroud) 我无法物理访问机器,因此无法拔下驱动器。
# hdparm -I /dev/sda | grep frozen
frozen
Run Code Online (Sandbox Code Playgroud)
我在别处读到的建议是热插拔驱动器,在机器运行时拔下电源/SATA 电缆。在这种情况下这些是不可能的,因为我没有物理访问权限。我试过几次通过主机的控制面板对机器进行电源循环,但没有奏效。
有什么办法可以在没有物理访问的情况下解冻(解冻?)驱动器?
我的硬件 RAID 卡出现故障。该卡在 RAID-1 镜像中有两个驱动器。将其中一个驱动器插入主板显示没有分区表。使用像 testdisk 这样的程序,我可以看到分区表开始进入驱动器的 32 个块。显然,硬件 RAID 卡使用前 32 个块来存储其配置。
我可以像这样显示驱动器的起始偏移量:
root@nas1:~# hdparm -g /dev/sdc
/dev/sdc:
geometry = 974/255/63, sectors = 15649200, start = 0
Run Code Online (Sandbox Code Playgroud)
...但我似乎无法找到一种方法来告诉它从 63 个块而不是 0 开始。如果操作系统从 63 开始读取,它将看到分区表。
这在Linux下甚至可能吗?
在对 Freshmeat 进行快速搜索后,我一无所获。有人知道一个好的实用程序吗?
我通常使用 time (dd if=/dev/zero of=newfile ...) 来测试写入速度和 hdparm -t 来测试读取速度。
谢谢。
由于 mdraid-1 阵列的重大性能问题,我想从阵列中拉下其中一个设备(三星 840 Pro),将其擦除以恢复出厂性能并将其重新添加到阵列中。我想对其中一个 SSD 执行此操作的原因是,性能不佳似乎与两者中的一个特定 SSD 有关(尽管它们的品牌、型号和固件版本相同)。
但是如何从 Linux 中擦除 SSD?
我提到 hdparm 表示此时两个驱动器都被冻结。也许是因为它们是 md 数组的一部分?
提前致谢!
hdparm ×9
linux ×5
hard-drive ×3
ssd ×3
bad-blocks ×1
benchmark ×1
encryption ×1
partition ×1
performance ×1
smartctl ×1