Smartmontools/zh: Difference between revisions
Appearance
Created page with "== 定位设备 ==" |
Created page with "它包括 '''smartd''' 和 '''smartctl''' 程序。可以使用 {{Nixos:option|services.smartd}} 模块在 NixOS 系统上启用 smartd。" |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:smartmontools}} | {{DISPLAYTITLE:smartmontools}} | ||
'''smartmontools''' 是一个提供了用于监控硬盘驱动器的工具的软件包,它支持 [[wikipedia:Self-Monitoring, Analysis and Reporting Technology|S.M.A.R.T.]] 系统来监控硬盘驱动器的健康状况。 | |||
'''smartmontools''' | |||
它包括 '''smartd''' 和 '''smartctl''' 程序。可以使用 {{Nixos:option|services.smartd}} 模块在 NixOS 系统上启用 smartd。 | |||
<span id="Locating_devices"></span> | <span id="Locating_devices"></span> |
Revision as of 09:14, 8 October 2025
警告:显示标题“smartmontools”覆盖了之前的显示标题“Smartmontools”。 smartmontools 是一个提供了用于监控硬盘驱动器的工具的软件包,它支持 S.M.A.R.T. 系统来监控硬盘驱动器的健康状况。
它包括 smartd 和 smartctl 程序。可以使用 services.smartd
模块在 NixOS 系统上启用 smartd。
定位设备
由于设备节点是任意的且可能会发生变化,因此使用持久的磁盘标识方法非常重要。以下命令将打印存储设备及其所包含的分区列表。配置 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
}
];
};
}