I don't know your detail CPU and motherboard spec and etc. so I assume that you have 4GB of RAM.
1. Run LiveCD LinuxMint12
2. Install mdadm through apt-get, aptitude, Software Manager, Synaptic etc.
3. Partitioning: [we have /dev/sda, /dev/sdb, /dev/sdc - all disks we're partitioning the same way]
Use GParted because you know that program. DON'T FORMAT YOUR PARTITIONS !!! CHOOSE ALWAYS UNFORMATTED !!! CHOOSE ALL AS A PRIMARY PARTITIONS !
Example: /dev/sda
Make partition table: GPT
/dev/sda1 -> 1MiB for bios_grub - let the GParted align this from start with 1MiB[default] - that's needed for GPT and MDADM, and for good alignment - enable bios_grub flag on
/dev/sda2 -> 200MiB for /boot - enable boot flag ON
/dev/sda3 -> we're choosing here to leave 4097MiB[RAM size + 1MiB] - If you have different size of RAM adjust this but add 1MiB to this value - that 1MiB is needed for GPT backup partition table on the end of the disk
/dev/sda4 -> choose 4096MiB or your RAM size - 1GB=1024MiB
Once again don't format partitions!, leave that 2x1MiB as a free disk size.
Repeat above identically for all 3 disks!
[added 02.02.2012]
/dev/sda1, /dev/sdb1, /dev/sdc1 -> we are leaving this for bios_grub - needed for GRUB2
/dev/sda2, /dev/sdb2, /dev/sdc2 -> /dev/md0 -> RAID1 -> /boot partition -> 200MiB[GParted is proposing in front to leave 1MiB - that's correct and do not change it]
/dev/sda3, /dev/sdb3, /dev/sdc3 -> /dev/md1 -> RAID5 -> / partition -> rest of the disk minus RAM size minus 1MiB [1GB of RAM = 1024MiB !!][for 2GB RAM you're leaving 2049MiB]
/dev/sda4, /dev/sdb4, /dev/sdc4 -> /dev/md2 -> RAID1 -> swap partition -> RAM size[for 2GB partition size is 2048MiB]
After that, you have 1MiB space on front and 1MiB on end of the disks. Front space for GPT, mdadm metadata and some MBR compatibility, end space for GPT backup partition table.
[/added 02.02.2012]
4. Open terminal
Create RAID1 for /boot
Code: Select all
mdadm --create /dev/md0 --level=1 --raid-devices=3 /dev/sd[abc]2
Create RAID5 for root partition /
Code: Select all
mdadm --create /dev/md1 --level=5 --raid-devices=3 --chunk=256 /dev/sd[abc]3
Create RAID1 for swap partition
Code: Select all
mdadm --create /dev/md2 --level=1 --raid-devices=3 /dev/sd[abc]4
Array's are creating - we can go forward.
5. Format RAID partitions - that's needed for Mint installer.
Code: Select all
sudo su
mke2fs -t ext4 /dev/md0
mke2fs -t ext4 -E stride=64,stripe-width=128 /dev/md1
mkswap /dev/md2
6. Start LinuxMint12 installation from desktop
Choose hand partitioning and point to - choose NOT to format /dev/md0 and /dev/md1:
/dev/md0 /boot ext4
/dev/md1 / ext4
/dev/md2 swap
Let the install go till the end, and on last question choose to NOT reboot yet !!
Beware - you will have an error about cannot installing grub-install - on this point choose OK, and after last installer question choose NOT to reboot.
[added 27.01.2012]
WARNING !!!
There is a bug in the Linux Mint 12 installer - when you receive an error that installer cannot install bootloader to the disks choose OK,
and on the next window called "Bootloader install failed" the OK button isn't active!
Do move forward you have to:
a) click first position "Choose a different device to install the bootloader on:"
b) open the list with disks and choose something, for example /dev/sda
OK button is now active!
c) click "Continue without a bootloader"
d) click OK
WARNING !!!
[/added 27.01.2012]
7. Adjust new installation:
Start Terminal:
Code: Select all
sudo su
mount --bind /dev /target/dev
mount --bind /dev/pts /target/dev/pts
mount --bind /proc /target/proc
mount --bind /sys /target/sys
mount --bind /tmp /target/tmp
chroot /target
Install MDADM on new installed OS:
Code: Select all
apt-get install mdadm
cd /etc/mdadm
nano mdadm.conf -> delete / from array names so they should look like /dev/md0 and /dev/md1 and /dev/md2
Run command below and on last question choose to allow RUN from degraded array.
Updating new settings
Code: Select all
update-initramfs -uv
update-grub
grub-install /dev/sda
grub-install /dev/sdb
grub-install /dev/sdc
Leaving chroot
Code: Select all
exit
umount /target/dev
umount /target/dev/pts
umount /target/proc
umount /target/sys
umount /target/tmp
8. Waiting for RAID to sync:
You can speed this up a little bit with:
Code: Select all
echo 200000 >/proc/sys/dev/raid/speed_limit_min
But this is effective only if the MDADM is reducing speed intentionally.
You can run this in any time.
9. After all REBOOT
10. Learn from uncle Google how to properly maintain RAID with MDADM - you should read all from
http://manpages.ubuntu.com/manpages/one ... adm.8.html
Few basic rules:
1) You can take out one disk for test only when the RAID is fully synchronized ! Then you put it back and YOU MUST wait to synchronize. If you take out second disk when the RAID is not in sync your RAID5 die.
2) If your disk die for real, you have to first --fail that disk, then --remove with MDADM commands. Then you put in new disk and use --add command. If you for mistake remove wrong disk your RAID5 die.
3) RAID5 can only live with 1 disk failed. Replace failed one as soon as possible, because if in that time second disk will fail you loose all of your data!
4) Last and most important: RAID IS NOT A BACKUP FEATURE. It not protects you from fire, water etc. and MOSTLY user mistakes.