Re: SAN Tape rewind during Boot



To avoid scsi reservation on SAN tape I found this workaround also,
it's a little init script that rename the st.ko and insert it after the
"Initializing hardware..." step :

$ more /etc/init.d/st_module
#!/bin/sh
#
# chkconfig: 35 99 99
#
# description: This is a workaround to prevent tape rewinds\
# by moving tape discovery later in the boot process.
#
BADST="/lib/modules/`uname -r`/kernel/drivers/scsi/st.ko"
ST="/lib/modules/`uname -r`/kernel/drivers/scsi/ST.KO"
INSMOD="/sbin/insmod"
RMMOD="/sbin/rmmod"

start()
{
if [ -f $BADST ]
then
echo "Ouch ! The kernel module ST is
potentially loadable at boot time !"
echo "I decide to move it from $BADST "
echo "to $ST . Now future reboots are safe "
mv $BADST $ST
fi
if [ -f $INSMOD ]
then
if [ -f $ST ]
then
if [ "`lsmod |grep "st "| wc -l`" -gt 0
]; then
echo "Module already loaded"
else
echo "Inserting st module "
$INSMOD $ST
fi
else
echo "UNABLE TO FIND $ST"
fi
else
echo "UNABLE TO FIND $INSMOD"
fi

}

stop()
{
if [ -f $BADST ]
then
echo "Ouch ! The kernel module ST is
potentially loadable at boot time !"
echo "I decide to move it from $BADST "
echo "to $ST . Now next reboot is safe "
mv $BADST $ST
fi
if [ -f $RMMOD ]
then
echo "Removing st module "
$RMMOD st
else
echo "UNABLE TO FIND $RMMOD"
fi

}

status()
{
if [ "`lsmod |grep "st "| wc -l`" -gt 0 ]; then echo "Module st
is currently loaded"; else echo "Module st is NOT currently loaded"; fi
}

case "$1" in
start)
start
;;

stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
;;

esac




After a chkconfig --add st_module all works fine and reboots are safe
.....
Thanks to all

Dan

.



Relevant Pages

  • Re: tape command for solaris 8
    ... >> Well to answer number one, how do you want to write to tape? ... > I do not want the tape to rewind after you write to it. ... # setenv each of these variables if the corresponding filesystem ...
    (comp.unix.solaris)
  • Re: tape command for solaris 8
    ... >> Well to answer number one, how do you want to write to tape? ... > I do not want the tape to rewind after you write to it. ... # setenv each of these variables if the corresponding filesystem ...
    (comp.sys.sun.admin)
  • SUMMARY: ufsdump and ufsrestore
    ... > I need a simple script to dump a server mirrored with solstice disksuite ... > tape, then demonstrate how to recover it to a new disk. ... mt -f /dev/rmt/0 rewind ... echo "backing up root" ...
    (SunManagers)
  • Re: Legato question about tape redundancy
    ... Ok I decided to write a script just to rotate the tapes each ... time a backup runs- incremental or full, it stores the tape volume it ... echo "\nError..looks like a backup is running. ... Exit now.\n" ...
    (comp.unix.solaris)
  • Re: DAT drives
    ... Eventually though i came up with the following backup script and it works ... echo "Starting the backup" ... echo "Rewinding the tape" ... $MT -f $TAPE rewind ...
    (freebsd-questions)