Skip site navigation (1)Skip section navigation (2)
Date:               Wed, 23 Oct 1996 08:55:24 +600 CDT
From:      "Larry Dolinar" <>
Subject:         Re: Questions re backing up
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
|  From:           Nadav Eiron <>

|  On Wed, 23 Oct 1996, Mikel Lindsaar wrote:
|  > 
|  > Being fairly new to FreeBSD (and Unix in general) I have now a need to set
|  > up a fairly comprehensive backup regieme.  A simple tar to /der/rst0 is no
|  > longer suitable.
|  > 
|  > I need to backup the following

                              <detail snipped>
|  > 
|  > Now, I know I can go without /tmp and there is no need to backup /proc but
|  > I want to be able to backup the remaining systems to a single tape, with a
|  > rotating tape log (5 tapes over a week)
|  > 
|  > I know I can use dump, but after digging through the man pages and the
|  > O'Rielly (God bless them) Sys Admin Bible I cannot see how to specify
|  > multiple filesystems in the single dump command.
|  > 

You can't; once upon a time Sun used to say you could use the 'c' partition 
of a drive (required to have the full geometry for Sun installs) but this has 
never proved reliable in my experience.  In any case FreeBSD, similar as it 
is, doesn't work this way either.

Below is a Cshell script I use for backing up the host which servers as our 
'dumphost' for our CAD/CAM network.  Target device is a Sony SDT-5000 4mm 
DAT drive.  

Due to this mailer (Pegasus on Novell), some lines are wrapped.

As with all things Un*x, there are many ways to do the same thing.  This one 
adapts to whatever FreeBSD box it finds itself on.  Works for Sun as well.

# dumpall:  script to dump filesystems (FreeBSD)

# awk script prints appropriate column from filesystem table as arg to 'dump'
#  -- only problem is that filesystems are dumped in order they're mounted
#  (may not be all bad)
# in SunOS 4.x case (BSD as well), filesystem table doesn't call out raw
#  device files, so second awk required to separate path components on '/'
#  so output can be reformatted to look like raw device names

mt -f /dev/st0ctl.0 blocksize 1024

set files = `awk '/^\/dev\/sd/ && $3 !~ /swap/ { printf( "%s\n", $1  ); }' 
 /etc/fstab | awk  'BEGIN { FS="/" } /dev/ { printf( "/dev/r%s ", $3 ); }'`

set tparms='0udsbf 61000 10240 126 /dev/nrst0'

foreach fs ( $files )
    dump $tparms $fs
#   echo dump $tparms $fs

# clean up and dismount

mt -f /dev/nrst0 rewoffl

|  > I am currently backup up the /home tree with 
|  > 
|  > dump 0usfd 42500 /dev/rst0 5000 /dev/sd0s1e 
|  What should help you (if I understand ou correctly) is use the /dev/nrst0 
|  device. The difference is that it will not rewind when it finishes. This 
|  will let you put another dump on the same tape right after the first one. 

Most definitely.  This script (and use of /dev/nrst0 in general) will create 
what's sometimes called a stacked format.  You get to subsequent dumps with 
either 'mt fsf' if doing multiple restores off the same tape, or the 's' 
parameter of restore (see the man pages for more info).


Want to link to this message? Use this URL: <>