Yes. Raid1 consists of writing the same data to each member of the raid set.

Real hardware raid is only useful where that is a lot of parity data to calculate.
That occurs in raid5 and raid6 when there is a lot of IO to the raid.
For most users with multi core CPUs, mdadm raid is more than adequate._________________Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

My server is a Thinkpad RD440 and looks like is doesn't want to boot off disks directly, but needs to go through the Megaraid controller (otherwise it won't show up in the boot options) and I NEED to create an array for a boot option to appear.

So through the LSI configuration utility I created a RAID 1 array consisting of the first 2 disks (sda, sdb).

When I boot off the Gentoo installation CD, the RAID is detected I believe (I didn't realize earlier) as I get 2 devices /dev/md126 and /dev/md127:

I assume the Live CD mdadm recognizes the array created by the LSI Megaraid controller and assembles it automatically.

How would I go about partitioning the disks and installing file systems knowing I would need to keep the LSI created array as otherwise the system won't boot? I would have preferred mdadm RAID as per the advice but seems I need the fake hardware RAID in order to boot. For this system that is not critical (using fake hardware RAID and the drawbacks) as I plan to install the OS on the first 2 disks only, other data will land on other disks utilizing unraid or similar.

As the disk are always two disk and not really one, it cause problem to grub and people that try to mirror it and goes into complex hack.

What's the point of doing that?
Use your fakeraid and create a smaller size array (something you already did to handle two swap, as mirroring swap would be a bit too much).
Why not create a lower swap1 and build your /boot in it.
You'll endup with a simple scheme: same array size, swap1 a bit smaller, /boot on one disk, grub on one disk, swap2 same size.

And your booting gets easy: grub on disk1 or 2, looking for (/boot) a kernel on disk1 or 2... and only when kernel get the hand it will assemble your array and mount then your root.
Leaving the "fake raid is not one disk" problem down to where kernel is able to assemble it.

What's bad with it?
Your /boot is not mirror and failure of the disk holding it mean unable to boot, is it really a big problem?
Do really even if mirror and hack... your array will work with one dead disk anyway? (i know how hw raid handle this, but i have really doubt about fakeraid or softraid reliability on this, no, i don't doubt you could add another disk and it will redo the mirroring with it, but i doubt it will just works with only one, leaving you need another way to boot to run the recovery process.
/boot is not as critical as one may think, you can redo your kernel as long as /usr/src/linux is alive, and the grub configuration shouldn't scare any gentoo user. Making in real mirroring /boot only for real lazy user ; for special bad case (if you hold /boot in disk1, mirroring /boot will prevent only disk1 failure, if disk2 fail, mirror or not, /boot is safe in disk1).

ps: note that the livecd have mdadm because fakeraid is in real softraid, but it doesn't mean mdadm is handling the fakeraid part assembly, that is done by another tool with a similar name i can't remember, so don't assume mdadm handle your LSI, it might be that other tools that properly assemble the array because the livecd have it.
I think (i don't know, i'm not a fan of it), the wiki should have a page for fakeraid explaining everything for you and with the real name of the tool to use fakeraid.

On this particular machine I'm okay to use fake raid provided by the LSI Megaraid controller only, I will only install the OS on those 2 disks. It seems this machine MUST have an array created by the LSI Megaraid controller to boot to.

However, this creates a single array of the complete disks (and shows up like that in the live CD environment as /dev/md126 and /dev/md127).

Should I just only consider /dev/sda and leave /dev/sdb alone (assuming the fake raid will replicate everything I do on /dev/sda to /dev/sdb)?

However, I would still need to be able to partition the disk(s) in order to create boot and swap partitions. Will that not mess with the array created by the LSI Megaraid controller?

Krinn, what's the point of using fakeraid? It takes everything bad from software raid (CPU load, drivers, etc) and from RAID (if your controler dies, so does your data; you can't use partition as a raid member)
And no, installing grub on mirrored raid is not hard. At least it's not harder than installing on sda1 pointing it to sda1 as the partition with kernel, and then installing it on sdb1 pointing it to sda1 as the partition with kernel too. You jsut have to use old metadata format to avoid moving filesystem away. Grub doesn't write anything during boot. It just reads kernel, stuffs it into RAM and gives it control. At this point kernel assembles raid, just like it would with fake raid. Except that with softraid you can attach those drives to another mobo and it will not complain.
Well, technicaly your system on fakeraid wouldn't complain either. The dead don't talk after all.

Talking about running it with a single disk: considering I have installed my gentoo on RAID1 using 1 drive as installation medium and the other as a target raid's member in team with missing device, I can say it does boot with a single drive missing. I haven't tried pulling plugs with my system running though. Who knows, with write-intent bitmap enabled I might give it a shot. It is said to support it. Any idea how to test recovery after failure without trashing my system?

Yarug, when you have hardware raid it is presented to your system as a single disk. You can do anything you would with a single drive. Partitioning means nothing more than storing a header that bios can understand at the begining of storage space. Think of it as a file, it makes things easier A file doesn't have moving parts, firmware and other crap you don't care for. It only has content, and partitions are a part of this content.
So... Yeah, you can use fake raid. But then, you would know if you needed that. In any doubt, go for softraid.

I MUST use the LSI Controller and I MUST create at least 1 array, otherwise I cannot boot from disk. The array shows in the boot options after creating it.

I created the array using the LSI Controller, however the Live CD still sees /dev/sda and /dev/sdb as separate disks. I do have /dev/md126 and /dev/md127 which seems to be the same array as the LSI Controller judging by the disks that are in there and the label (Container GUID : 4C534920:20202020:80861D60:00000000:42428ED6:4242A2FA (LSI 03/24/15 09:56:3

I probably need some driver as mentioned earlier for Gentoo / Live CD to see the array created by the LSI Controller as 1 device?

Oh, well, if your hardware forces you to use fakeraid then you know you need it
You typically configure such a raid in bios. And talking about drivers... You might want to have a closer look at menuconfig just before kernel compilation. I see there are some options for various raids. Good place to start with. Unfortunately can't help you much with this.

No big deal as their smart status are in real directly handle by the card, but some limits exists (and many other, like ncq that is handle by the card and i cannot enable/disable it like you could, again no big deal the card menu offer that).

Alas (and this is not really a fakeraid limit), many raid controller cannot use disk in non raid usage, so as a "stupid" controller, and as such can only expose array but not disks to the system.
Some controller (intel) offer option to turn on/off the raid feature, allowing it to handle disk instead of arrays.
If you lack ports on your m/b to handle your disk and must use the ones from the LSI: no choice than running them in an array, and fakeraid so.
Did you check your controller have a feature to turn on/off raid service? (with luck).

Don't get too obsess by the one drive: your array will be seen as one drive and an entry will be there for it, and you will have an entry for each drive (that is really the only problem, as you can directly access one disk in the array and damage the array as a result).
And in hardware raid, yes the array is seen as one disk, yes an entry is made for it, and the only difference is that there no entry for the disks in the array, but it doesn't mean the disks are unseen by the system.
You can see them there: https://forums.gentoo.org/viewtopic-t-1007788.html

Stop!
Take a deep breath at this point and type "shell". And have a look around. `ls -lh /dev` is a good start.
Kernel doesn't detect root partition. 2 common reasons are:
1) init is missing / not recognized
2) drive controler kernel module is missing - should be statically compiled in (or at least stuffed into initramfs)

Check what devices it detects. Mount them to /newroot and check the contents. Or mount errors.
Perhaps you could use lspci -k inside initramfs.

A hint on checking what raid modules you have in hand:
grep -i raid /usr/src/linux/.config

genkernel --menuconfig --no-clean all will open a nice UI you can use to get missing stuff. Or compile it in, statically rather than as a module. I suppose LiveCD doesn't need that raid.
You might also try --all-ramdisk-modules option, but I didn't have much luck with it.