阵列配置
Unraid 的存储系统通过结合 %%array|数组%% 和 %%cache|缓存%% 架构,实现灵活性与数据保护。%%array|数组%% 管理您的主要存储,提供可选 %%parity|校验%% 保护,而缓存池则加速性能。
以下是一些重要的阵列配置原则:
始终使用最大的驱动器用于校验。
当您稍后向array中添加更多磁盘时,请记住,数据磁盘的大小不能超过您的parity disks。一开始购买最大的硬盘用于parity disks是个不错的主意。这样,当您后续扩展时,不会受到较小存储容量的限制。
如果您使用两个parity disks,它们可以是不同大小。但是,请记住,array中没有任何磁盘可以大于您所拥有的最小parity disks。
不要在阵列中使用SSD - 将它们用于缓存池或未分配设备。
Unraid does not support TRIM or Discard operations for SSDs in the main array. Over time, this will cause SSD performance to degrade if they are used as array members. For best results, use SSDs in cache pools or as unassigned devices, where these features are supported and long-term performance is maintained. Most modern SSDs, including NVMe, work well in these roles.
使用缓存提高阵列写入性能。
数据不是直接写入主存储,而是首先发送到专用磁盘或磁盘组。此数据通常在凌晨3:40安排时间转移到主存储。伟大的事情是,保存到cache的数据仍然通过user shares显示出来,因此您不需要更改访问文件的方式。
创建缓存池有助于保护缓存数据的安全。
仅使用一个缓存设备会使您的缓存数据在转移到主阵列之前面临风险。为了确保您的数据始终受到保护,使用多个设备配置为cache pool。这种设置为缓存数据提供冗余,降低由于缓存设备故障导致数据丢失的可能性。
SSD缓存设备非常适合应用程序和虚拟机。
使用SSD可以使应用程序和虚拟机(VM)运行更快,因为它们可以更快地访问数据。SSD在cache pool中表现良好,为您提 供速度、效率和数据安全的出色组合。
加密默认关闭。
如果您想在系统上使用加密,必须使用加密文件系统类型重新格式化磁盘 - 这个过程会擦除驱动器上的所有现有数据。在启用加密之前,将数据移出磁盘,将文件系统更改为加密选项,格式化磁盘,然后将数据移回。详细信息,请参阅如何在Unraid中加密驱动器。
请记住,使用加密会导致数据恢复难度增加,因此仅在您真正需要时才使用它。
Unraid identifies disks based on their serial numbers and sizes, not the specific SATA ports they're connected to. This means you can switch drives between different SATA ports without affecting their assignments in Unraid. This feature is particularly useful for troubleshooting hardware problems, like finding a faulty port or replacing unreliable power or SATA cables.
如果您分配或连接的设备数量超过许可证密钥允许的数量,您的阵列将不会启动。
启动/停止阵列
当系统启动时,通常会自动启动磁盘阵列。然而,如果您最近更改了磁盘设置,例如添加了新的磁盘,阵列将保持关闭以便让您检查配置。
请记住,您需要先停止阵列才能进行任何调整。暂停操作将完全停止所有Docker容器和网络共享,关闭或休眠虚拟机,并卸载存储设备,使数据和应用程序在您重新启动阵列前无法访问。
要启动或停止阵列:
- 点击主界面选项卡。
- 导航到 阵列操作 部分。
- 单击开始或停止。在继续之前,您可能需要选中“是,我要这样做”选项框。
阵列操作
Unraid provides several maintenance and configuration options for your storage array. Key operations include:
📄️ 添加磁盘
扩展存储容量
📄️ 替换磁盘
升级或更换故障驱动器
📄️ 移除磁盘
退役或缩小阵列规模
📄️ 检查阵列设备
监控SMART数据和诊断
📄️ 调整磁盘旋转
管理磁盘旋转启停
📄️ 重置阵列配置
重建阵列结构
添加磁盘
设置新磁盘
- 转到界面的 主界面 → 阵列设备。
- 选择想要添加磁盘的插槽,并从下拉列表中选择磁盘。
- 默认情况下,新的阵列驱动器将使用XFS格式化。如果您希望使用ZFS或BTRFS,请从下拉菜单中选择您喜欢的文件系统。
If you're using modern Unraid-compatible hardware, you can change disks without shutting down your server. This feature, known as hot-swap, has been available in LimeTech servers since the beginning.
清除与预清除
Unraid requires disks to be in a cleared state - completely filled with zeros and marked with a special signature - before adding them to a parity-protected array. This process ensures parity integrity and keeps the array online during disk preparation.
Clearance is mandatory when adding a data disk to a parity-protected array. If you are adding a parity disk or working with an array that does not use parity, clearance is not required.
内置的清除操作在后台将零写入磁盘,使阵列保持可用。完成该过程后,磁盘必须格式化才能使用。这种方法高效,不需要第三方工具,是快速扩展的理想选择。
对于更全面的方法,通过插件(如未挂载设备预清除)提供的预清除操作执行预读以检查坏扇区,对磁盘写零,然后通过后读验证完整性。此额外步骤有助于检测早期驱动器故障,但耗时更长,并需要手动安装插件。
基本准则: 使用内置清除操作快速添加到您的阵列中,或者选择预清除如果您想在将驱动器投入使用之前广泛检测其健康状况。
清除与预清除比较
| 清除 | 预清除 | |
|---|---|---|
| 目的 | 确保基本兼容性 | 测试驱动器并准备使用 |
| 速度 | 处理快速 | 过程十分缓慢 |
| 阵列影响 | 在后台运行 | 需要将磁盘从使用中移除 |
| 最佳用途 | 非常适合快速扩展 | 适合检查新驱动器 |
清除快速准备磁盘使用,使其与系统兼容,并允许您在短短几小时内扩展存储。
预清除耗时较长,但提供全面测试,以确保新磁盘在成为阵列一部分之前是可靠的。
避免在将预先清除的磁盘包括在阵列中之前对其进行格式化,因为这将移除清除签名。
添加数据盘
Adding data disks is a great way to increase your Unraid array's storage space. By adding more disks, you can keep more files, applications, and backups, while still protecting your data.
添加新的数据盘时,其大小必须与当前parity disks相同或更小。如果您想使用更大的磁盘,首先需要用较大的替换parity disks,然后将旧的parity disks作为数据磁盘使用。
如何添加数据盘
- Standard addition (Parity-protected)
- Addition without parity
要向保护奇偶的阵列中添加数据盘:
-
停止阵列: 使用 Unraid WebGUI 停止阵 列。
-
关闭服务器: 安全地关闭服务器电源。
-
安装新硬盘: 实体添加新磁盘。
-
重新开启服务器: 重新启动您的服务器。
-
分配新磁盘: 使用 WebGUI 将新磁盘分配到可用数据槽。
-
启动阵列: 再次启动阵列。
- Unraid 会自动在新硬盘上运行 清除操作。这会用零填充硬盘,并确保它可以使用,同时保持数据完整性。
- 清除操作在后台进行,因此您仍然可以访问您的数组。但是,直到过程完成并且磁盘格式化之前,新磁盘将无法使用。
- 如果您已提前清除磁盘,Unraid 将跳过此步骤,识别它已经准备好使用。
-
清除完成后: 一旦清除过程完成,磁盘将在WebGUI中显示为不可挂载。系统将提示您格式化它。
始终仔细核对序列号,确保您正在格式化正确的磁盘。格式化将擦除该磁盘上的所有内容,这个操作无法撤销。
- 确认格式:检查确认框 并点击格式按钮。Unraid 将会警告您此操作的结果。
- **格式化过程:**格式化将需要几分钟。完成后,磁盘将显示为已挂载并可以使用。由于文件系统的开销,看到少量已用空间是正常的。
您可以添加多个磁盘,但在它们全部清除和格式化之前将无法使用。
向没有奇偶保护的阵列中添加数据盘:
-
停止阵列: 使用 Unraid WebGUI 停止阵列。
-
关闭服务器: 安全地关闭服务器电源。
-
安装新硬盘: 实体添加新磁盘。
-
重新开启服务器: 重新启动您的服务器。
-
分配新磁盘: 使用 WebGUI 将新磁盘分配到可用数据槽。
-
启动阵列: 再次启动阵列。
- The clearing step is skipped entirely when there is no parity disk in the array.
-
格式化磁盘: 新磁盘将在WebGUI中显示为不可挂载。 系统将提示您格式化它。
始终仔细核对序列号,确保您正在格式化正确的磁盘。格式化将擦除该磁盘上的所有内容,这个操作无法撤销。
添加奇偶盘
Parity disks是有用的特性,为您的数据提供额外的保护层。如果硬盘出故障,它们允许您的存储系统恢复信息。虽然使用parity disks是可选的,但强烈建议使用以保障数据安全。
:::important[Requirements]
- 单一奇偶: 该磁盘的大小必须至少与最大数据驱动器相同。
- 双Parity: 两个parity disks的大小也必须不小于您最大的一个数据磁盘,但彼此之间可以有不同的大小。
:::
添加parity disk类似于添加数据磁盘,但还有一个重要步骤需要注意:
- 选择parity disk并启动存储阵列后,将开始一个称为Parity计算的过程。
- 在此过程中,您仍然可以访问文件。然而,由于正在计算校验,系统可能运行较慢。
深入了解:什么是校验及其重要性? - 单击以展开/折叠
Parity in Unraid protects your data by ensuring that you can recover from a drive failure. With the use of a parity disk, any single missing disk can be reconstructed by combining the information from all other data drives along with the parity data.
Unraid 依赖于实时奇偶校验的两个主要目的:
- 当驱动器故障时重建数据
- 发现坏扇区时纠正错误
此功能允许您保持数据安全,即使驱动器最终会随着时间的推移而失效。
In-depth: How does Unraid parity work? - Click to expand/collapse
Unraid works with a special bit called the parity bit, which is stored for each bit position across all data disks and is managed by a dedicated parity disk. The parity is calculated such that the total number of bits in each position across all disks (including the parity disk) is always an even number, a process known as even parity.
Unraid 依赖于实时奇偶校验的两个主要目的:
- Unraid 使用 XOR(异或)操作进行该计算。
- 例如,如果你有四个驱动器,其第57位的比特位是1,1,1,1,那么该位置的奇偶位将为0(因为1 + 1 + 1 + 1 + 0 = 偶数)。
- 然而,如果第57位是1,0,0,0,该位置的parity就会是1(以确保总数保持偶数)。
When adding a new drive, Unraid first clears it by writing zeros to all bits. This allows for quick inclusion into the protected array since writing zeros does not interfere with the current parity calculations.
In-depth: How does Unraid parity work? - Click to expand/collapse
Unraid works with a special bit called the parity bit, which is stored for each bit position across all data disks and is managed by a dedicated parity disk. The parity is calculated such that the total number of bits in each position across all disks (including the parity disk) is always an even number, a process known as even parity.
- 它会读取所有剩余的驱动器,包括parity disk。
- 它应用偶parity来解决丢失的数据。
例如,如果驱动器2出现故障:
- If the related bits are 1, 1, 1 (in addition to the parity), Unraid calculates: 1 + x + 1 + 1 + 0 = even. Here, x must be 1 to maintain an even total.
- 如果比特位显示为1, x, 0, 0, 1 = 偶数,则x将等于0。
This parity feature allows Unraid to "simulate" the missing disk. You can continue using the array as if the drive were still functional. Once you install a new drive in the failed slot, Unraid will recreate all the missing data based on the current state of parity and the other disks.
为了确保持续的保护和有效的恢复,定期运行parity checks是很重要的。
深入了解:如何使用校验重建数据? - 点击展开/折叠
您的parity disk必须等于或大于最大数据磁盘。例如:
- 如果最大的一个数据磁盘是10TB,则您的parity disk至少应为10TB。
- 您可以自由组合不同大小的数据磁盘,只要它们没有超过parity disk的大小即可。
我的校验磁盘需要多大? - 点击展开/折叠
Writing to a parity-protected array involves four disk operations for each write: reading data, reading parity, writing data, and writing parity. This process requires a full rotation from each affected drive, so the overall write speed is limited by the slowest drive involved in the operation.
添加更快的parity disk不会必然提升写入速度,除非您同时向多个慢速数据磁盘写入,从而使parity disk能承担负荷。通常,写入速度受正在写入数据盘中的最慢驱动器限制。
深入了解:校验如何影响写入性能? - 点击展开/折叠
Dual parity enables recovery from two simultaneous disk failures. In Unraid, the second parity disk doesn't simply mirror the first. Instead:
- **Parity 1:**采用标准的XOR(偶)parity计算。
- Parity 2: Utilizes a more complex algorithm (Galois field, rather than Reed-Solomon as in traditional RAID 6), allowing Unraid to rebuild from any two missing disks at the same time. This feature is significant for larger arrays, where the risk of multiple failures increases. Dual parity significantly boosts resilience without the added overhead of mirrored redundancy.
:::caution[Remember]
设置新的数据存储系统时,首先添加您的数据磁盘,确保它们都使用兼容的文件系统。在放置数据磁盘之后,您可以添加parity disk以防止磁盘故障。
一旦添加了parity disk,请记住您想要在阵列中包含的任何新磁盘在集成前必须被清零。这是为了确保parity保持有效,并继续保护您的数据。
:::
升级奇偶校验磁盘
您可以将parity disk设备升级到更大以便在阵列中使用更大尺寸的磁盘或添加额外的parity disk。
如果您计划采取以下步骤且只有一个parity disk,请记住这些要点:
- 在parity重建完成之前,您的数据将没有保护。如果数据磁盘在此期间故障,您可能会丢失那块磁盘上的信息。
- 如果您已经有一个失败的数据驱动器,继续这些步骤将阻止您重建该驱动器。在这种情况下,您应遵循Parity Swap程序。
要移 除奇偶校验驱动器:
- 停止阵列: 使用WebGUI停止阵列。
如果您的服务器支持热插拔,更换磁盘时不需要关机。您可以安全地跳过步骤2和步骤4。
- 关闭服务器: 关闭服务器以安全地进行硬件更改。
- 安装新的parity disk: 将新的、更大的parity disk放入您的服务器中。
- 启动服务器: 重新打开服务器。
- 分配新磁盘: 进入设置中的校验槽分配新磁盘,替换旧磁盘。
- 启动阵列: 使用WebGUI重新启动阵列。
一旦阵列恢复,Unraid 将开始在新磁盘上构建 %%parity|校验%%。在此期间,您仍可以访问您的数据,但请注意,在过程完成之前,访问速度可能会有些慢。一旦 %%parity|校验%% 构建完成,您的数据将再次得到保护!
-
保留旧磁盘: 在新的parity构建完成之前,不要移除旧的parity disk。如果在升级过程中数据磁盘出现故障,保留旧磁盘可 能有助于您恢复数据。
-
**双重校验用户:**如果您有两个parity disks,请一次升级一个以增加安全性。
-
旧磁盘的再利用: 升级后,如果旧parity disk仍然能满足您的存储需求,您可以将其用作数据磁盘。
更换磁盘
您可能会需要因以下两个主要原因来更换阵列中的磁盘:
虽然两种情况下更换磁盘的过程相似,但请注意,替换过程中存在数据丢失的风险。校验设备可以保护您的数据;一个校验设备可以防止单个磁盘故障导致的数据丢失,而两个设备可以在两个磁盘故障情况下保护数据。更换磁盘时,请始终了解您的保护级别。
升级容量
在将数据驱动器升级为更大的驱动器时,请注 意以下几点:
-
不可挂载的磁盘: 在升级之前修复任何不可挂载的磁盘。不可挂载状态在重建期间不会被解决。
-
单个校验的风险: 如果您只有单个校验,在升级期间如果另一个驱动器发生故障,您将面临数据丢失的风险。如果发生这种情况,请在论坛中寻求建议。
-
双校验保护: 通过双校验,如果在升级单个驱动器时一个驱动器出现故障,您可以放心,不会丢失数据。您还可以同时升级两个驱动器,但请注意这会增加风险,因为您将没有另一驱动器故障的保护。
-
备份旧磁盘: 在确认升级成功之前,保持原磁盘完好无损。这为出现任何问题时提供了回退选项。
更换驱动器总是涉及到一定的风险。如果在升级期间另一块驱动器故障,特别是只有单一校验的情况下,您可能会丢失数据。在开始之前务必检查驱动器的健康状况,并确保在升级完成并确认数据安全之前保持旧驱动器完整无损。
要升级现有数据磁盘:
-
运行一个校验检查: 首先,通过运行 %%parity check|校验检查%% 确保数据的完整性。前往工具 → 校验检查并确保没有