Jump to content

Rebuilding Drives and/or Parity??


Recommended Posts

I'm still extremely new to all of this.  So, let's say a drive craps out on me… I've read a lot about drives being rebuilt when replaced, but what am I rebuilding?  Will it replace all the info on that drive from the info contained, or is it just rebuilding the parity??  I have all of my drives backed up.  My unraid server works great with XBMC for internal and Plex server works great for external and the rest of it is bare metal, the more you add, the more chances of breakage… But, should something go wrong, I don't have the foggiest,  is there a tutorial about unraid that explains the basics in layman's terms.  It's like I built a football, but I don't know how to play the game, is there an instruction manual or up to date wiki about this.  Thanks for all your help so far!!

Link to comment

UnRAID provides fault tolerance for a single drive failure.  Doesn't matter which drive fails -- one of the data drives or the parity drive.    If (when) that happens, the failed drive can be rebuilt by reading ALL of the other drives and reconstructing the data for the failed drive.  So that's what happens when you replace it and it does a rebuild.

 

But it only works with a single failure -- so when a drive has failed you're "running at risk" ... which means that if any other drive fails you can no longer rebuild the original failed drive or the second one -- thus you lose all the data on both of the failed drives (which is why you still need to have backups of your data).

 

So ... if a drive fails, the first thing you should do is get a replacement drive; replace the failed drive; and let the system do the rebuild.    In fact, if I had a drive fail, I'd turn off the server until I had the replacement drive, just to minimize the likelihood of some other failure before I had the first one rebuilt.

 

Link to comment

Let's see if I did my homework OK.  Let's say my #5 3T data drive goes south, I would replace it with my 4T parity drive (that's what I have in there at current) and put a 4T fresh drive that has been precleared in place of the old parity drive and let unraid do it's thing from there, right?  So, it looks like I have to get a new 4T drive to be precleared, am I on the right track?

Link to comment

No, you would replace the failed #5 disk with the new drive, the size of the replacement drive does not matter as long as it is a) at least as big as the failed drive, AND b) the same size or smaller than the parity drive.  The contents of the failed drive would then be rebuilt from the contents of all other drives plus parity.

 

This isn't exactly how parity works, but think of it this way (it's easier than getting into XOR logic).  Take the first bit of every data drive, add them up, and store result to 1st bit of parity drive.  Repeat for 2nd bit, 3rd bit, etc across the entire array.  Now if a drive fails and you need to rebuild it, just reverse the process.  If you take the parity amount and subtract all other surviving drives, you are left with what was on the failed drive.  Do this bit by bit across the entire drive and you have reconstructed the contents of that drive from parity and surviving array drives.

Link to comment

As I sit here this very moment, I don't have a new drive "ready to go".  Let's say a drive goes down now, I buy a new HDD and replace the "broke" one.  If I don't have it precleared, will unraid clear it, format it, and rebuild it or does some of that have to be already done?  Quite an education here, been running this for 3 months now, and just learning this!

Link to comment

As I sit here this very moment, I don't have a new drive "ready to go".  Let's say a drive goes down now, I buy a new HDD and replace the "broke" one.  If I don't have it precleared, will unraid clear it, format it, and rebuild it or does some of that have to be already done?  Quite an education here, been running this for 3 months now, and just learning this!

Preclear is useful for testing a disk, but unRAID does not need a clear disk to rebuild onto.

 

Only when you are adding a disk does it need to be cleared of all data so that it will be in sync with parity. If you preclear it then unRAID will not have to and the array will be available quickly. If you don't preclear then unRAID will have to do it and the array will be unavailable until it finishes.

 

I recently did a rebuild, not because a disk had failed, but because I wanted to replace it with a larger drive. I did a preclear anyway because I wanted to test the new disk.

Link to comment

As noted above, if you have a failed drive (e.g. #5), you simply replace it, and the data from the failed drive will be written to that drive (if the new drive is larger, then the rest of it will be cleared .. e.g. written with zeroes).

 

The "parity" drive is in some respects a misnomer.  While it IS a dedicated parity drive, since it contains the parity bits for the even-parity sum of all of the other drives, it's only the parity drive because it's designated as such and doesn't actually have a file system.    From the simple perspective of the bits on the disks (forgetting the file system) EVERY drive is a parity drive for all of the other drives.    So if ANY drive fails, it can be reconstructed by reading all of the other drives.

... which is how UnRAID can reconstruct a drive.

 

As also noted, it's not a bad idea to run a pre-clear cycle ... or a set of the manufacturer's diagnostics ... on any new drive before using it just to be sure it's not DOA.    The best approach, to ensure you never have to run "at risk" for any length of time, is to always have a tested spare drive ... and buy another one if/when you have to use it.

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...