Boot from Raid

leavitt@webcom.com leavitt@webcom.com
Tue, 24 Jun 1997 16:39:39 -0700 (PDT)


> 
> >
> >I'm not sure that this "dd" method would work at all, tho.  How could
> >it be made automatic?  Isn't the bootup going to be whacked  by
> >the out of date vfstab?
> >
> >
> 
> All you need is one good stable image with a correct vfstab. It can
> be relatively static. If one wanted to automate it, one could write
> a wrapper for a program that edits the vfstab to propagate the changes
> over to the other disk (or a daemon that does something similar). 
> In most cases I think a static image would probably be sufficient in
> an emergency. You could be back up and running in a few short minutes
> (depending on fsck/recovery time of your file systems in event of a crash).
> 
> One advantage of a full mirror would be that in the event of a primary
> disk failure, fail-over is automatic. I think I'd be more partial to
> mirroring outside the array though (it's a setup/balance thing for us)
> if I was going to do mirroring.

This is based on the script provided us by a Sun engineer, make
absolutely sure you understand what it does, and what needs to
be changed to reflect your particular configuration, before touching
it. Basically, this just edits the vfstab and cron files appropriately...

I would recommend having a "mirror back" script ready and tested,
so that you can copy the "mirrored" disk back to the regular
boot disk, if necessary (alternatively, you can always mount
the disk to /mnt, if it was trashed by a bonehead maneuver, to
recover data or fix whatever was screwed up.

Regards,
Thomas Leavitt

#!/bin/sh
#
#
# Script for mirroring two disks through a cron job.
#
#
 
echo "Now performing a disk to disk copy of diskbrd to diskbrd1"
begin_date=`date`
echo ""

dd if=/dev/rdsk/c0t10d0s2 of=/dev/rdsk/c0t11d0s2 bs=51927b

sync /dev/rdsk/c0t10d0s0
fsck -y -F ufs /dev/rdsk/c0t11d0s0
fsck -y -F ufs /dev/rdsk/c0t11d0s0

echo "Disk transfer complete, will now edit the vfstab file"
echo ""

mount /dev/dsk/c0t11d0s0 /mnt
sed s/t10/t11/g /mnt/etc/vfstab > /mnt/etc/newvfstab
mv /mnt/etc/newvfstab /mnt/etc/vfstab

echo "Now removing copybootdisk cron job from disk1"
echo ""
sed 's/^.*copybootdisk.*$/#/g' /mnt/var/spool/cron/crontabs/root > /mnt/var/spoo
l/cron/crontabs/newroot
mv /mnt/var/spool/cron/crontabs/newroot /mnt/var/spool/cron/crontabs/root

umount /mnt

end_date='date'
echo "Begin: ${begin_date}"
echo "Finish: ${end_date}"
> 
> --
> ____________________________________________________________________________
> Doug Hughes					Engineering Network Services
> System/Net Admin  				Auburn University
> 			doug@eng.auburn.edu
> 
> 
> 


-- 
WebCom (sm)                        Thomas Leavitt--leavitt@webcom.com
Voice: (408) 457-9671 x101         Executive Vice President
 
WebCom Home Page <URL:http://www.webcom.com/>