Re: RAID0 Set-up?
On Monday 11 September 2006 19:35, Gary Catalano wrote:
> Anyone have experience setting up RAID on Debian Testing etch-3 (or
> something similar?) I'm having a bear of a time.
I did it, but you have to do a few things which are not straight forward.
This is approximately how I did it assuming two partitions on each disk, the
first a 32M /boot partition, the rest all raid (I actually had a raid root
partition of 4G and the rest of the disk as a raided lvm2 volume)
If you already have a running system on one of the disks that you will
ultimately be in the raid setup you have to add a few more steps. You should
be able to work out from below exactly what they are
You need to get your raid arrays up and running using mdadm, something like
the following, which creates a partial array
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hdb1 missing
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/hdb2 missing
or similar. Repeat for all raid devices you need
mount /dev/md1 /target
mount /dev/md0 /target/boot
then you need to add the output from
mdadm --examine --scan
into /etc/mdadm/mdadm.conf
then look at /etc/default/mdadm and set the parameters in there. In
particular define if you need the raid arrays setup in initrd, so that you
can have a raid array as root.
now you need to update the initramfs to include the raid startup
update-initramfs
also edit /boot/grub/menu.lst to specify /dev/md1 as the root device
now we will need to copy the existing root to raid
mkfs -t ext2 /dev/md0
mkfs -t whatever-u-want /dev/md1
mkdir /target
mount /target /dev/md1
mkdir /target/boot
mount /target/boot /dev/md0
rsync -axHq / /target
rysnc -axHq /boot /target/boot
now edit /target/etc/fstab to adjust mount points for the new raid arrays
Now install grub in the boot sectors of both hard drives
This bit I am not 100% certain of - I think it goes like this
grub-install /dev/hda
grub install --root-directory=/target /dev/hdb
Now reboot - but select /dev/md1 as your root device - you can do that from
the grub menu but not chosing the selections from the list but selecting e
finally you need to start using /dev/hda in your raid array
first use fdisk or cfdisk to set the partition types of /dev/hda1
and /dev/hda2 to raid. (type fd)
then
mdadm --add /dev/md0 /dev/hda1
mdamd --add /dev/md1 /dev/hda2
(note I think you may have to confirm that you are not making a mistake in the
above two steps)
I then repeat the
mdadm --examine --scan
update-initramfs
replacing the array definitions in there with the new ones and then updating
the initrd with them - although I think there ought to be no difference.
--
Alan Chandler
http://www.chandlerfamily.org.uk
Reply to:
- References:
- RAID0 Set-up?
- From: "Gary Catalano" <gcatalano@crypticstudios.com>