RAID Array (Software)

From SlackWiki
Jump to navigation Jump to search


Raid1 Root

I was looking for a way to install a Slackware 12 as described in README_LVM.TXT but on top of a Software Raid1 array. The installation is really straight forward :

Assuming we have two disk RAID_DSK[0]=/dev/sda and RAID_DSK[1]=/dev/sdb

First partion both disk using the type fd Linux raid auto You need at least two partions as descibed in README_LVM.TXT, a small one that will be mounted on /boot and a big one that will support LVM.

create the raid array :

# boot                                                                                                                              
mdadm -q --create /dev/md0 --level=1 --raid-devices=2 ${RAID_DSK[0]}1 ${RAID_DSK[1]}1
# lvm                                                                                                                               
mdadm -q --create /dev/md1 --level=1 --raid-devices=2 ${RAID_DSK[0]}2 ${RAID_DSK[1]}2

Follow the instruction find in README_LVM.TXT to install LVM, just use /dev/md0 for the boot partition and /dev/md1 for the Physical Volume (PV)

pvcreate /dev/md1 ...

Complete the initrd installation as described in README_LVM.TXT to support LVM, but don't exit the chroot when it's done! You need to apply more modification.

Initrd Raid1

You are still in the chroot ? fine. copy the mdadm utility in /boot/initrd-tree/

cp /sbin/mdadm /boot/initrd-tree/sbin/

save the configuration of your raid array in the initrd-tree

/sbin/mdadm -D --scan > /boot/initrd-tree/etc/mdadm.conf

modify /boot/initrd-tree/init to add the following

# rebuild RAID ARRAY
/sbin/mdadm --assemble --scan 2> /dev/null

Just before

# Initialize LVM:

That it! just rebuild the initrd image without resiting the tree (do not use the -c option!).

Just for info your lilo Global section should look like that :

# Start LILO global section
raid-extra-boot=mbr-only
lba32 # Allow booting past 1024th cylinder with a recent BIOS
boot = /dev/md0
#message = /boot/boot_message.txt
prompt
timeout = 3

restart lilo, exit the chroot, reboot and Enjoy!