Jump to content

Smartmontools/zh: Difference between revisions

From NixOS Wiki
Ardenet (talk | contribs)
Created page with "== 定位设备 =="
 
FuzzyBot (talk | contribs)
Updating to match new version of source page
Tags: Mobile edit Mobile web edit
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:smartmontools}}
{{DISPLAYTITLE:smartmontools}}
<div lang="en" dir="ltr" class="mw-content-ltr">
<languages/>
'''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.
'''smartmontools''' 是一个提供了用于监控硬盘驱动器的工具的软件包,它支持 [[wikipedia:Self-Monitoring, Analysis and Reporting Technology|S.M.A.R.T.]] 系统来监控硬盘驱动器的健康状况。
</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>
Line 17: Line 14:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Example"></span>
== Example ==
== 示例 ==
</div>


{{file|/etc/nixos/configuration.nix|nix|<nowiki>{
{{file|/etc/nixos/configuration.nix|nix|<nowiki>{
Line 33: Line 29:
</nowiki>}}
</nowiki>}}


<div lang="en" dir="ltr" class="mw-content-ltr">
[[Category:Hardware|分类:硬件]]
[[Category:Hardware]]
[[Category:Applications|分类:应用程序]]
[[Category:Applications]]
</div>

Latest revision as of 09:34, 8 October 2025

警告:显示标题“smartmontools”覆盖了之前的显示标题“Smartmontools”。

smartmontools 是一个提供了用于监控硬盘驱动器的工具的软件包,它支持 S.M.A.R.T. 系统来监控硬盘驱动器的健康状况。

它包括 smartdsmartctl 程序。可以使用 services.smartd 模块在 NixOS 系统上启用 smartd。

定位设备

由于设备节点是任意的且可能会发生变化,因此使用持久的磁盘标识方法非常重要。以下命令将打印存储设备及其所包含的分区列表。配置 smartd 时,应使用不带“-partX”后缀的条目,因为它们指的是整个磁盘。

ls /dev/disk/by-id/

示例

❄︎ /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
      }
    ];
  };
}