SUMMARY: ufsdump with the "a" option

From: Chris Hoogendyk <choogend_at_library.umass.edu>
Date: Fri Mar 08 2002 - 10:05:22 EST
Thank you all:
   Kevin Korb
   Brevan Broun
   Ray Brownrigg
   Jay Lessert
   Bobby Ramirez
   Jay Chembakassery
   Rick Kulawiec
   Karl Vogel

my original message is at the end.

There were several good answers and extra points varied from answer to answer.

(1) the "a" and the "f" option are positional. if you put "a" before
"f", then the archive file name comes before the dump file name; & vice
versa. so, e.g.:

    ufsdump 0cafu filelist-t1f1 /dev/rmt/0 /dev/dsk/c0t0d0s6 \
     > Images-07Mar2002-t1f1 2>&1

where the "a" refers to "filelist-t1f1", and "f" refers to "/dev/rmt/0"

(2) if I'm doing a full archive separately from a regular backup
rotation, don't use the "u" option, as that will update the
/etc/dumpdates and mess up the incrementals for the regular rotation.

(3) can get some mileage out of using the /dev/rmt/0n (no rewind), as
opposed to the /dev/rmt/0 (same tape drive, but rewind after operation).

(4) another choice was to skip the "a" option and use 

    ufrestore tvf /dev/rmt/0 > indexfilename

    after the ufsdump.


(5) the "a" option generates a catalog file that is readable by
ufsrestore and is not ASCII readable. then 'ufsrestore ta catfilename'
will read the catalog and output an ASCII table of contents that can be
redirected. so this is really a choice of whether you are comfortable
with using ufrestore to look at a catalog file, or whether you want an
ASCII readable table of contents for documentation.

a couple of people elaborated with useful script sequences of file dumps
and even pipes through sed to pull out the particular pieces to put into
your own database of files that were backed up. I copied some of these
at the end.

Thank you, Thank you, Thank you ... (one nice thing about the
sunmanagers list is all the time zones that that span my evening and
night time hours ;,)


---------------

Chris Hoogendyk

-- 
   O__  ---- Network Specialist & Unix Systems Administrator
  c/ /'_ --- Library Information Systems & Technology Services
 (*) \(*) -- W.E.B. Du Bois Library
~~~~~~~~~~ - University of Massachusetts, Amherst

<choogend@library.umass.edu>

---------------




-------- Message Segment --------
From: Karl Vogel <vogelke@dnaco.net>
Organization: Sumaria Systems Inc.

  <snip>

C> Can anyone tell me how to use the "a" option?

   Yup.  You create the table of contents on disk when dumping the given
   filesystem (/usr, for example) to tape:

     ufsdump 3cbufa 96 /dev/rmt/0cn /backup/tocfile /usr

   Then you read this toc file using ufsrestore:

     ufsrestore tbf 96 /backup/tocfile | cut -f2 |
         sed "s,^.,/usr,g" | sed 's,^//,/,g' >> /path/to/contents
     rm /backup/tocfile

   At this point, /path/to/contents is a list of files on the tape.
   When all your dumps are done, you could put the resulting list in a
   locate-type database if you want:

     tr 'A-Z' 'a-z' < /path/to/contents |
        sort 2> /tmp/errs$$ |
        /path/to/your/frcode > /backups/locatedb
     rm /path/to/contents

   Then look for a given file by doing

     locate -d /backups/locatedb '/given/file'

-- 
Karl Vogel               ASC/YCOA, Wright-Patterson AFB, OH 45433
vogelke_at_dnaco.net                   http://www.dnaco.net/~vogelke

Look, Ma, 4299 accidents waiting to happen:
% find pine4.21 -type f | xargs egrep '(sprintf|strcpy|strcat)' | wc -l
    4299




-------- Message Segment --------
From: Rich Kulawiec <rsk@magpage.com>

   <snip>

> Can anyone tell me how to use the "a" option?

