命令行界面
While most tasks in Unraid can be performed through the WebGUI, certain operations - especially those related to diagnostics, drive management, or scripting - require using the system console or SSH terminal. This page offers Unraid-specific command-line tools and examples that can be used without needing extensive Linux knowledge.
Many disk-level Unraid operations depend on Linux device names, like /dev/sdX. You can find the device identifier for any drive in the Main tab of the WebGUI. Look for the three-letter label sdX or nvmeX next to each disk. Use the appropriate identifier in all commands, replacing sdX with your specific disk.
访问终端
Unraid includes a built-in web terminal that you can access directly from the WebGUI. Simply use the top-right dropdown menu and select ">_". This opens a command-line session as the root user, giving you full administrative access to your system.
您也可以使用 %SSH|ssh%(安全壳)与 PuTTY 等客户端外部连接到 Unraid 服务器。
如果您使用的是Windows,可能更喜欢使用PuTTY进行SSH访问,而不是内置终端。这个软件轻量级、免费,并允许您保存会话以便日后轻松访问。
- 运行例如
smartctl、xfs_repair、tail或top等诊断和命令行工具 - 执行不需要用户界面的插件脚本或工具
- Troubleshooting issues related to connectivity, system services, or user shares
驱动器测试和监控
如果您使用的是Windows,可能更喜欢使用PuTTY进行SSH访问,而不是内置终端。这个软件轻量级、免费,并允许您保存会话以便日后轻松访问。
如何安装和使用 PuTTY - 单击以展开/折叠
Unraid automatically configures the SSH server on the first boot. Ensure your networking is working properly and that your root password is set before attempting a remote connection.
驱动器测试和监控
这些工具有助于评估性能、检查驱动器健康情况以及解决array速度慢的问题。所有命令都应从终端或通过SSH执行。
diskspeed.sh
此脚本允许进行全面的表面性能测试,并生成可视化报告。
查看 diskspeed.sh 用法 - 单击以展开/折叠
以前这脚本需要从 Unraid 论坛下载。DiskSpeed 现在提供了一个更完善的软件包:
hdparm -tT /dev/sdX
-t 标志测试缓冲磁盘读取,而 -T 测试缓存读取。这主要衡量顺序读取性能,有助于识别异常缓慢的驱动器。
运行多个测试以提高准确性:
for ((i=0;i<5;i++)); do hdparm -tT /dev/sdX; done
查看驱动器信息:
hdparm -I /dev/sdX
这将显示型号、固件、缓存大小和支持的功能,帮助验证磁盘类型和控制器行为。
smartctl
此命令运行 SMART 诊断并监控驱动器健康。