> From: Douglas J Hunley
 > anyone got decent pointers on setting up and configuring raid using 
 > disksuite on solaris? thanks!

it's not exactly doc, but here's my recipe for
cooking solaris7 software raid1 partitions with
disksuite... and a little perl script that you can
use under cron so you know when disks die.  use
at your own risk.

steve
- - - 
systems & network guy
high energy physics
university of wisconsin

Solaris7 + DiskSuite 4.2 Disk Mirroring Cookbook

#==================================================================
# Install and Initialize DiskSuite

 #----------------------------------------
 # install disksuite...

 # mount Easy Access Server 2.0 CD
 cd /cdrom/cdrom0/products/DiskSuite_4.2/sparc
 pkgadd -d `pwd` # install SUNWmd (1) and SUNWmdn (3)
 # add /usr/opt/SUNWmd/bin:/usr/opt/SUNWmd/sbin to PATH in /etc/profile

 #----------------------------------------
 # steal space from swap to make one tiny 
 # partition on each disk for the state db...  
 # this assumes that swap is slice 3... 
 # if not, adjust these instructions accordingly...

 shutdown -g0 -i0 -y

 boot -s   # at the ok prompt

 swap -l   # note the swap slice

 swap -d /dev/dsk/<slice>

 swap -l

 format    # shrink slice 3 by about 8-10 cyclinders and and 
           # use the resulting cyclinders to create slice 4 
           # (doc sez the databases are under 1 meg)

 format    # format the secondary disk

 prtvtoc /dev/rdsk/<slice>   # verify the new slice


 #----------------------------------------
 # make two state databases on each s4 partition....

 metadb -a -f -c 2 c0t0d0s4 c0t1d0s4
 

 #----------------------------------------
 # check state databases...

 metadb   # should print four lines of info about c0t0d0s4 c0t1d0s4


#==================================================================
# Create Mirrored Boot/Root Filesystem (on c0t0d0s0 and c0t1d0s0)

 # slash on slice 0...
 PARTITION=c0t0d0s0; PARTITION_MIRROR=c0t1d0s0
 DEST=d0; SRC1=d1; SRC2=d2;
 metainit -f $SRC1 1 1 $PARTITION
 metainit $SRC2 1 1 $PARTITION_MIRROR
 metainit $DEST -m $SRC1
 metaroot $DEST
 lockfs -fa

 reboot 

 # df should show /dev/md/dsk/d0 mounted on /

 metattach $DEST $SRC2

 
#==================================================================
# Create Mirrored Partition From a Unmountable Filesystem

 # slice 6...
 PARTITION=c0t0d0s6; PARTITION_MIRROR=c0t1d0s6
 DEST=d10; SRC1=d11; SRC2=d12;   # increment these by ten for each fs

 metainit -f $SRC1 1 1 $PARTITION
 metainit $SRC2 1 1 $PARTITION_MIRROR
 metainit $DEST -m $SRC1

 reboot

 metattach $DEST $SRC2

 # tell system about new filesystem...
 vi /etc/vfstab
   # for ordinary filesystems...
   /dev/md/dsk/d10 /dev/md/rdsk/d10 /somesuch ufs 1 yes -
   # for swap...
   /dev/md/dsk/d10 - - swap - no -
 fsck -n /somesuch # reality check for ordinary filesystems
 reboot
 swap -l  # reality check for mirrored swap

#!/usr/bin/perl
#
# solaris-md-monitor - send email when /var/adm/messages indicates 
# some Solaris DiskSuite MD/RAID filesystem(s) broke today 
#
# the kernel sends syslog msgs like so when MD devices are broken:
#
#  Nov  5 19:08:44 sassafras unix: WARNING: md: d10: \
#    /dev/md/dsk/d11 needs maintenance
#  Nov 22 07:14:11 sassafras unix: WARNING: md: d12: \
#    write error on /dev/dsk/c0t1d0s6
#

$hostname = "hep.wisc.edu";
$send_email_to = "rader\@hep.wisc.edu";
$subject_line = "WARNING: $hostname has broken MD/RAID disk";

$syslog = "/var/adm/messages";
$mail = "/bin/mailx";

if ( $ARGV[0] eq '-d' ) { $debug = 1; }

$now_str = scalar localtime(time());
$cur_day_str = substr($now_str,4,6);
if ( $debug ) { print "TODAY IS: $cur_day_str\n"; }

open(IN,"<$syslog");
while(<IN>) {
  if ( $_ !~ /^$cur_day_str/ ) { next; }
  if ( $debug ) { print "TODAY MATCH: $_"; }
  if ( $_ =~ /unix: WARNING: md:/ ) { 
    if ( $debug ) { print "PROBLEM MATCH: $_\n"; }
    $msgs .= $_;
  }
}
close(IN);

if ( $msgs ) {
 open(OUT,"|$mail -s \"$subject_line\" $send_email_to");
 print OUT $msgs;
 close(OUT);
}

exit;

_______________________________________________
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc -> http://www.linux-sxs.org/mailman/listinfo/linux-users

Reply via email to