SUMMARY: ufsdump and ufsrestore

From: Bruce Shaw <>
Date: Thu Jun 23 2005 - 19:24:00 EDT
> I need a simple script to dump a server mirrored with solstice disksuite
> tape, then demonstrate how to recover it to a new disk.
> I'm dumping using this:
> ufsdump 0uf /dev/rmt/0hn /
> ufsdump 0uf /dev/rmt/0hn /var
> ufsdump 0uf /dev/rmt/0hn /opt
> ufsdump 0uf /dev/rmt/0h /usr
> The tape successfully rewinds at the end.
> Then I tried this script to see what's on the tape:
> ufsrestore tvf /dev/rmt/0hn > /root.txt
> ufsrestore tvsf /dev/rmt/0hn 2 > /var.txt
> ufsrestore tvsf /dev/rmt/0hn 3 > /opt.txt
> ufsrestore tvsf /dev/rmt/0h 4 > /usr.txt
> The script crashed saying:
> # ./
> ioctl MTFSF: I/O error
> Mount volume 2
> then enter volume name (default: /dev/rmt/0hn) ^Cufsrestore interrupted,
> continue? [yn] n
> The root.txt file contains the contents of /var
> so obviously something's wrong.
> I've tried fiddling with mt commands to no effect.  I've also tried
> off the "s" parameter and just trusting the order on the tape.
> What am I doing wrong?

What I'm doing wrong is making things too complicated and using ufsrestore

> ufsrestore tvsf /dev/rmt/0h 4 > /usr.txt

Should read:

ufsrestore tvfs /dev/rmt/0h 4 > /usr.txt

...but that's still too complicated.  I broke it into two scripts.

$ more
echo "rewinding tape"
mt -f /dev/rmt/0 rewind
echo "backing up root"
ufsdump 0uf /dev/rmt/0hn /
echo "backing up var"
ufsdump 0uf /dev/rmt/0hn /var
echo "backing up opt"
ufsdump 0uf /dev/rmt/0hn /opt
echo "backing up usr"
ufsdump 0uf /dev/rmt/0hn /usr
echo "rewinding tape"
mt -f /dev/rmt/0 rewind

$ more
echo "moving tape to beginning"
mt -f /dev/rmt/0 rewind
echo "testing restoring root"
ufsrestore tvf /dev/rmt/0hn > /root.txt
echo "testing restoring var"
ufsrestore tvf /dev/rmt/0hn > /var.txt
echo "testing restoring opt"
ufsrestore tvf /dev/rmt/0hn > /opt.txt
echo "testing restoring usr
ufsrestore tvf /dev/rmt/0hn > /usr.txt
echo "rewinding"
mt -f /dev/rmt/0 rewind

Later on I can get fancy using "mt" with "afs" to position the tape.

Thanks to:

Darren Dunham, Alexandre Wanderley, Rich Kulawiec, Peter Stokes, Ric
Anderson, Kevin Gallagher, John Benjamins, Ray Brownrigg  (I think I got


Sal Serafino, who sent a long explanation (and sample scripts) of some of
the finer points of the two commands


Cesare Tensi, who also pointed out that I could break my mirrors, back up
the detached concat/slices, then reattach and resync.


This communication is intended for the use of the recipient to which it is
addressed, and may contain confidential, personal and or privileged
information. Please contact us immediately if you are not the intended
recipient of this communication, and do not copy, distribute, or take action
relying on it. Any communication received in error, or subsequent reply,
should be deleted or destroyed.
sunmanagers mailing list
Received on Thu Jun 23 19:24:42 2005

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:49 EST