Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] raid 5 installation issues
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
nebsager
n00b
n00b


Joined: 20 Dec 2003
Posts: 13
Location: Denmark

PostPosted: Sun May 25, 2008 5:35 am    Post subject: [SOLVED] raid 5 installation issues Reply with quote

Hello all

I have a computer with an Asus A8N SLI premium motherboard. I have a working gentoo on a 500 GB SATA HD, and I have just bought 3 new 500 GB SATA HD which I want to make a raid 5 with (including my old 500 GB HD).

I'm a bit unsure on how to do this. The motherboard has a Nvidia raid controller for 4 SATA disks and a Silicon Image controller for 4 SATA disks, but as far as I have been able to find out, the Nvidia controller does not support raid 5. Should I then go for the Silicon Image controller or keep all controlling in linux?

I've read that the clean linux version should be more flexible - but what does that mean? Flexible in what way? - what will I gain?

I spent a day reading howtos on gentoo-wiki, but I still cannot figure it out. I would prefer keeping my previous installation, but is it much easier to just make a clean install?

Can someone please take me by the hand and show me the way - I think that this raid thing is a jungle, and the howtos may work, but they don't really explain things... :roll:

/Stine


Last edited by nebsager on Tue May 27, 2008 3:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Sun May 25, 2008 9:20 am    Post subject: Reply with quote

There are lots of threads and a wiki post about this.

I would suggest you STAY AWAY from the on-board RAID - It's utter crap - Slow and unreliable - the ONLY reason to use the on-board (fake) RAID is if you need to share the array with Windows.

Linux Software RAID is more reliable, faster (esp. if you have >1 CPU/core, and your disk controllers are on PCIe/HyperTransport and not PCI!), and portable - You can move the array to new hardware and it'll work in Linux.
If you use the A8N's RAID, if the mobo dies, you're screwed unless you can find another A8N (Or another compatible mobo with the exact same RAID chip and firmware version).


With Linux software RAID, try to stick with the nVidia SATA ports - If your A8N SLi is like my A8N32, the Silicon Image chip is on PCI, not PCIe or HyperTransport, and is *really* slow. It won't be able to handle 4 drives at speed.


Now, if you go down the Linux Software RAID route, there are a few caveats, but before you do anything *Back up the whole system!!*

Espescially if you are re-using an existing disk: It is much easier to backup, wipe everything, then do this setup and restore than to do it in-place.

The main caveat is that you _*CANNOT BOOT*_ from a Linux software RAID5 array, only RAID1, and even that requires a bit of trickery.
So if your plan was to have nothing but 4x500GB drives in a RAID5 array, and boot off it, I'd reconsider.

If you have another drive (pref. PATA so it boots first!), it will be much easier to get everything working if you move your system onto that, get it bootable, then use the 4x500GB drives to build the array and put /home (Assuming that's your space hog) on there afterwards.

Now go find those threads and wiki entries! As a brief summary to help you along 'tho, the basic steps (Once you sort out your disks) are:

1) Allocate Array Space:
Quote:
cfdisk <device-to-be-RAID'ed>
-> Make partiton type FD

So, for instance, you'd do "cfdisk /dev/sda", and then make one big partition and configure that to have partition type FD.
You need to do this for each disk that will be in the array.

2) Create Array:
This will vary (Read "man mdadm"!), but for my array the command was:
Quote:
mdadm -C /dev/md0 --verbose -l 5 -n 4 --chunk=64 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

-l 5 (It's an L! Not an I!) mean create RAID Level 5
-n is the # of devices.
--chunk is the RAID stripe size

At this point, the hard disks will got totally bananas, and will continue to do so for some time.
You can check on progress with any of these:
Quote:
cat /proc/mdstat
mdadm -D /dev/md0
hddtemp /dev/hda /dev/hdc /dev/hdd /dev/sda /dev/sdb /dev/sdc /dev/sdd
smartctl -a <device>


NB: It will say there are 3 disks and one is a spare; That is okay, you haven't done anything wrong. Apparently this is because it is faster to do it this way. (I wish they'd tell you that clearly in the docs!)

NB2: You don't have to wait for this to finish before you get to the next step! But it is safer.

3) Create Filesystem on Array:
This is just the same as formatting a partition on a normal disk, with one exception.
Quote:
mke2fs -j -O dir_index -L BigHome -v -b 4096 -E stride=16 /dev/md0

