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

Re: Woody root on RAID and 2.4.17

Hi John,

You came up trumps.  Your pointers got me running woody with root
on software RAID.  Thanks!

STOP PRESS:  I've now got woody with root fs on LVM on software RAID-1.
The ultimate server weapon...  Watch this space.

I'd like to write all this up in an informal HOWTO which I'll put up on my
site.  I would like to give you credit for your RAID-lilo pointers.  Would
you like me to put up your email address in the credits or not?  If you'd
like me to include any other details, please forward them.

I did it differently to how you suggest, in a way that leaves lilo.conf,
fstab, /boot and the MBR on the single disk we start from completely
untouched and may even be a bit easier to do.  The key is editing the
lilo.conf copied to the RAID only, and  doing

chroot [target] /sbin/lilo

to install an MBR to a disk other than the one with the initial
single-disk install.

Starting with an initial install to a single disk, it goes a bit like

/dev/md[boot]:  RAID-1       array for /boot fs
/dev/md[root]:  RAID-[1|4|5] array for root fs
                        (I've only tried RAID-1 but I'm confident
                        RAID-4 and -5 will work too).
/dev/[h|s]d[raid-mbr]:  Disk to whose MBR we will install lilo for
                        the RAID system; must not be the disk to which
                        we make the initial single-disk install.

- We install to a single disk.  It makes things simpler if this disk
is partitioned the same way as the others will be.  Set the BIOS to boot from
this disk and install.

- Obtain or compile a RAID kernel and reboot with it.

- Install raidtools-2.

- If you're going to be using 2.4.x with devfs, install devfsd.

- Write an /etc/raidtab with the partitions on the disk we've just
installed to marked as "failed-disk".  Make sure these entries are not the
first ones in each array.

- Create the RAID arrays:

      raidstart /dev/md[number]

- Make filesystems on them:

      mk[e2fs|reiserfs] /dev/md[number]

- Mount the RAID array which will be used as the root fs under /mnt
      mount /dev/md[root] /mnt

- Copy the root filesystem to it:
      tar cplf - -C / . | tar xvpf - -C /mnt -

- Mount the other raid arrays under /mnt: /mnt/boot, /mnt/usr etc.
Instead of issuing all those "mount" commands, you might as well put these
mounts in /etc/fstab and do:

      mount -a

In that way, they get mounted automatically in case you need to
reboot into the single-disk system and work on them.

 - Copy the other filesystems to the
corresponding arrays:

      tar cplf - -C / [boot|tmp|usr|other] | tar xvpf - -C /mnt

- Edit /mnt/etc/lilo.conf and include:

      --- begin relevant lilo.conf excerpt ---

      # The disk we will install the RAID MBR to.
      # We should leave the MBR on the initial install
      # disk alone until we've successfully booted from RAID,
      # so choose another disk.

            # We will use the BIOS to switch this disk to the
            # first BIOS id when we want to boot from it.

      # The RAID-1 array for the /boot filesystem

            # Write the RAID MBR to the above disk only

      # Root filesystem device

      --- end relevant lilo.conf excerpt ---

- Install lilo to the disk we've chosen to hold the RAID MBR:
      chroot /mnt /sbin/lilo

- Edit /mnt/etc/fstab to mount the RAID filesystems instead of the
single-disk ones.

- Reboot, go into setup and change the BIOS settings to boot from the disk
we've installed the RAID MBR to.

- Boot into the RAID system.  If something goes wrong, use the BIOS
setup to get the system to boot the disk with the initial installation and
fix it.

- Once booted into the raid system, edit lilo.conf and change it so the
MBR is installed to all disks in the array.  More details later when I've
verified I can use the BIOS setup to boot from any one of the disks.

- Edit /etc/raidtab and change the "failed-disk" entries to "raid-disk".
Add the partitions on the disk with the single-disk installation to the
arrays with raidhotadd.

- Run lilo and reboot to check that you can now boot from any of the

- Celebrate appropriately.

Thanks again and best regards,

|      George Karaolides       8, Costakis Pantelides St.,         |
|      tel:   +357 99 68 08 86                  Strovolos,         |
|      email: george@karaolides.com       Nicosia CY 2057,         |
|      web:   www.karaolides.com      Republic  of Cyprus          |

Reply to: