There has been lots of documentation already written about RAID storages, why this one more you can ask.
Alright, I want to write it clear, creatively and comprehensive for all whoever wants to understand how RAID works.
In the 1990’s there was a cult TV show “Twin Peaks”. Beautiful girls handsome men, beautiful Laura Palmer,
FBI agent Cooper dreamt of by many women. Good and evil in a small town Twin Peaks.
In the second season of the show an evil genius Windom Earle emmerges. A former FBI agent and coleague of agent Cooper.
Windom was a great chess player and a proficient expert in poetry. He writes a poem by Percy Shalley on a sheet
of paper, stripes the sheet in three parts and sends the each to the three Queens of Twin Peaks.
Season 2, part 16.
None of the girls could read the poem until they had met in the Roadhouse and put all the three stripes together.
Only then they could read it.
So, they read Percy Bysshe Shalley’s poem “Love’s Philosophy”.
See the mountains kiss high Heaven
And the waves clasp one another;
No sister-flower would be forgiven
If it disdained its brother;
And the sunlight clasps the earth
And the moonbeams kiss the sea:
What is all this sweet work worth
If thou kiss not me?
“RAID 0”.
If we ilustrate “RAID 0” in a table these three stripes of the poem would look the following way.
Audrey: ("DISK 0" or "D0")
Donna: ("DISK 1" or "D1")
Shelly: ("DISK 2" or "D2")
D0:B00: See the m
D1:B00: ountains kiss
D2:B00: high Heaven
D0:B01: And th
D1:B01: e waves clasp
D2:B01: one another;
D0:B02: No sister
D1:B02: flower wo
D2:B02: uld be forgiven
D0:B03: If it di
D1:B03: sdained its
D2:B03: brother;
D0:B04: And th
D1:B04: e sunlight
D2:B04: clasps the earth
D0:B05: And
D1:B05: the moonbea
D2:B05: ms kiss the sea:
D0:B06: What
D1:B06: is all this sw
D2:B06: eet work worth
D0:B07: If
D1:B07: thou kiss no
D2:B07: t me?
Technically speaking “RAID 0” rrequires at least two disks, in our case we have three, since the girls were three.
“RAID 0” is block oriented, i.d. it reads/writes in blocks.
“RAID 0” has an excellent performance as the data is striped in blocks evenly, and thus with the three disks each of
the disks has thrice less input/output operations, the speed is thrice higher as well. By organizing a “RAID 0” array
of three physical disks you can approach the speeds of an SSD (Solid-State Drive), since the reads are performed
simultaneously from all the drives of the arrays. So if one HDD can output 25mb per second, the three disks will
output 75 logical mega bytes per second. In fact “RAID 0” is fastest of all arrays.
“RAID 0” has NO redundancy, has NO mirroring, has NO parity. “RAID 0” just simply evenly divides the input/output
load between the available disks in the array.
“RAID 0” is highly UNrecommended for usage on critical systems where the storage reliability is of the utmost importance!
As soon as any single disk is broken — all the data are lost with no single chance to recover at all. You won’t be able to
read from the other healthy disks, for the data would be considered inconsistent without a broken disk of the array.
Just the same way as none of the girls could read the poem without two others, as well as any two girls would be unable
to read the poem without any third of them.
The total storage space is the sum of all the disks. If you have three disks 1TB each, so you have 3TB for storage.
In the "RAID 0" the data are written on the disks as lined up stripes, it means that if you use the disks of different
sizes in the array, say, 500GB, 1TB, 750GB - then the size of the array will be 1.5TB. That is the smallest disk will
be multiplied by three, thus 500GB of the 1TB disk and 250GB of the 750GB disk will be wasted.
“RAID 1”.
“RAID 1” also requires two disks minimum. “RAID 1” is block oriented, i.d. it reads/writes in blocks. The blocks are mirrored.
The redundancy is excellent, NO striping, NO parity. “RAID 1” maintais duplicate sets of all data on each disk of the array and
represents them as one logical set of data.
The performance is good, but not excellent like for “RAID 0”. In fact “RAID 1” was designed rather for protection from data loss
and redundancy than for speed and performance. Actually the disks in the array keep the identical copy of the data. When a write
“operation” is performed it is done on the first disk and then the copy is written on the rest of the disks in the array.
A “read” operation is satisfied by data delivery from any of the disk OR from all of them simultaneously as in “RAID 0”.
The total storage space is 50% of the capacity of all the drives in the array.
If you have three disks 1TB each, so you have 1.5TB for storage.
In case of an array composed of three discs of different sizes - 500GB, 1TB and 750GB - the usable space will be equal to 500GB.
Again as in case with "RAID 0" 500GB and 250GB are wasted.
Audrey: ("DISK 0" or "D0")
Donna: ("DISK 1" or "D1")
Shelly: ("DISK 2" or "D2")
D0:B00: See the m
D1:B00: See the m
D2:B00: See the m
D0:B01: ountains kiss
D1:B01: ountains kiss
D2:B01: ountains kiss
D0:B02: high Heaven
D1:B02: high Heaven
D2:B02: high Heaven
D0:B03: And th
D1:B03: And th
D2:B03: And th
D0:B04: e waves clasp
D1:B04: e waves clasp
D2:B04: e waves clasp
D0:B05: one another;
D1:B05: one another;
D2:B05: one another;
D0:B06: No sister
D1:B06: No sister
D2:B06: No sister
D0:B07: flower wo
D1:B07: flower wo
D2:B07: flower wo
D0:B08: uld be forgiven
D1:B08: uld be forgiven
D2:B08: uld be forgiven
D0:B09: If it di
D1:B09: If it di
D2:B09: If it di
D0:B10: sdained its
D1:B10: sdained its
D2:B10: sdained its
D0:B11: brother;
D1:B11: brother;
D2:B11: brother;
D0:B12: And th
D1:B12: And th
D2:B12: And th
D0:B13: e sunlight
D1:B13: e sunlight
D2:B13: e sunlight
D0:B14: clasps the earth
D1:B14: clasps the earth
D2:B14: clasps the earth
D0:B15: And
D1:B15: And
D2:B15: And
D0:B16: the moonbea
D1:B16: the moonbea
D2:B16: the moonbea
D0:B17: ms kiss the sea:
D1:B17: ms kiss the sea:
D2:B17: ms kiss the sea:
D0:B18: What
D1:B18: What
D2:B18: What
D0:B19: is all this sw
D1:B19: is all this sw
D2:B19: is all this sw
D0:B20: eet work worth
D1:B20: eet work worth
D2:B20: eet work worth
D0:B21: If
D1:B21: If
D2:B21: If
D0:B22: thou kiss no
D1:B22: thou kiss no
D2:B22: thou kiss no
D0:B23: t me?
D1:B23: t me?
D2:B23: t me?
“RAID 0+1”.
"RAID 0+1" means arrays implemented as "RAID 1", whose elements are "RAID 0" arrays.
Such implementation has the benefits of "RAID 0" speed and "RAID 1" safety.
It is also much easier to implement than "RAID 3", "RAID 5" or "RAID 6". The main drawback of such a solution is its cost.
Audrey: (Three Disks)
Donna: (Three Disks)
Shelly: (Three Disks)
D0:0
D1:0
D2:0
D0:1
D1:1
D2:1
D0:2
D1:2
D2:2
See the m
ountains kiss
high Heaven
See the m
ountains kiss
high Heaven
See the m
ountains kiss
high Heaven
And th
e waves clasp
one another;
And th
e waves clasp
one another;
And th
e waves clasp
one another;
No sister
flower wo
uld be forgiven
No sister
flower wo
uld be forgiven
No sister
flower wo
uld be forgiven
If it di
sdained its
brother;
If it di
sdained its
brother;
If it di
sdained its
brother;
And th
e sunlight
clasps the earth
And th
e sunlight
clasps the earth
And th
e sunlight
clasps the earth
And
the moonbea
ms kiss the sea:
And
the moonbea
ms kiss the sea:
And
the moonbea
ms kiss the sea:
What
is all this sw
eet work worth
What
is all this sw
eet work worth
What
is all this sw
eet work worth
If
thou kiss no
t me?
If
thou kiss no
t me?
If
thou kiss no
t me?
“RAID 1+0”.
A "RAID 1+0" array is implemented as "RAID 0", whose elements are "RAID 1".
It combines the same advantages of "RAID 0" (speed) and "RAID 1" (safety), but in different way.
"RAID 1+0" creates a large stripe of small mirrors. After failure of a disk, while it is being replaced, only the small
fragment of a whole array is rebuilt.
The drawback is the same as of "RAID 0+1" - high cost of implementation.
Audrey: (Three Disks)
Donna: (Three Disks)
Shelly: (Three Disks)
D0:0
D1:0
D2:0
D0:1
D1:1
D2:1
D0:2
D1:2
D2:2
See the m
See the m
See the m
ountains kiss
ountains kiss
ountains kiss
high Heaven
high Heaven
high Heaven
And th
And th
And th
e waves clasp
e waves clasp
e waves clasp
one another;
one another;
one another;
No sister
No sister
No sister
flower wo
flower wo
flower wo
uld be forgiven
uld be forgiven
uld be forgiven
If it di
If it di
If it di
sdained its
sdained its
sdained its
brother;
brother;
brother;
And th
And th
And th
e sunlight
e sunlight
e sunlight
clasps the earth
clasps the earth
clasps the earth
And
And
And
the moonbea
the moonbea
the moonbea
ms kiss the sea:
ms kiss the sea:
ms kiss the sea:
What
What
What
is all this sw
is all this sw
is all this sw
eet work worth
eet work worth
eet work worth
If
If
If
thou kiss no
thou kiss no
thou kiss no
t me?
t me?
t me?
Blocks, Bytes And Bits.
Above I showed you just a poetical representation of “RAID 0”, but before I continue to "RAID 5" I need to go a little
deeper into technical details — about blocks, bytes and bits. Poetry will always stay with us, but we have to consider some technicals beyond the poetry, whatever - you cannot avoid it.
The data on the disks are well structured for quick access, the units on the disk where the data are stored are called blocks. Disks write information in blocks.
Imagine that a page of your exercise book is a disk block. Each square is a byte. A byte is just a symbol, for example letter "S" is a byte
represented in machine binary codes as "01010011", where those "zeros" and "ones" are bits.
So the letter "S" is a byte, represented with eight bits in binary code.
An invisible symbol "[SPACE]" in binary representation looks like: "00100000".
Another "invisible" symbol "[new line]" (it looks like "\n") is "00001010", and so on...
Below is an exercise book page - just a clean disk block with no data.
When you create a new file and save it on the disk the system creates a symbolic link (file name) and connects it with the address of the block on the disk where the data of the
file are actually stored.
Let's look at the "RAID 0" from the first table in binary representation.
The defaut minimal block size is 512 bytes, the size is defined during setup, and you can specify 512 bytes or 1024 or 4096 bytes.
It depends which files you are going to keep on those disks. If you store big video files, so then you’d better specify a larger
size of the block. For small files — a smaller size of the block would be more optimal.
Compare this with a long text, which takes every square on the page, you do not leave blank spaces on a page and paper is not wasted.
Or a short note on a page taking a couple of lines, and the rest of the page is wasted as a result.
When the operating system writes data on disk it divides the data in blocks, if your data are 1024 bytes long, then exactly two block will be filled.
If your data are, say, 1300 bytes, then two 512 byte blocks will be filled exactly to their size, and the third block will contain the rest 276 bytes.
236 bytes of the block size are actually wasted.
You can finish a chapter by writing only a couple or so lines on a fresh page, but anyway the next chapter of your text you will begin at the next clean page.
Though the previous page is almost clean the system considers it “written”, any new information will not be written on the
clean space of that page, the rest of the block is just “lined up” by zeros, like a big “Z” below your handwritten text.
Yes, it’s a sort of a loss of the disk space.
Let’s assume that the columns of the poems are blocks.
Just imagine that you can write 512 symbols on a page (letters, figures, spaces, commas, periods, etc.),
if you did not fill up the page and have to start a new chapter of your great book, you start it just on a new page,
an leave the previous page clean with a trailing text from the previous chapter at the top.
In the “RAID 5” blocks that unused space is filled in by zeros to gurantee the parity calculations.
Let’s look at the poem stripes below and correct it according to the blocks idea described above.
Audrey:
Donna:
Shelly:
See the m0000000
ountains kiss 00
high Heaven00000
And th0000000000
e waves clasp 00
one another;0000
No sister 000000
flower wo0000000
uld be forgiven0
If it di00000000
sdained its 0000
brother;00000000
And th0000000000
e sunlight 00000
clasps the earth
And 000000000000
the moonbea00000
ms kiss the sea:
What 00000000000
is all this sw00
eet work worth00
If 0000000000000
thou kiss no0000
t me?00000000000
Part Three. "RAID 5".
Audrey:
Donna:
Shelly:
See the m0000000
ountains kiss 00
PARITY_CHECK0000
high Heaven00000
PARITY_CHECK0000
And th0000000000
PARITY_CHECK0000
e waves clasp 00
one another;0000
No sister 000000
flower wo0000000
PARITY_CHECK0000
uld be forgiven0
PARITY_CHECK0000
If it di00000000
PARITY_CHECK0000
sdained its 0000
brother;00000000
And th0000000000
e sunlight 00000
PARITY_CHECK0000
clasps the earth
PARITY_CHECK0000
And 000000000000
PARITY_CHECK0000
the moonbea00000
ms kiss the sea:
What 00000000000
is all this sw00
PARITY_CHECK0000
eet work worth00
PARITY_CHECK0000
If 0000000000000
PARITY_CHECK0000
thou kiss no0000
t me?00000000000
CONTINUING................
The story is far from the finishing, waiting for Mrs. Inspiration... :D