[Sunhelp] sunos 4.1.3

Dennis L. Lund dllund at hermes.nextel.com
Tue Aug 8 12:36:46 CDT 2000


This gets a bit touchy in the explanation.

If you only dump / tape, you will see file that are directly under /.

You will see all directories and there file that are directly under / as well.

If the director is a mount point for another filesystem, all you will see is
the directory that is directly under /.  When you cd to this directory you
will not see any of the files because the are actually no the mounted filesystem.

This script will dump /, /usr, /var, and /opt to a single tape without rewinding
after each filesystem.

#!/bin/csh
#
# Complete dump

setenv TAPE /dev/nrst4	# set TAPE variable to /dev/nrst4 (norewind st4)

mt -f /dev/nrst4 rew	# Rewind the tape to start at the beginning of the tape.

date			# Print the date to stdout

# Start Backup
echo ===============		# just for looks
echo Backing up `hostname`	# tell me the system name being dumped
dump 0ubf 126 /dev/nrst4 /	# dump / to tape
dump 0ubf 126 /dev/nrst4 /usr	# dump /usr to tape
dump 0ubf 126 /dev/nrst4 /var	# dump /var to tape
dump 0ubf 126 /dev/nrst4 /opt	# dump /opt to tape
echo Finished Backup		# tell me when done
echo ===============		# just for looks

mt -f /dev/nrst4 offline	# rewind when done and eject the tape

This script will dump / to tape, then dump /usr to the same tape without rewinding it,
then /var and last /opt.  All this is done without rewinding.

The last statement mt -f /dev/nrst4 offline is when the tape rewind and eject comes.

To access files and directories in /:
	restore -if /dev/nrst4
This will let you restore any thing that is directly under /.

To restore files under /usr:
	mt -f /dev/nrst4 asf 1
This rewinds the tape and then fast forwards past the first EOF.  You can now
restore any file/directories under /usr.


To restore files under /usr:
	mt -f /dev/nrst4 asf 2
This rewinds the tape and then fast forwards past the first EOF.  You can now
restore any file/directories under /var.

To restore files under /usr:
	mt -f /dev/nrst4 asf 3
This rewinds the tape and then fast forwards past the first EOF.  You can now
restore any file/directories under /opt.

Thats it.  Read man pages on mt and dump.

Dennis L. Lund
e-mail: dllund at hermes.nextel.com





More information about the SunHELP mailing list