Has someone a good tutorial for setting up a software raid 1 in CentOS 4.2 64bit?
Thanks a lot![]()
Has someone a good tutorial for setting up a software raid 1 in CentOS 4.2 64bit?
Thanks a lot![]()
What software is good for creating a RAID? That is usually hardware and needs no setup, except in the BIOS of the machine. Hardware is definitely the way to go.
Last edited by lloyd_tennison; 02-05-2006 at 06:35 PM.
Lloyd F Tennison
There is already RAID software in CentOS (/etc/raidtab).
Search the web for some tutorials. A good one (with other useful server admin guides) is:
http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html
Jonathan Michaelson
Need your cPanel servers secured and tuned?
cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
http://www.configserver.com
Software Raid is a great thing - running / software raid on all of our servers without any problems and hassles that come associated with Hardware raid rebuilds and cards that die etc.
I use a live cd to do installs but setting up RAID 1 is a pretty simple task - I use mdadm
The setup on redhat/centos is much the same as any other distro,
Basically this is what you need to do with a new install, using cd
Partition the disk as you would like, make sure to partition each disk the same. Select linux software raid as the file system type. Do this for every partition that you want tobe in raid1.
Then, select create raid device, select the level, raid 1, then select the 2 partitions that you created earlier, eg.
/dev/sda1, /dev/sdc1
/dev/sda2, /dev/sdc2
Then, go through each RAID device that has been created and enter the mount point and select the file system type,eg /boot , ext3 bootable. Do this for each partition - Its really straight forward and there are tons of tips on google if you get stuck.
If you have a live cd, then I usually create the partitions, create the raid devices and install debian into it using debootstrap
Bit like so,
Partition /dev/sda, make all partitons type fd (linux raid , autodetect.
Then dump the partition table
# sfdisk -d /dev/sda > sda.sf
Edit the file sda.sf and change, sda to sdb, wherever it occurs.
The use that to create the partitions on the second disk
# sfdisk /dev/sdb < sda.sf
Right, now to create the raid devices and format the disks
# mdadm --create --level=1 --raid-devices=2 --spare-devices=0 /dev/md0 /dev/sda1 /dev/sdc1
Change /dev/md0 and the sdax sdcx as needed, for each partition, so you end up something like this
/dev/md0 - /dev/sda1 /dev/sdc1 - mount point /boot
/dev/md1 - /dev/sda2 /dev/sdc2 - mount point /
/dev/md2 - /dev/sda3 /dev/sdc3 - mount point /var
and so on
Once the raid devices are created, just format them
# mke2fs -j /dev/md0
# mke2fs -j /dev/md1
# mke2fs -j /dev/md2
# mkswap /dev/mdx (whichever you choose for swap, if you include that in the raid.
To view the created raids,
# mdadm --detail --scan
# mdadm --detail --scan > mdadm.conf
If you want to create a mdadm.conf
# cat /proc/mdstat
Will tell you how the raid devices are doing.
Then you can mount them,
# mkdir /target
# mount /dev/md1 /target
# mkdir /target/boot
# mount /dev/md0 /target/boot
and so on...
Installing debian couldn't be easier from there, but then this is the cpanel forums and we won't go into that one.
I would also advise using/compiling a kernel that has compiled in raid 1 support, rather than using a module and initrd...
Software raid rocks!
Last edited by DigitalN; 02-07-2006 at 04:02 AM.