Raid 5 How does it work

Associate
Joined
1 Nov 2003
Posts
1,268
Location
Maidstone, Kent
Hi,

Thinking of getting a Buffalo TERASTATION 1TB.

The blurb states it comes with RAID 5 as standard.

Looked at the sticky, and googled RAID 5 and I really can't seem to see how RAID5 works.

RAID 1 and RAID 0 make sense, but if I'm right, then having 5 HDDs in RAID 5 means that 4 of them hold data and 1 holds parity.

If the parity drive goes down I can see I still have all my data intact, but if one of the data-holding drives dies, as the data isn't stored anywhere else, surely I'd lose it.

I know that isn't the case. Can anyone explain it in simple language fior the hard of thinking.

Thanks in advance.

By the way any opinions (good or bad) on the Terastation would be welcome too ;)
 
Last edited:
I must be so thick, I still don't get it.


I now see that the parity (whatever that is) is not stored on one drive, but spread over the set.

However, I still don't see how, if one disk dies, my data is safe. It appears it is not duplicated anywhere else in the array, unlike raid 1.

Sorry for being dense :confused:
 
Hussman said:
I must be so thick, I still don't get it.


I now see that the parity (whatever that is) is not stored on one drive, but spread over the set.

However, I still don't see how, if one disk dies, my data is safe. It appears it is not duplicated anywhere else in the array, unlike raid 1.

Sorry for being dense :confused:
You are not being dense at all as it is quite hard to understand sometimes, but i'll try and break it down a little.

Because the parity blocks are spread across multiple drives if a disk fails the contriller can then add up the remaining praity blocks and work out the missing block/drive and rebuild with that.

Some one please correct me if wrong, it's been a few years since I have dealt with RAID systems ;)
 
Taking the 5 disk array as an example, each disk contains a section of the data plus a lump of parity data. Assume we have 5*250Gb disks, so 1000Gb of usable space. Now simplifying things that 1Tb can be split into 5 lots of 200Gb (A-E for data and P for parity) and those 200Gb chunks are spread across the disks (4 chunks of 50Gb for data and 5 for parity in this simplified example ). Thus diagramatically this looks like:

Disk 1: A B C D P
Disk 2: A B C P E
Disk 3: A B P D E
Disk 4: A P C D E
Disk 5: P B C D E

Now if any one disk is removed you lose 4 blocks of data plus a block of parity data. Now the magic bit is in the calculation of the parity - the remaining 4 parity blocks are sufficient that when combined with the remaining data blocks they can be used to regenerate the missing 4 data blocks, thus allowing the array to operate with only 4 drives or for the fifth to be recreated.
 
rpstewart said:
Taking the 5 disk array as an example, each disk contains a section of the data plus a lump of parity data. Assume we have 5*250Gb disks, so 1000Gb of usable space. Now simplifying things that 1Tb can be split into 5 lots of 200Gb (A-E for data and P for parity) and those 200Gb chunks are spread across the disks (4 chunks of 50Gb for data and 5 for parity in this simplified example ). Thus diagramatically this looks like:

Disk 1: A B C D P
Disk 2: A B C P E
Disk 3: A B P D E
Disk 4: A P C D E
Disk 5: P B C D E

Now if any one disk is removed you lose 4 blocks of data plus a block of parity data. Now the magic bit is in the calculation of the parity - the remaining 4 parity blocks are sufficient that when combined with the remaining data blocks they can be used to regenerate the missing 4 data blocks, thus allowing the array to operate with only 4 drives or for the fifth to be recreated.

Spot on explination. 5 stars
 
Ok, thanks for the help.

Making much more sense now.

Can someone explain the "magic" bit?

How can the lost data be "regenerated" using the remaining 4 blocks plus parity?

Thanks Guys
 
Yes, although I'm still a bit dodgy on the "regeneration" stuff.

Do you reckon RAID 5 will be sufficient to protect my digital photos?

Currently got RAID 1.

They are only snaps, but mean a lot to me. Photos of my parents, who are no longer with us, that kind of thing.

Yes, I've got them on CD too, but heard that some CDs can become unreadable after a period of time. They are stored away from light and heat.

Thanks
 
RAID1 is as good as RAID5 unless you need more space than a single drive can provide. Personally I use RAID5 plus two DVD copies on decent Taiyo Yuden disks, one copy kept here and one off site.

The regeneration bit is all down to how the parity is calculated, at a bit level the parity is calculated by XORing all the data bits in the particular stripe. Now in a 3 disk array (cos its simpler) this looks like

A XOR B = Parity
0 XOR 0 = 0
1 XOR 0 = 1
0 XOR 1 = 1
1 XOR 1 = 0

To regenerate a data (or parity) block the remaining bits are simply XOR'd again to give the missing bit. If you XOR A & Parity in the example above you get B back.
 
I just liked the idea of having a NAS.

Read somewhere that the terastation only allows 8.3 file names. Is this the case?
 
What I think is far better especially in this age of cheap storage is to have two RAID 1 arrays with each backed up to the other on a regular basis.

I have a hardware RAID5 card here (Promise one with 256MB ram) and has a RAID 5 array running with a hot spare. I didnt count on two drives failing at the same time. Lost most of my data - was able to recover some after rembuilding array from scratch, but it wasnt good - I now have the conifiguration I have above.

The best is non-hard drive storage to be honest, but time consuming.
 
Yeah, it is incredibly unlucky to have two HDDs fail at the same time, but can happen if the two drives came from the same dodgy batch or there was some kind of power surge in the system.

Either way it isn't something that happens that often but often enough to make me keep DVD copies for when I eventually get my own array up and running. Just need 5 HDDs and a file server. The woes of having no money :(

SiriusB
 
Never got to the bottom of it. All the drives were in working order. It seems to have been a combination of Diskeeper defragmenting and Windows Server 2003 installing updates and Volume Shadow Copy. They were possibly running in the background along with FAH and I was trying to move a big (5GB) file from another drive onto the array. The thing froze and when restarted it didnt find the array at all. Bummer.

The RAM on the controller card is a normal 256mb module, not sure if ECC Ram would make any difference. They other thing I thought of was overheating or dodgy system RAM. Never worked it out.

Even now it will randomly freeze. Then freeze during startup. But if you leave it for a day and turn it on again it works. Odd? I will be tearing it apart very soon anyways and starting again.
 
Back
Top Bottom