-b is the inode blocksize
-L is the Label/name of the partition
-E stride=16 sets the stride (Whatever that is) to 16. This is fairly important for the array to perform as well as it can, and depends on what -b and --chunk above is set to.
The generally accepted formula is:
Quote:
Optimal stride=stripesize/blocksize

(In this case, 64K/4K=16)

Once this is finished, you're basically done! \o/

4) Tweaks:
Enable/disable write-intent bitmap:
mdadm /dev/mdX -Gb internal
mdadm /dev/mdX -Gb none

This is like a journal for the RAID array - If your system dies, the WHOLE array will get checked and then fsck'd. With the intent-bitmap, it ONLY checks areas that were active, which is a LOT LOT faster.
If you don't crash/are not paranoid enough, leave this disabled as it provides a (small) performance boost.


Improvements for array performance:
blockdev --setra 8192 /dev/md0
blockdev --setra 2048 /dev/sda /dev/sdb /dev/sdc /dev/sdd
echo 8192 > /sys/block/md0/md/stripe_cache_size

The last one in particular will deliver a massive boost to the write-speed of the array, but you can tweak the 8192 to something more appropriate if you want. (I was running "watch cat /sys/block/md0/md/stripe_cache_active" and seeing how high the number got while I was spamming the array. If it maxed out, I doubled the stripe cache until it didn't maxe out anymore ;))
Back to top
View user's profile Send private message
nebsager
n00b
n00b


Joined: 20 Dec 2003
Posts: 13
Location: Denmark

PostPosted: Sun May 25, 2008 10:02 am    Post subject: Reply with quote

Whauv!

Thanks for the long and describing reply!

I gues I should go for a raid 5 on three 500GB HDs and a 500 GB harddisk out of the raid.

thanks again - I'll return for more help if I go into a deadlock :wink:

/Stine
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Sun May 25, 2008 11:06 am    Post subject: Reply with quote

Yeah, it does look like a lot :P

When you get down to it 'tho, it really isn't much! The main work is only like, 3 commands really. The rest is juet prep and being careful! ;)


Word of warning 'tho - I've been told a 3-device RAID5 is slower than it should be; I don't quite understand why it would be significantly slower than a 4-device RAID5, but... *shrug*

Your A8N should have 2 IDE ports 'tho (Something which a lot of mobos don't have nowadays, sadly :( ), so assuming there's space you can put another small (2.5" even! :D) hard disk there for booting.



Also, just to confuse you further :P, my friend has reminded me that you don't need to use the whole of the disks for RAID, so you could have, say:

/dev/sda1 = 50MB?(Some small amount enough to hold the kernel and some backup kernels), ext2, /boot
/dev/sda2 = <RestOfDisk>, ext3/Linux RAID Autodetect, /

on all the disks.

This is neat because you can compile all the bits into the kernel, then the computer will boot off /dev/sda1, load the kernel there, then mount the RAID drive on / and load the rest of the way.

This will be good because you can use all 4 disks and avoid the slow 3xRAID5 issue, but then you are missing 50MB on all 4 disks because the RAID partitions all have to be the same size. The HD companies cheat us out of a lot more than 50MB 'tho (Or 200MB even!), so in the grand scheme of things it isn't that much ;)

You could use the other 50MB blocks to back up the /boot or RAID1 the /boot or something silly I guess :P
Back to top
View user's profile Send private message
nebsager
n00b
n00b


Joined: 20 Dec 2003
Posts: 13
Location: Denmark

PostPosted: Tue May 27, 2008 7:12 am    Post subject: Reply with quote

Ok - now it works :D

I did it like this:

all 4 disks in raid.

50 MB partions in raid1 for boot
2 GB partions for swap (a bit much, but I didn't think about that it would be 4x2GB until it was too late...)
rest of HD space for raid5

For installing I used this guide: http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID and the info posted on this page.

Actually I started with only 3 of the harddisks, because I wanted to try out if I could add another harddisk to the raid easily - I could, but it took a long time. But it was overnight, so it didn't matter. I used this info: http://scotgate.org/?p=107 - notice the grow part - it makes the raid actually use the 4th HD instead of just using it for a spare.


Clever me just made one big partition, så whenever I would like to reinstall I'm in a bit of trouble - cause I don't have space enough anywhere to make backup. But I gues that at that time (years from now!), a 1TB harddisk will be thrown at you at the store :wink:

Thanks again for your help.

/Stine
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Tue May 27, 2008 3:40 pm    Post subject: Reply with quote

Glad it helped! ^_^

Backup is also my big problem at the moment; I can't afford to buy another 4 HDs of that size, and there is no other way you can back up so much data cheaply!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum