Jump to content

Smartmontools/zh: Difference between revisions

From NixOS Wiki
Ardenet (talk | contribs)
Created page with "== 定位设备 =="
 
Ardenet (talk | contribs)
Created page with "它包括 '''smartd''' 和 '''smartctl''' 程序。可以使用 {{Nixos:option|services.smartd}} 模块在 NixOS 系统上启用 smartd。"
Line 1: Line 1:
{{DISPLAYTITLE:smartmontools}}
{{DISPLAYTITLE:smartmontools}}
<div lang="en" dir="ltr" class="mw-content-ltr">
'''smartmontools''' 是一个提供了用于监控硬盘驱动器的工具的软件包,它支持 [[wikipedia:Self-Monitoring, Analysis and Reporting Technology|S.M.A.R.T.]] 系统来监控硬盘驱动器的健康状况。
'''smartmontools''' is a package which provides tools for monitoring drives which support the [[wikipedia:Self-Monitoring, Analysis and Reporting Technology|S.M.A.R.T.]] system for monitoring hard drive health.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
它包括 '''smartd''' '''smartctl''' 程序。可以使用 {{Nixos:option|services.smartd}} 模块在 NixOS 系统上启用 smartd。
It includes the '''smartd''' and '''smartctl''' programs. smartd can be enabled on NixOS systems with the {{Nixos:option|services.smartd}} module.
</div>


<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. 系统来监控硬盘驱动器的健康状况。

它包括 smartdsmartctl 程序。可以使用 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
      }
    ];
  };
}