LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RAID Questions (https://www.linuxquestions.org/questions/linux-newbie-8/raid-questions-904806/)

spwnt 09-24-2011 12:01 PM

RAID Questions
 
I'm looking to setup up a RAID 5 for my home samba server. It's likely going to have to be software since I don't think that my computer supports hardware based raid... but I have a few questions..

1.) With software based RAID does your motherboard need to support it or can any computer do software based RAID?

2.) If I do software/hardware based RAID and I reformat my computer or put the drives in a new computer or switch between Linux and Windows etc can it still be accessed... or once it's built can you not do any of that? My main question here is can I set up the RAID and run it in Linux but then boot into Windows and still access the RAID? Like once the programs are in stalled is it automatically recognised?

3.) How will software RAID effect my resources? My CPU, RAM etc... my computer has an i7 and 4 gb of RAM, but it's also my main desktop.

4.) Can I set up RAID with a generic PCI based 4 port SATA card or does it have to be specifically built into the motherboard?

5.) Do all of the drives need to be identical? (I know that they need to be the same size or you're just wasting space) But what about firmware of the drives, brand etc.

6.) Can you expand the size of the raid at a later date? Add more drives to increase the space without having to recreate the RAID.

7.) Can you break down the RAID without losing all of your data? Say I want to not have it as a RAID anymore can I, without having to move all of the files to another place, break down the RAID to their initial drives, not in RAID, and keep all of the data?

I do have another computer that I could try to install it on, and could access and maintain it remotely, but I'd really rather not... it's a pretty old computer.. Dell 512 megs of ram and a 2.1 ghz processor... plus I feel like the benefit of using raid would be wasted if it was put in an old computer... it wouldn't gain all of the benefit from all the drives working together I wouldn't think.

smallpond 09-24-2011 12:32 PM

Quote:

Originally Posted by spwnt (Post 4481148)
I'm looking to setup up a RAID 5 for my home samba server. It's likely going to have to be software since I don't think that my computer supports hardware based raid... but I have a few questions..

1.) With software based RAID does your motherboard need to support it or can any computer do software based RAID?

Any computer supports software RAID. In fact, you should not mix software RAID and hardware RAID.

Quote:

2.) If I do software/hardware based RAID and I reformat my computer or put the drives in a new computer or switch between Linux and Windows etc can it still be accessed... or once it's built can you not do any of that? My main question here is can I set up the RAID and run it in Linux but then boot into Windows and still access the RAID? Like once the programs are in stalled is it automatically recognised?
This will work with hardware RAID, but not software RAID since Windows and Linux will do the software RAID striping and metadata differently.
Quote:

3.) How will software RAID effect my resources? My CPU, RAM etc... my computer has an i7 and 4 gb of RAM, but it's also my main desktop.
RAID 5 reads are faster than a single drive with little overhead. Writes have a small performance penalty due to parity calculation.
Quote:

4.) Can I set up RAID with a generic PCI based 4 port SATA card or does it have to be specifically built into the motherboard?
SATA card is fine. If you are booting from this, make sure your computer can boot from the SATA card. You may also want to use a small RAID 1 boot partition with a copy on each drive which makes booting easier in a degraded state.
Quote:


5.) Do all of the drives need to be identical? (I know that they need to be the same size or you're just wasting space) But what about firmware of the drives, brand etc.
Nope.
Quote:


6.) Can you expand the size of the raid at a later date? Add more drives to increase the space without having to recreate the RAID.
If it is possible I wouldn't do it.
Quote:


7.) Can you break down the RAID without losing all of your data? Say I want to not have it as a RAID anymore can I, without having to move all of the files to another place, break down the RAID to their initial drives, not in RAID, and keep all of the data?
Nope. The data is interleaved across the drives.
Quote:


I do have another computer that I could try to install it on, and could access and maintain it remotely, but I'd really rather not... it's a pretty old computer.. Dell 512 megs of ram and a 2.1 ghz processor... plus I feel like the benefit of using raid would be wasted if it was put in an old computer... it wouldn't gain all of the benefit from all the drives working together I wouldn't think.
But a good idea to test out the process.

spwnt 09-24-2011 01:07 PM

thanks very much for all of the answers, and okay I won't mix Windows and Linux, but say I set up a Debian server and have the software RAID running on it and for some reason I break something and have to reinstall the server can I make it so that the newly installed Debian server can recognize the already created RAID array? The RAID array isn't going to be / or anything fundamental like that.. it's just going to be for storing stuff for my samba server.


and another question I have is that as I understand it with parity and redundancy the drivers and being written to and read from even when you aren't directly accessing them in order to make sure that everything is working properly and to create paritry etc, so what are the chances that a power outage would just destroy everything completely if I am not currently reading or writing to it? and for that matter even if i was reading and writing to it when a power outage hit could it corrupt everything? Like how common is complete corruption or a RAID array? And under what circumstances could that happen?

