The Solaris group is a forum where peers share technical expertise, solve problems, and discuss issues related to the Solaris operating system, including OS-related malfunctions, security issues, and network performance.

(if=/dev/rdsk/device-name ---- Represents the overlap slice of the master disk
device, usually slice 2.
of=/dev/rdsk/device-name ---- Represents the overlap slice of the clone disk
device, usually slice 2.
bs=blocksize ---- Block size, such as 128 Kbytes or 256 Kbytes. A large block
size value will decrease the time to copy.)

Just a comment. If you are backing up entire file systems, the best tool
that Solaris has for doing this is the ufsdump and ufsrestore commands. The
only inconvenient of the ufsdump and ufsrestore commands is that is not
compatible with other UNIX platforms. If you are planning to backup raw
devices "dd" is your best shot. To decide what command/tool works best for
you, you need to identify your company's needs: availability, raw vs.
cooked, performance, compatibility, reliability, dificulty, backup strategy
such as full dump images or incremental backups, etc.

# where /dev/rmt/0 is the tape device and /dev/rdsk/c0t3d0s0 is the disk
partition - and in this example probably the root partition/disk.

Sample script : Level 0 dump using the ufsdump script - not the use of the mt
command to position the tape.
This script save and then mails tape backup status logs - this is handy to
insure documentation and that the
tape backup job completed satisfactorily. A script is nice because you can add
a crontab entry and automate the backup job to, say, run every whenever at some
designated time - like every day at midnight etc. but you might want to
establish a scheme where you ran a level zero backup once a week and level 1's
everyday etc.

In the first example above I used the raw device and in the script below the
partition names are used - you could also use the raw devices in the script as
well.

Use the mt command to position your tape - recommend reading the mt man page
there are a
lot of mag tape manipulations you can do with mt.
example:
#Position the tape to the end.
mt -f /dev/rmt/0cn eom

restores:

Listing C: Manual file-recovery steps

#Create a temporary directory.
mkdir /tmp/lostfiles

#Change to that directory.
cd /tmp/lostfiles

#Position the tape to the end.
mt -f /dev/rmt/0n eom # note the use of n in /dev/rmt/0n
(/dev/rmt/(yourdevice)n - n means no rewind
and is very important in this
step.
#Backup to the /partition2 volume.
mt -f /dev/rmt/0n nbsf 2

#Invoke ufsrestore interactively.
ufsrestore -if /dev/rmt/<your tape device>n # the n in /dev/rmt/<your tape
device>n may or may not
# keep
the tape from rewinding in this step -
#Use the commands ls, cd, add, (these are builtin comands in ufsrestore - like
unix commands)
#and extract ( literally type extract or x after adding the desired files or
directories ) at the interactive #ufsrestore prompt to locate and add files or
directories to be extracted. The recovered directories and
#files will reside in /tmp/lostfiles.

Note that your $TAPE variable needs to be set to the non-rewinding tape
device in the script e.g. /dev/rmt/0n. You don't say this explicitly. Not
using this would cause all dumps to overwrite the previous one.

Also for completeness you should use $TAPE in the mt commands e.g.
mt -f $TAPE rewind

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.