Jump to content

关于奇偶校验的设置问题。


Go to solution Solved by JackieWu,

Recommended Posts

首先问一个问题,进行奇偶校验的时候是,阵列磁盘进行读取,校验盘进行写入。所以至此衍生出一个问题,如何有效设置奇偶校验的间隔,才能够在保护磁盘以及保护资料中达到平衡,因为unraid的校验不是在写入新的数据的时候就在做校验,而是需要主动开启,那是不是意味着在新的一次校验开始时,从上一次校验完成开始,到这一次校验完成结束的所有新增数据,都在裸奔。那么问题来了 一块16T的硬盘做校验盘的话,比较合适的校验间隔应该设置成多久,至少应该是以两周起为单位吧,毕竟16T的校验数据都要跑至少两天

Link to comment
4 hours ago, duck.wang said:

所以至此衍生出一个问题,如何有效设置奇偶校验的间隔,才能够在保护磁盘以及保护资料中达到平衡

 

你可以借助一个叫做 Parity Check Tuning 的插件来实现阶段性的奇偶校验,也就是可以将一次完整的奇偶校验拆分成多次进行。

 

Quote

因为unraid的校验不是在写入新的数据的时候就在做校验,而是需要主动开启,那是不是意味着在新的一次校验开始时,从上一次校验完成开始,到这一次校验完成结束的所有新增数据,都在裸奔。

 

不是的,当你写入数据到阵列时,校验盘也会同时对新写入的数据进行校验,也就是说校验是随着新数据的产生而产生,并不是静态的。

 

Quote

那么问题来了 一块16T的硬盘做校验盘的话,比较合适的校验间隔应该设置成多久,至少应该是以两周起为单位吧,毕竟16T的校验数据都要跑至少两天

 

具体间隔设置成多少没有一个标准,需要根据自己的实际情况来调整,我的话 16T 数据校验大概需要将近两天。

Link to comment
19 hours ago, JackieWu said:

 

你可以借助一个叫做 Parity Check Tuning 的插件来实现阶段性的奇偶校验,也就是可以将一次完整的奇偶校验拆分成多次进行。

 

 

不是的,当你写入数据到阵列时,校验盘也会同时对新写入的数据进行校验,也就是说校验是随着新数据的产生而产生,并不是静态的。

 

 

具体间隔设置成多少没有一个标准,需要根据自己的实际情况来调整,我的话 16T 数据校验大概需要将近两天。

按照你第二段文字的说法,那为啥还要设置定时奇偶校验呢,如果校验是动态的,是因为只对新写入的数据会校验,删除的,或者修改的不会?
 

Link to comment
  • Solution

根据官方的校验盘工作原理介绍,校验盘会对阵列(Array)里面所有硬盘内的数据进行奇偶校验,将形成的数据存储到校验盘中。

 

但是硬盘里面的数据是会变化的,比如说新写入了文件、文件被修改、删除等。

 

假设我今天做了一次完整的奇偶校验,但随后我将阵列里某一块硬盘所有的数据都删掉了,那么此时校验盘保存的校验数据依然是先前硬盘还有数据时的校验数据。换句话说,已经计算得到的校验数据是静态的,删除数据(或修改数据)不会让先前已经计算好的校验数据实时发生变化。

 

为什么删除数据版不会实时改变校验数据,因为校验盘就是为了保护你的数据呀。

 

阵列里某个硬盘坏了,无法读取了,是不是从某种程度上也算是一种非人为的”删除数据“,如果此时校验数据也一并被删除,那么校验盘就没有存在的意义了。

 

Quote

那为啥还要设置定时奇偶校验呢

 

只要硬盘里面的数据被删除或修改了,校验后的数据都会与上一次校验的数据有所不同,并且就算数据没有删除或者修改,如果说硬盘出现了坏道或者一些其他的问题导致数据发生了变化(或者导致数据不完整了),那么定时校验就可以发现问题并对数据进行修复,这就是定时校验的意义。

 

关于 unRAID 校验盘更完整的说明,可以参考我写的博客:新手教程:什么是校验盘,校验盘有什么作用

Edited by JackieWu
  • Like 1
  • Thanks 1
  • Upvote 1
Link to comment
On 8/30/2023 at 8:23 PM, JackieWu said:

根据官方的校验盘工作原理介绍,校验盘会对阵列(Array)里面所有硬盘内的数据进行奇偶校验,将形成的数据存储到校验盘中。

 

但是硬盘里面的数据是会变化的。

 

比如说我今天做了一次完整的奇偶校验,但随后我将阵列里某一块硬盘所有的数据都删掉了,那么此时校验盘保存的校验数据依然是先前硬盘还有数据时的校验数据。换句话说,已经计算得到的校验数据是静态的,删除数据(或修改数据)不会让先前已经计算好的校验数据实时发生变化。

 

为什么删除数据版不会实时改变校验数据,因为校验盘就是为了保护你的数据呀。

 

阵列里某个硬盘坏了,无法读取了,是不是从某种程度上也算是一种非人为的”删除数据“?

 

 

只要硬盘里面的数据被删除或修改了,校验后的数据都会与上一次校验的数据有所不同,并且就算数据没有删除或者修改,如果说硬盘出现了坏道或者一些其他的问题导致数据发生了变化(或者导致数据不完整了),那么定时校验可以发现问题并对数据进行修复,这就是定时校验的意义。

我的理解是简单的说,正常的磁盘文件写入的时候校验盘数据都是同时正常地更新的。但是数据盘文件可能会发生意外的数据变动(或者说错误地更新了,或者发生错误)校验盘并不知道。所以需要定期进行Parity Check, 执行频率应该根据自己的实际情况平衡安全和效率来选择。

Link to comment
  • 1 month later...

但是官方文件是这样说的:

关于parity

" In Unraid parity is always maintained in real-time and a bit more detail on the access pattern to the drives is described under Manual/Storage Management with their performance implications."

关于Parity check

“If you have at least one parity device assigned, clicking Check will initiate a Parity-check. This will march through all data disks in parallel, computing parity and checking it against stored parity on the parity disk(s).

You can continue to use the array while a parity check is running but the performance of any file operations will be degraded due to drive contention between between the check and the file operation. The parity check will also be slowed while any such file operations are active.

By default, if an error is found during a Parity-check the parity disk will be updated (written) with the computed data and the Sync Errors counter will be incremented. If you wish to run purely a check without writing correction, uncheck the checkbox that says Write corrections to parity before starting the check. In this mode, parity errors will be notated but not actually fixed during the check operation.

A correcting parity check is started automatically when starting the array after an "Unsafe Shutdown". An "Unsafe Shutdown" is defined as any time that the Unraid server was restarted without having previously successfully stopped the array. The most common cause of Sync Errors is an unexpected power-loss, which prevents buffered write data from being written to disk. It is highly recommended that users consider purchasing a UPS (uninterruptable power supply) for their systems so that Unraid can be set to shut down tidily on power loss, especially if frequent offsite backups aren't being performed.

It is also recommended that you run an automatic parity check periodically and this can be done under Settings->Scheduler. The frequency is up to the user but monthly or quarterly are typical choices. It is also recommended that such a check is set as non-correcting as if a disk is having problems there is a chance of you corrupting your parity if you set such a check to be correcting. The only acceptable result from such a check is to have 0 errors reported. If you do have errors reported then you should take pre-emptive action to try and find out what is causing them. If in doubt ask questions in the forum.”

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...