Operating System - HP-UX
1834796 Members
2943 Online
110070 Solutions
New Discussion

Re: How to read LIF info from tape

 
SOLVED
Go to solution
Rich Wright
Trusted Contributor

How to read LIF info from tape

I have done this before but have lost my notes.
I'm sure there is a way to lifcp from the Ignite tape and see the version and date of the tape.
Can someone provide the exact command(s) to read this information from an Ignite tape that is in the default system (4mm) tape drive?
8 REPLIES 8
Rich Wright
Trusted Contributor

Re: How to read LIF info from tape

Got It!
# dd if=/dev/rmt/0mn of=liffile bs=2k
28697+1 records in
28697+1 records out

# lifls -l liffile
volume ISL10 data size 281239 directory size 3 02/10/04 03:08:22
filename type start size implement created
===============================================================
ISL -12800 16 306 0 02/10/04 03:08:22
AUTO -12289 328 1 0 02/10/04 03:08:22
INDEX BIN 336 1 0 02/10/04 03:08:22
CONFIG BIN 344 155 0 02/10/04 03:08:22
HPUX -12928 504 848 0 02/10/04 03:08:22
FWWKAR6 BIN 1352 1 0 02/10/04 03:08:23
FWWKAR7 BIN 1360 1 0 02/10/04 03:08:23
FWWKAR8 BIN 1368 1 0 02/10/04 03:08:23
INSTALL -12290 1376 36432 0 02/10/04 03:08:28
INSTALLFS -12290 37808 35840 0 02/10/04 03:08:30
VINSTALLFS -12290 37808 35840 0 02/10/04 03:08:30
WINSTALLFS -12290 37808 35840 0 02/10/04 03:08:30
VINSTALL -12290 73648 43062 0 02/10/04 03:08:34
WINSTALL -12290 116712 45869 0 02/10/04 03:08:41
INSTCMDS BIN 162584 12611 0 02/10/04 03:08:42
SYSCMDS BIN 175200 54331 0 02/10/04 03:08:49
SCRIPTS BIN 229536 42 0 02/10/04 03:08:49
#

This should be enough to tell me that I have a good Ignite tape.
Tim D Fulford
Honored Contributor

Re: How to read LIF info from tape

award yourself the full 10pts.

I was about to write

# dd if=/dev/rmt/0m bs=2048 count=2048 of=/tmp/lif

# lifls /tmp/lif...
-
John Dvorchak
Honored Contributor
Solution

Re: How to read LIF info from tape

A friend of mine wrote this little script to find the creation date:

#!/usr/bin/ksh
######################################################################
#
# Determine when an Ignite tape was created
#
# Author: Tony Contratto
# Date: 07/18/2002
#
# Usage: $0 [tape device]
# [tape device] defaults to /dev/rmt/0mnb
#
######################################################################

# set a path
PATH=/usr/bin:/sbin:/usr/sbin
export PATH

# Define vars
SCRIPT_NAME=$(basename $0)
TAPE=/dev/rmt/0mnb
TMP_TAPELIF=/tmp/${SCRIPT_NAME}.tapelif.$$
TMP_LIFLS=/tmp/${SCRIPT_NAME}.lifls.$$

# check if they want a different tape device
if [[ -n "$1" ]]; then
TAPE=$1
fi

# echo what tape device we are using
echo "\nUsing tape in device: ${TAPE}\n"

# check that the tape device is really a character special file
if [[ ! -c $TAPE ]]; then
echo "\"${TAPE}\" does not exist or is not a character special file!"
exit 1
fi

# rewind the tape
mt -t $TAPE rew

if [ $? != 0 ];then
echo "Rewind of tape in device $TAPE failed!"
exit 1
fi

# dd off the lif area of the tape
dd if=$TAPE of=$TMP_TAPELIF bs=2048 count=10 > /dev/null 2>&1

if [ $? != 0 ];then
echo "Could not read lif area of tape in device $TAPE"
exit 1
fi

# list the contents of the lif area
lifls -l $TMP_TAPELIF > $TMP_LIFLS

if [ $? != 0 ];then
echo "Could not read contents of lif area!"
exit 1
fi

# munch up the lif area contents to get the date and time
awk ' BEGIN {
# create an array with the month names
months = "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"
monSize = split(months, month, ",")
}
/^HPUX/ {
# get the date and time out of the line
tapedate = $6
tapetime = $7

# split the date into an array so we can reformat it
sizeOfArray = split(tapedate, date, "/")

# force numeric type of the month
date[2] += 0

# if the year is less than 70 first part of year is 20
# else the first part is 19
century = ( ( date[1] + 0 ) < 70 ) ? "20" : "19"

# create the output line
out= "Ignite tape created at " tapetime " on "
out = out month[date[2]] " " date[3] ", " century date[1] "\n"

# print it
print out
}' $TMP_LIFLS

#cleanup
mt -t $TAPE rew
rm $TMP_TAPELIF
rm $TMP_LIFLS
If it has wheels or a skirt, you can't afford it.
Darrell Allen
Honored Contributor

Re: How to read LIF info from tape

Hi,

Ignite has a copy_boot_tape utility that you can use to read the boot image from the tape. I use:
copy_boot_tape -u /dev/rmt/0mn -d /var/tmp -b
This copies the boot image from the tape to /var/tmp/bootimage and displays the files it contains. It takes about 60MB of space in /var/tmp on my 11.0 systems.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Rich Wright
Trusted Contributor

Re: How to read LIF info from tape

Now I know that I have a good tape.
...But the Ignite still fails with SCSI device timeout./Boot device is not a LIF volume.
This is a new build system.
I noticed that the 4mm drive has scsi id zero. Is this allowed?
I would suspect a bad drive, except that I can read/write while the system is up.
Tim D Fulford
Honored Contributor

Re: How to read LIF info from tape

I noticed you have VINSTALL & WINSTALL..

V install is for V calss & will not work on other systems

W install is the Wide (64bit) install.

So
o Are you restoring to 32 bit, if so sorry it will not work
o If not you might want to manually do "hpux WINSTALL" from the ISL prompt

Tim
-
Rich Wright
Trusted Contributor

Re: How to read LIF info from tape

Tape was created on a V class and I am attempting to Ignite another V class.
Rich Wright
Trusted Contributor

Re: How to read LIF info from tape