[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RAID 1 setup on woody

On Fri, Feb 22, 2002 at 10:32:17AM -0800, Richard Weil wrote:
> I need some help setting up RAID 1 on a fresh Woody
> install. The software is newer than the docs,
> particularly for Lilo, so any help from those with
> experience would be most appreicated.

The Software-RAID-HOWTO got me through this one.

> My hda and hdc drives are identical in size. hda is
> divided into multiple partitions -- / (/dev/hda2),
> /boot (/dev/hda1), /home (/dev/hda5), /usr
> (/dev/hda6), /var (/dev/hda7). There is nothing on hdc
> yet.

Step 1:  Partition hdc just like hda.  You should probably set your
partitions to type FD on both drives if you haven't done so already.

> If anyone has a similar setup already working, I'd
> love to see their /etc/raidtab

Just lots of sections that look like:

raiddev /dev/md0
        raid-level              1
        nr-raid-disks           2
        nr-spare-disks          0
        persistent-superblock   1
        chunk-size              4
        device                  /dev/hdg1
        raid-disk               0
        device                  /dev/hde1
        raid-disk               1

> and lilo.conf files

Pretty bog-standard, aside from the lines:


> with a brief description of how to get it working
> without deleting anything on hda (i.e., reformating
> the drive).

1.  Partition both drives identically.  Make sure that no partitions
on hdc (except for swap - swap can stripe itself, so don't RAID it)
are larger than the corresponding partitions on hda.

2.  Install on hda.

3.  Create your /etc/raidtab with an md device for each non-swap
partition on hda/hdc.  For now, set up the last 4 lines of each md
device like so:

        device                  /dev/hdcX
        raid-disk               0
        device                  /dev/hdaX
        failed-disk             1

Note that the partition on hdc is listed first and the partition on
hda is listed as a failed-disk instead of a raid-disk.

4.  Start your RAID devices with raidstart.  They will all be
degraded (due to the "failed" partitions on hda), but that's what you
want at this point.  Format the md devices with, e.g., "mke2fs

5.  In single-user mode, copy each partition from hda to the
corresponding md device.  After copying the root partition over, edit
the copy of etc/fstab on the RAID (i.e., /mnt/etc/fstab) to reference
the appropriate md devices instead of the partitions on hda.

6.  Edit lilo.conf, changing the boot and root devices to /dev/md0
and re-run lilo.

7.  Reboot.  When the system comes back up, use mount to check
whether your system is mounted from hda or the RAID devices.  It
should now be on RAID.

8.  Change your partition types on hda to FD if you haven't already
done so, change all the failed-disk directives in /etc/raidtab to
raid-disk, and add the partitions from hda using raidhotadd.

And you're done.  Easy as that.

> -  Can I create a single RAID device (md0) that
> mirrors all of the hda/c, or do I need to create
> separate RAID devices for each partition(md0, md1,
> ...,md4)?

I'm not entirely sure whether it's possible to create an uber-RAID
and partition it using the md driver, but separate md devices works

> -  Assuming I need one for each partition, what are
> people's thoughts on skipping / and /boot RAID? This
> is the most intimidating part from reading the docs,
> but it would seem to lessen the value of RAID
> considerably.

There's no reason that / and /boot can't be RAIDed also.  If you put
them on RAID, you'll have to reboot to complete the transition, but
that's no big deal.

> -  Is the Boot+Root+RAID Howto still accurate,
> particularly for Lilo?

Never read it.  Like I said, the Software-RAID-HOWTO seems to be

> There's now a RAID boot option in Lilo which I'm not
> sure how it would effect things like boot= and root=.

Not familiar with this option, but I've used the procedure above
several times (I've got 3 or 4 systems running all-RAID) and it works
fine with potato's lilo.  I can't imagine that woody's would have a
problem with it.

When we reduce our own liberties to stop terrorism, the terrorists
have already won. - reverius

Innocence is no protection when governments go bad. - Tom Swiss

Reply to: