Putting ROOT on RAID for AC1

Dave Mason dmason at sarg.ryerson.ca
Sun Oct 30 14:14:18 UTC 2005


I installed AC1 (in late June), but I wanted to get as much as possible
on RAID and LVM.  What I ended up with is:
   Filesystem               1K-blocks      Used Available Use% Mounted on
   /dev/md2                   9621816   6565816   2567228  72% /
   /dev/hda1                   101114     16573     79321  18% /boot
   none                        383048         0    383048   0% /dev/shm
   /dev/mapper/raid-home     25803068   8129008  16363340  34% /home
   /dev/mapper/raid-software 15481840    129276  14566132   1% /software

I couldn't get /boot on RAID1, despite quite a lot of trying.  Also, the
installation didn't let me put / on RAID1, so I had to do quite a lot of
messing around.  In particular I had to make my own initrd.  Here's a diff
from the original.  Note that this is a bit non-standard.  That's
because what was documented to work didn't...

; diff orig-init initrd/init 
12a13
> mknod /dev/md2 b 9 2
27c28
< raidautorun /dev/md4
---
> /sbin/mdadm -A /dev/md2 --auto --run /dev/hdd2

There were a few other things that had to be done, so here is the
update-init that I wrote that creates a new initrd from the original
after fixing up a few things:
--------
#! /bin/sh
mkdir -p /root/initrd
cd /root/initrd
rm -rf *
zcat </boot/initrd-2.6.11-1.1180axp_FC3.img |cpio -i
cp /sbin/mdadm sbin
(cd /lib;tar cf - ld-linux.so.2 ld-2.3.4.so libc[-.]* # libm[.-]* librt[.-]* libpthread[-.]* libdl[-.]* libtermcap.so.2*
)|(cd lib;tar xf -)
cat >init <<EOF
#!/bin/nash

mount -t proc /proc /proc
setquiet
echo Mounted /proc filesystem
echo Mounting sysfs
mount -t sysfs none /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs none /dev
mknod /dev/console c 5 1
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/md2 b 9 2
mkdir /dev/pts
mkdir /dev/shm
echo Starting udev
/sbin/udevstart
echo -n "/sbin/hotplug" > /proc/sys/kernel/hotplug
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko 
echo "Loading raid1.ko module"
insmod /lib/raid1.ko 
echo "Loading jbd.ko module"
insmod /lib/jbd.ko 
echo "Loading ext3.ko module"
insmod /lib/ext3.ko 
/sbin/udevstart
/sbin/mdadm -A /dev/md2 --auto --run /dev/hdd2
echo Creating root device
mkrootdev /dev/root
umount /sys
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root /sysroot
mount -t tmpfs --bind /dev /sysroot/dev
echo Switching to new root
switchroot /sysroot
umount /initrd/dev
EOF
find *| cpio -c -o | gzip -9 >/boot/initrd-2.6.11-1.1180axp_FC3.md2
--------

My fdisk /dev/hda looks like:
Detected an OSF/1 disklabel on /dev/hda, entering disklabel mode.
4 partitions:
#       start       end      size     fstype   [fsize bsize   cpg]
  a:        2        14        13       ext2                      
  b:       15      1231      1217       ext2                      
  c:        1      9733      9733     unused        0     0       
  d:     1232      9733      8502         fd                      

I really should have given you this a long time ago, because I no longer
remember all the things that I tried and what didn't work.  I *can* say
that it was a frustrating couple of days.  I'd be happy to try to answer
any questions, though.

../Dave




More information about the axp-list mailing list