Smartmontools/zh: Difference between revisions
Appearance
Created page with "== 定位设备 ==" |
(No difference)
|
Revision as of 08:20, 8 October 2025
警告:显示标题“smartmontools”覆盖了之前的显示标题“Smartmontools”。
smartmontools is a package which provides tools for monitoring drives which support the S.M.A.R.T. system for monitoring hard drive health.
It includes the smartd and smartctl programs. smartd can be enabled on NixOS systems with the services.smartd
module.
定位设备
由于设备节点是任意的且可能会发生变化,因此使用持久的磁盘标识方法非常重要。以下命令将打印存储设备及其所包含的分区列表。配置 smartd 时,应使用不带“-partX”后缀的条目,因为它们指的是整个磁盘。
ls /dev/disk/by-id/
Example
❄︎ /etc/nixos/configuration.nix
{
services.smartd = {
enable = true;
devices = [
{
device = "/dev/disk/by-id/ata-WDC-XXXXXX-XXXXXX"; # FIXME: Change this to your actual disk
}
];
};
}