Installation:Software Raid

From Lunar Linux
Revision as of 08:50, 11 November 2005 by 82.92.14.157 (Talk)
Jump to: navigation, search

Contents


Software raid is a relatively powerful way of achieving better performance and/or reliability (redundancy). There is no automated way of setting this up in lunar yet but it's fairly easy to do manually.

Getting started

First setup your box with the number of hard disks you need and boot the ISO. As soon as you boot into the installer and have selected language and locale stuff, switch to vc/2 and start with the manual part of the software raid setup

Partitioning

The easiest way to setup partitioning if you're working with partition raid-components is to partition one disc and copy the contents to another using cfdisk and sfdisk:

cfdisk /dev/hda

Setup your partitions and make sure you have some space left over for later to resize and move stuff if needed. Make sure you set your partition type as linux-raid-autodetect (0xfd). Otherwise you won't be able to boot from the partitions.

cd /tmp
sfdisk -d /dev/hda > dump
sfdisk -i /dev/hdb < dump

This formats the second disc identically to the first one, especially usefull for RAID-1 setups

Setting up your RAID devices

go to /tmp and create a new raidtab file:

raiddev         /dev/md0
raid-level      1
nr-raid-disks   2
nr-spare-disks  0
persistent-superblock 1
chunk-size      32
device          /dev/hda1
raid-disk       0
device          /dev/hdb1
raid-disk       1

Now, since this is sitting on tmpfs you will lose your data if you reboot so be careful. The next step is to initiate the raid device so that it's actively mirroring them (or striping depending on your setup).

mkraid --really-force --config-file /tmp/raidtab /dev/md0

The raid driver will start syncing the discs and you can check progress with:

cat /proc/mdstat

Formatting the filesystem

From now on, you'll refer to your disks as /dev/md0 instead of hda1 etc. So the same goes with formatting. You can format and work with the disks even when syncing is in progress:

mkfs.ext3 /dev/md0

It might be a bit slower due to the syncing going on. I advice you to have the unit finish syncing before you reboot, if only to make sure there's no bad sectors on the units and all is OK for normal work.

Saving your config raidtab

You should of course save your raidtab file and most likely you will want to save it as /etc/raidtab on the raid-device itself. You'll need to mount it therefore:

mount /dev/hda1 /mnt
mkdir /mnt/etc
cp /tmp/raidtab /mnt/etc/raidtab
umount /mnt

Now you're ready to install lunar in the normal way!

Installing on RAID

The last step is to let the normal installer code handle the partitions. For this reason, the installer allows you to pass an arbitrary block device name as an additional hard disk partition. In the partition selection, you select 'Add...' device and enter '/dev/md0'. Make sure you don't format the partition and select the right filesystem. Alternatively, you could have skipped to formatting and let the lunar ISO installer handle it as well.

BootLoader

As maybe known, only lilo can directly boot from software raid but with tricks grub can read the underlaying partition on only one of the raid devices, which will obviously not work with striping raid setups. Make sure you pass the proper device names to the lilo.conf. Your mileage may vary.

Personal tools
Namespaces
Variants
Actions
Wiki Navigation
Project Sites
Toolbox