Instructor: Let's go over the RAID,
what exactly a RAID is.
A RAID stands for redundant array of independent disks,
or sometimes often referred to as inexpensive disk.
And RAID, why do we need RAID?
Well, to create a redundancy,
meaning if one disk dies, you have another disk, right?
You don't wanna lose your data
if one of your primary disk dies,
so that's the primary reason we have RAID,
and there are different type of RAIDs.
The main ones that we will cover in this lesson
are three RAIDs, RAID0, 1, and 5.
And how do they work?
Let's go over them.
In RAID0, you have one disk that is, let's say, five gig.
You add another disk.
That becomes 10 gig.
So you put them together,
and that five plus five becomes 10 gig, right?
Perfect, so you are writing
to both disk one here, one there.
It's going across.
It's faster, of course,
but what happens if you lose one disk?
Well, you're out of luck.
Why?
Because you have lost all your data.
So most of the time, RAID0 is used for data warehousing
or backups that you're rarely gonna use,
so things like that.
So you do need to add a couple of disks,
physical disks together to make one big disk.
That's how RAID0 is mostly used.
Let's talk about RAID1.
That will eliminate that disadvantage of RAID0,
where we lose one disk and then you're out of luck.
In RAID1, you have one disk, and then you have another disk,
but you mirror them together,
meaning if you have five gig of space on one,
you have to have five gig on another one,
but that does not mean you're gonna have 10 gig together,
because you're not adding them together.
You're mirroring them together.
So if you lose one disk, that's fine.
You still get your data from the other disk.
But there is another disadvantages to RAID1,
and that is slow.
It is slow because it has to replicate everything
from one disk to another,
so that sometimes gets a slow read and slow writes.
Then to solve all these problems, 0 and 1,
what do we do then?
0 has, we have a risk to lose data.
RAID1, we have slow read and write,
so we come up with RAID5.
In RAID5, you have one disk, right?
Then you have another disk,
but this time, you don't just add to it.
You actually copy everything to the second one as well,
but in RAID5, you have to have three or more disks.
Why?
Because the way RAID5 works
is it will write to the first disk
and it will put some information about that data
to the second disk.
It will write to the second disk,
and it will put some of that information that it has written
to the third disk,
and it goes around like a round robin like that.
So in case you lose one disk,
it doesn't matter if it's a first, second, or third.
You will have the information of the lost data
on one of the disks that you still have.
That's how you create RAID5.
But in this case,
you're not gonna have five, five, five, 15,
because you have to write some of the disk information
that's parity to some other disk as well.
So this way, you could retrieve that information.
So in order to put that information somewhere,
it needs to reserve that space for it,
and that's why we get out of it like 12 or 13 gig of space.
So that's how RAID works,
and the reason I am covering RAID in this training
is because that's one of the very basic questions
often being asked during interviews.
And as a system administrator,
when you do become a system administrator
in Linux environment,
you will have to create RAID at a hardware level.
When you have a server coming in
to your corporate environment,
you would have to configure a RAID.
And the difference between,
the primary difference between RAID and LVM
is that RAID is mostly configured on the physical system,
physical servers, sorry, physical disks,
whereas LVM is mostly configured
on a virtual or logical disks.
So that's a primary difference, so please remember it.
If you wanna learn more about other RAIDs,
I would encourage you to go online
and find out about other RAIDs.