thanks for all your help!
Quote:

But a good idea to test out the process.
very true :P

smallpond 09-24-2011 01:28 PM

Quote:

Originally Posted by spwnt (Post 4481208)
thanks very much for all of the answers, and okay I won't mix Windows and Linux, but say I set up a Debian server and have the software RAID running on it and for some reason I break something and have to reinstall the server can I make it so that the newly installed Debian server can recognize the already created RAID array? The RAID array isn't going to be / or anything fundamental like that.. it's just going to be for storing stuff for my samba server.

Install or upgrade of even a different Linux distro is fine. They will recognize the RAID config information on the disks since they all use the same md driver for software RAID.
Quote:


and another question I have is that as I understand it with parity and redundancy the drivers and being written to and read from even when you aren't directly accessing them in order to make sure that everything is working properly and to create paritry etc, so what are the chances that a power outage would just destroy everything completely if I am not currently reading or writing to it? and for that matter even if i was reading and writing to it when a power outage hit could it corrupt everything? Like how common is complete corruption or a RAID array? And under what circumstances could that happen?
The only writes going on in the background will be flushing block cache out to disk or rebuilding the RAID if you replace a drive. In either case, once it completes a power outage won't hurt you.

Powering off even a non-RAID drive will corrupt data. Journalling filesystems like ext3 are pretty good at limiting the damage to just the files currently being written. The filesystems as a whole will still be intact.

spwnt 09-24-2011 01:44 PM

and if a drive fails is it pretty seemless/easy to swap in a new one?

smallpond 09-24-2011 04:09 PM

Quote:

Originally Posted by spwnt (Post 4481250)
and if a drive fails is it pretty seemless/easy to swap in a new one?

Not really seamless. cat /proc/mdstat for status. Check messages for errors. Sometimes errors on one drive can seem to affect other drives. Swapping the wrong drive can be irrecoverable.

The basic steps are:
1) Figure out which one is the failed drive. Blink the select light on drives to make sure.
2) Use mdadm to remove it from the RAID.
3) Power down and replace the drive. Or hot plug if you're set up for that.
4) Copy the partition table to the new drive.
5) Use mdadm to add it to the RAID.
6) Let rebuild run with minimal other activity.

spwnt 09-24-2011 05:47 PM

can you have multiple raids running simultaneously on the same drives?

let's say I have 4 disks and they are all 1 terabyte

could i do like raid 5 950 gb on all of them and then raid 0 or 1 the remaining space? or even raid 5 that remaining space for /?

so I'd have /media/samba raid 5 950 gb and then raid 5 / at the remaining 50.

hypothetical situation ofcourse... but if that's possible that expands what i could do by quite a bit.

spwnt 09-24-2011 09:52 PM

also if i choose to use a hardware raid controller then would I be able to use the raid on windows and linux? if so can you give me a few examples of some raid controllers that are supported by both os's? i'm looking for one with atleast 6 sata ports and it has to be in a decent price range... sub 300 dollars way lower would be preferable. I'm not going to be running a hardcore server. I just need something that works.

smallpond 09-25-2011 10:17 AM

Quote:

Originally Posted by spwnt (Post 4481377)
can you have multiple raids running simultaneously on the same drives?

let's say I have 4 disks and they are all 1 terabyte

could i do like raid 5 950 gb on all of them and then raid 0 or 1 the remaining space? or even raid 5 that remaining space for /?

so I'd have /media/samba raid 5 950 gb and then raid 5 / at the remaining 50.

hypothetical situation ofcourse... but if that's possible that expands what i could do by quite a bit.

yes - md is on partitions. it's quite flexible

smallpond 09-25-2011 10:32 AM

Quote:

Originally Posted by spwnt (Post 4481483)
also if i choose to use a hardware raid controller then would I be able to use the raid on windows and linux? if so can you give me a few examples of some raid controllers that are supported by both os's? i'm looking for one with atleast 6 sata ports and it has to be in a decent price range... sub 300 dollars way lower would be preferable. I'm not going to be running a hardcore server. I just need something that works.

I'm not real familiar with the PCI/PCIe RAID cards, so post a new question if nobody else chimes in here. Everything is supported on Windows, so look for Linux support. The things that affect cost are how much on-board memory, how fast is the on-board processor and how many SAS/SATA ports it has. Some have battery backup so they can do fast write completion. Also some "hardware" RAID cards provide multiple ports but do some or all of the work in the driver, so they are really software RAID. I'm not sure how to tell whether the Linux and Windows RAID configs would be compatible unless the vendors surprise me and provide useful info for a change.


All times are GMT -5. The time now is 08:57 PM.