[nSLUG] kernel setup stack overlaps lilo

Dop Ganger nslug at fop.ns.ca
Sat Mar 13 20:19:08 AST 2004

On Sat, 13 Mar 2004 bdavidso at supercity.ns.ca wrote:

> As to RAID: I sympathize, having coerced a couple of Debian Woody systems
> to boot from RAID1 partitions.

It's surprisingly straightforward once you get the hang of it. The way I
do it is do an initial layout like this:

/dev/hda1	swap
/dev/hda2	/boot
/dev/hda3	/

Install a minimal config on / and get things going. Then, create an
extended partition in the remainder of the space and create the partitions
that are going to be your raid partitions (not forgetting to mark raid
partitions as type FD). Reboot, and use sfdisk to replicate your raid
setup on /dev/hdc (I'm assuming RAID1 on IDE as it seems to be the vast
majority of what I do these days - SCSI is usually hardware raid). Use dd
to copy /dev/hda2 and /dev/hda3 to /dev/hdc2 and /dev/hdc3, respectively.
Mount /dev/hdc3 /mnt and edit /mnt/etc/fstab to point to /dev/hdc* instead
of /dev/hda*. Edit /mnt/etc/lilo.conf to repoint /dev/hda to /dev/hdc and
then to lilo -r /mnt. /dev/hda3 and /dev/hdc3 are now your rescue
partitions - no matter what happens you should have a rescue partition on
one of the drives you can boot. Now create your RAID arrays and format
them, and mount them on /mnt; to illustrate you should have something that
looks like:

/dev/md5 /mnt
/dev/md6 /mnt/usr
/dev/md7 /mnt/var
/dev/md8 /mnt/home
/dev/md9 /mnt/tmp

Then run something like:

cd /
( tar -cf - `ls ./ | grep -v ./mnt` ) | ( cd /mnt && tar -xvf - )

This will recreate your filesystem on the raid array. Edit /etc/lilo.conf
to add a boot config for /dev/md5 and run lilo. Reboot, and boot your raid
config. Edit /etc/lilo.conf and add /dev/md5, and mark the /dev/hda3 and
/dev/hdc3 as rescue partitions. Run lilo. Reboot. You system should now
reboot automatically off the raid array. Here's the output of df on one of
my servers to show you what the final result looks like:

Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/md5               4194552     68324   4126228   2% /
/dev/hda2               198639      7893    180490   5% /boot
/dev/md6               4194552    447060   3747492  11% /usr
/dev/md7               4194552    100764   4093788   3% /var
/dev/md8               4194552    148912   4045640   4% /home
/dev/md9               4194552     32840   4161712   1% /tmp

Once you get the hang of this you can get a fully RAIDed system up and
running inside an hour. Once you have a golden image you can image it off
with something like systemimager, and then you can replicate your RAID
image to your heart's delight.

Cheers... Dop.

More information about the nSLUG mailing list