Ah.  Try this:

ufsdump 0cafu /tmp/blah.catalog /dev/rmt/0 /

/tmp/blah.catalog will now contain a (non-ASCII-readable) version
of the same table-of-contents that ufsdump has written at the beginning
of the file that it has placed on /dev/rmt/0.  You can display
that table of contents with ufsrestore:

	ufsrestore ta /tmp/blah.catalog

> do I have to use "mt" to position the tape and re-read it to get the
> table of contents?

Nope.  *Before* dump/ufsdump had the "a" flag, yeah, that's exactly
what we used to do; back in my SunOS days I had a script that fired off
something along the lines of:

	dump 0sdbf 13000 54000 126 /dev/nrst0  /
	dump 0sdbf 13000 54000 126 /dev/nrst0  /var
	dump 0sdbf 13000 54000 126 /dev/nrst0  /usr
	mt -f /dev/rst0 rewind
	restore tf /dev/nrst0 > /tmp/root.list
	mf -f /dev/nrst0 fsf 1
	restore tf /dev/nrst0 > /tmp/var.list
	mf -f /dev/nrst0 fsf 1
	restore tf /dev/nrst0 > /tmp/usr.list
	mt -f /dev/rst0 rewoffl

in order to put, say, three dump images on a tape, rewind it, then
use restore to produce a catalog of each dump image, then rewind
and eject the tape.  All that can now be placed with the much
simpler (and faster):

	ufsdump 0cafu /dev/rmt/0n /tmp/root.list /
	ufsdump 0cafu /dev/rmt/0n /tmp/var.list /var
	ufsdump 0cafu /dev/rmt/0n /tmp/usr.list /usr
	mt -f /dev/rmt/0 rewoffl
	restore ta /tmp/root.list > /tmp/root.ascii.text
	restore ta /tmp/var.list > /tmp/var.ascii.text
	restore ta /tmp/usr.list > /tmp/usr.ascii.text

Salt to taste, and you should have what you need.  (Biggest thing
to be careful of: use rewind/no-rewind device in the right places.
A construct like

	ufsdump 0cafu /dev/rmt/0 /tmp/root.list /
	ufsdump 0cafu /dev/rmt/0 /tmp/var.list /var

will not yield a tape with two ufsdump images on it.  It will yield
a system admin who repeatedly bangs his head against his keyboard. :-) )

---Rsk
Rich Kulawiec
rsk@magpage.com




-------- Original Message --------
Subject: ufsdump with the "a" option
Date: Thu, 07 Mar 2002 17:12:15 -0500
From: Chris Hoogendyk <choogend@library.umass.edu>
Reply-To: choogend@library.umass.edu
Organization: UMass Library
To: sunmanagers@sunmanagers.org

ok, this is probably a dumb question, but ....

I'm doing a manual set of tapes for off site archive.

ufsdump 0cfu /dev/rmt/0 /dev/dsk/c0t0d0s6 > Images-07Mar2002-t1f1 2>&1

works just fine to get that partitian out to the tape and a general
record of what is on that dump on the tape into the file
Images-07Mar2002-t1f1. But, I also want a complete table of contents in
that file. Then I can just look at the records on file to determine
whether something is on the tapes which are off-site.

the "a" option would seem to be what I what, but I can't make sense of
how to use it, and can't find an example either in the man pages or in
Sun's System Administration Guide.

Can anyone tell me how to use the "a" option?

do I have to use "mt" to position the tape and re-read it to get the
table of contents?


---------------

Chris Hoogendyk

-- 
   O__  ---- Network Specialist & Unix Systems Administrator
  c/ /'_ --- Library Information Systems & Technology Services
 (*) \(*) -- W.E.B. Du Bois Library
~~~~~~~~~~ - University of Massachusetts, Amherst

<choogend@library.umass.edu>

---------------
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Mar 8 09:05:14 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:36 EST