Saturday, March 17, 2007

How to Perform an Interactive Restore with ufsrestore

I had to retrieve a configuration file from an archive of the /var/local directory. I assumed records were archived with the “-n” option, i.e. /dev/rmt/0hn. This example is a bit oversimplied, but you should get the gist. Here are the steps for an interactive restore. But first, I will need to move to the appropriate record on the tape.

#cd /var/tmp
#mt –f /dev/rmt/0 rewind
#mt -f /dev/rmt/0 fsf 3 (4th record)
#ufsrestore ivf /dev/rmt/0
ufsrestore>ls
local
ufsrestore>cd local
ufsrestore>ls
ircd
ufsrestore>cd ircd
ufsrestore>ls
conf
ufsrestore>cd conf
ufsrestore>ls
ircd.conf
ufsrestore>add ircd.conf
ufsrestore>ls
*ircd.conf (* asterisk marks for extraction)
ufsrestore>extract
specify next volume #: 1
set owner/mode for '.'? [yn] n
ufsrestore>quit

#mt -f /dev/rmt/0 offline (rewinds and ejects tape)
#cp -p /var/tmp/ircd.conf /var/local/ircd/conf/ircd.conf
#chown irc:irc /var/local/ircd/conf/ircd.conf
#rm /var/tmp/ircd.conf

1 comment:

cnurbw said...

Thank you for the clear and concise instructions.
Bill