DUMP(1M)                                                              DUMP(1M)

NAME
     dump, rdump - incremental file system dump

SYNOPSIS
     /sbin/dump [ key [ argument ... ] ] filesystem
     /sbin/rdump [ key [ argument ... ] ] filesystem

DESCRIPTION
     dump backs up all files in filesystem, or files changed after a certain
     date to magnetic tape or files.  The key specifies the date and other
     options about the dump.  Key consists of characters from the set
     0123456789fusCcdbWwn. Any arguments supplied for specific options are
     given as subsequent words on the command line, in the same order as that
     of the options listed.

     If no key is given, the key is assumed to be 9u and the filesystem
     specified is dumped to the default tape device /dev/tape.

     0-9  This number is the `dump level'.  All files modified since the last
          date stored in the file /etc/dumpdates for the same filesystem at
          lesser levels will be dumped.  If no date is determined by the
          level, the beginning of time is assumed; thus the option 0 causes
          the entire filesystem to be dumped.  For instance, if you  did  a
          "level 2" dump on Monday, followed by a "level 4" dump on Tuesday, a
          subsequent "level 3" dump on Wednesday  would contain  all files
          modified or added to the filesystem since the "level 2" (Monday)
          backup.  A "level 0" dump  copies  the  entire filesystem to the
          dump volume.

     f    Place the dump on the next argument file instead of the default tape
          device /dev/tape. If the name of the file is ``-'', dump writes to
          standard output.  If the name of the file is of the format
          machine:device the filesystem is dumped across the network to the
          remote machine.  Since dump is normally run by root, the name of the
          local machine must appear in the .rhosts file of the remote machine.
          If the file name argument is of the form user@machine:device, dump
          will attempt to execute as the specified user on the remote machine.
          The specified  user  must have a .rhosts file on the remote machine
          that allows root from the  local  machine.  dump creates a remote
          server, /etc/rmt, on the client machine to access the tape device.

     u    If the dump completes successfully, write the date of the beginning
          of the dump on file /etc/dumpdates. This file records a separate
          date for each filesystem and each dump level.  The format of
          /etc/dumpdates is readable by people, consisting of one free format
          record per line:  filesystem name, increment level and ctime(3C)
          format dump date. /etc/dumpdates may be edited to change any of the
          fields, if necessary.

     s    The size of the dump tape is specified in feet.  The number of feet
          is taken from the next argument. When the specified size is reached,
          dump will prompt the operator and wait for the reel/volume to be

                                                                        Page 1

DUMP(1M)                                                              DUMP(1M)

          changed.  The default tape size for the standard 9 track half inch
          reels is 2400 feet.  The default for cartridge tapes is an effective
          tape length of 5400 feet, and this assumes a 9-track QIC-24 tape
          whose physical tape length is 600 feet. See note on cartridge tapes
          parameters below.

     d    The density of the tape, expressed in BPI (bytes per inch), is taken
          from the next argument. This is used in calculating the amount of
          tape used per reel. The default is 1600 BPI, except for the
          cartridge tape which has a default density of 1000 BPI. Unless a
          higher density is specified explicitly, dump uses its default
          density - even if the tape drive is capable of higher-density
          operation (for instance 6250 BPI).  If the density specified does
          not correspond to the density of the tape device being used, dump
          will not be able to handle end-of-tape properly.

     b    The blocking factor (number of 1 Kbyte blocks written out together)
          is taken from the next argument. The default is 10. The default
          blocking factor for tapes of density 6250 BPI and greater is 32.  If
          values larger than 32 are used, restore will not correctly determine
          the block size unless the b option is also used.  To maximize tape
          utilization, use a blocking factor which is a multiple of 8.  For
          most types of supported tape drives, the greatest capacity and tape
          throughput is obtained using a blocking factor of 128 or even
          larger; note that restore(1m) will only automatically determine the
          blocking factor if it is 32 or less.

     C    This specifies the total tape capacity in 1K blocks, overriding the
          c, s, and d arguments if they are also given.  No adjustment is made
          for possible inter-record gaps, or lost capacity due to stop/start
          repositioning, so it isn't necessary to guess how the dump algorithm
          for these factors will affect the parameters.  Since they aren't
          taken into account, and there may also be lost capacity due to
          retries on media errors (by the drive), one should be conservative
          when specifying capacity.

          The argument is parsed with strtoul(3), so it may be in any base
          (e.g., a 0x prefix specifies a hex value, a 0 prefix specifies
          octal, no prefix is decimal).  The argument may have a k, K, m, or M
          suffix.  The first two multiply the value by 1024, the 3rd and 4th
          multiple by 1048576, so a tape with a 2.2 Gbyte capacity might be
          specified as C 2m allowing 10% loss to retries, etc.

     c    Indicates that the tape is a cartridge tape instead of the standard
          default half-inch reel.  This should always be specified when using
          cartridge tapes.  The values for blocking factor, size and density
          are taken to be 10 (1 KByte blocks), 5400 feet and 1000 BPI
          respectively unless overridden with the 'b', 's' or 'd' option.
          Cartridge tapes with multiple tracks have a greater effective length
          which can be specified with the 's' option.

                                                                        Page 2

DUMP(1M)                                                              DUMP(1M)

     W    dump tells the operator what file systems need to be dumped.  This
          information is gleaned from the files /etc/dumpdates and /etc/fstab.
          The W option causes dump to print out, for each file system in
          /etc/dumpdates the most recent dump date and level, and highlights
          those file systems that should be dumped.  The mnt_freq field in the
          /etc/fstab entry of the file system must be non-zero for dump to
          determine whether the file system should be dumped or not.  If the W
          option is set, no other option must be given, and dump exits
          immediately.

     w    Is like W, but prints only those filesystems which need to be
          dumped.

     n    Whenever dump requires operator attention, notify by means similar
          to a wall(1) all of the operators in the group "operator".

     dump reads the character device associated with the filesystem and dumps
     the contents onto the specified tape device. It searches /etc/fstab to
     find the associated character device.

NOTES
     rdump is a link to dump.

   Operator Intervention
     dump requires operator intervention on these conditions:  end of tape,
     end of dump, tape write error, tape open error or disk read error (if
     there are more than a threshold of 32).  In addition to alerting all
     operators implied by the n key, dump interacts with the operator on
     dump's control terminal at times when dump can no longer proceed, or if
     something is grossly wrong.  All questions dump poses must be answered by
     typing "yes" or "no", appropriately.

     Since making a dump involves a lot of time and effort for full dumps,
     dump checkpoints itself at the start of each tape volume.  If writing
     that volume fails for some reason, dump will, with operator permission,
     restart itself from the checkpoint after the old tape has been rewound
     and removed, and a new tape has been mounted.

     dump reports periodically including usually the percentage of the dump
     completed, low estimates of the number of blocks to write in 1 Kbyte (or
     more strictly, TP_BSIZE units from <protocols/dumprestore.h>), the number
     of tapes it will take, the time to completion, and the time to the tape
     change.  The estimated time is given as hours:minutes and is based on the
     time taken to dump the blocks already on tape. It is normal for this
     estimate to show variance and the estimate improves over time.  The
     output is verbose, so that others know that the terminal controlling dump
     is busy, and will be for some time.

   Suggested Dump Schedule
     It is vital to perform full, "level 0, dumps at regular intervals.  When
     performing a full dump, bring the machine down to single-user mode using
     shutdown -is, Otherwise the dump may not be internally consistent, and

                                                                        Page 3

DUMP(1M)                                                              DUMP(1M)

     may not restore correctly.  While preparing for a full dump, it is a good
     idea to clean the tape drive and heads (most types of drives require head
     cleaning for approximately every 30 hours of tape motion).

     Incremental dumps allow for convenient backup and recovery on a more
     frequent basis of active files, with a minimum of media and time.
     However there are some tradeoffs.  First, the interval between backups
     should be kept to a minimum (once a day at least).  To guard against data
     loss as a result of a media failure (a rare, but possible occurrence), it
     is a good idea to capture active files on (at least) two sets of dump
     volumes.  Another consideration is the desire to keep unnecessary
     duplication of files to a minimum to save both operator time and media
     storage.  A third consideration is the ease with which a particular
     backed-up version of a file can be located and restored.  The following
     four-week schedule offers a reasonable tradeoff between these goals.
              Sun    Mon    Tue    Wed    Thu    Fri
     Week 1:  Full   5      5      5      5      3
     Week 2:         5      5      5      5      3
     Week 3:         5      5      5      5      3
     Week 4:         5      5      5      5      3

     Although the Tuesday - Friday incrementals contain "extra copies" of
     files from Monday, this scheme assures that any file modified during the
     week can be recovered from the previous day's incremental dump.

   Dump Parameters
     The following table gives a list of available tape formats, size and
     densities. It is important that the correct parameters be given to dump,
     if they are different from the defaults.

   Parameters for cartridge tapes
     Cartridge Interface           QIC-24    QIC-120   QIC-150
     Number of Tracks               9         15        18
     Physical Tape Length  (feet)   600       600       600
     Effective Tape Length (feet)   5400      9000      10800

     Cartridge tapes with multiple tracks have an greater effective length.
     The tape lengths give above assume a physical tape length of 600 feet. In
     general the effective tape length can be calculated by multiplying the
     physical tape length by the number of tracks. Since some tape is usually
     lost due to tape errors, and because dump does not handle end-of-tape
     gracefully, it pays to be conservative in estimating the effective tape
     length.

   Parameters for half-inch tapes
                                                  Thickness
     Reel Sizes  (inches)  6.0   7.0   8.5  10.5
     Tape Length (feet)    200   600  1200  2400  1.9 mm
                                            3600  1.3 mm

                                                                        Page 4

DUMP(1M)                                                              DUMP(1M)

     The density for these tapes can be any one of the following: 800, 1600,
     3200 or 6250 BPI.

   Parameters for 8mm tapes
     Tape Type              length     capacity
                           (meters)    (Mbytes)
     P5 (European)           112         2200
     P6 (American)           112         2000

     There was a bug in dump which causes it to miscalculate the number of
     tapes required when it is given a large value for the density and a small
     value for tape length. To work around this, a density of 54000 and length
     of 6000 feet was recommended while using 8mm tapes, rather than the
     actual density and length, now the calculations are done with floating
     point numbers, so overflow is no longer an issue; with large capacity
     drives such as the 8mm and 4mm, it is normally easier to specify capacity
     as C 2000k, rather than trying to calculate a workable density and
     length.

     If you do not wish to use the C option, then when using drives with no
     "inter-record gaps" (i.e., almost every type except 9-track), use the c
     option, and the formula:

          capacity in bytes = 7 * densityvalue * lengthvalue

     and round down a bit to be conservative (allowing for block rewrites,
     etc.).  The density should be kept under 100000 to avoid overflows in the
     capacity calculations.  Thus, for a DAT drive with a 90 meter tape (2 *
     10^9 capacity), one might use:

          2000000000 = 7 * 47619 * 6000

     or rounding down:

          dump 0csd 6000 47000

EXAMPLES
          /dev/usr /usr efs rw,raw=/dev/rdsk/dks0d1s6 0 0

     Here are a few examples on how to dump the /usr filesystem with the above
     /etc/fstab entry.

          dump 0fuc guest@kestrel:/dev/tape /usr

     will do a level '0' dump of /usr on to a remote cartridge tape device
     /dev/tape on host kestrel using the guest account.  dump also updates the
     file /etc/dumpdates.

          dump 2uc /usr

                                                                        Page 5

DUMP(1M)                                                              DUMP(1M)

     does a level '2' dump of /usr to the local cartridge tape device
     /dev/tape and also updates the file /etc/dumpdates.

          dump 0sdb 10800 1000 128 /usr
          dump 0Cb 125k 128 /usr

     does a level '0' dump of /usr to the local tape device /dev/tape using a
     blocking factor of 128. The tape is specified to have a length of 10800
     feet with a density of 1000 BPI (appropriate for a QIC150 drive) in the
     first case, and a capacity of 125 Mbytes in the second, which allows for
     retries, lost space to repositioning, etc., also appropriate for a QIC
     150 quarter inch tape drive.  The ordering of the arguments is dependent
     on the ordering of the key.

          dump 1sfc 10800 /dev/mt/tps0d7 /usr
          dump 1sfc 10800 /dev/mt/tps0d7 /dev/rdsk/dks0d1s6

     both do a level '1' dump of /usr to the local cartridge tape device
     /dev/mt/tps0d7 using a tape length of 10800 feet.

          dump /usr

     does a level '9' dump of /usr to the local tape device /dev/tape and
     updates the file /etc/dumpdates.

          dump 9ucdsf 54000 6000 /dev/mt/tps0d6nrnsv /os
          dump 9uCf 2048 /dev/mt/tps0d6nrnsv /os
          dump 9uCf 2m /dev/mt/tps0d6nrnsv /os

     All do a level '9' dump of /os to the local tape device
     /dev/mt/tps0d6nrnsv using a tape density of 54000 BPI and tape length of
     6000 feet where the tape device being used is an 8mm tape drive (there is
     a slight difference in capacity between the first form and the others).

          dump W

     prints out, for each file system in /etc/dumpdates the most recent dump
     date and level, and highlights those file systems that should be dumped.

FILES
     /dev/tape       default tape unit to dump to
     /etc/dumpdates  new format dump date record
     /etc/fstab      dump table: file systems and frequency
     /etc/group      to find group operator

                                                                        Page 6

DUMP(1M)                                                              DUMP(1M)

SEE ALSO
     restore(1M), dump(5), fstab(5), group(4), rmt(1M), rhosts(1M), mtio(7),
     wall(1), shutdown(1M), ctime(3C)

DIAGNOSTICS
     While running, dump emits many verbose messages.

     Exit Codes

         0 Normal exit.
         1 Startup errors encountered.
         3 Abnormal termination.

BUGS
     Fewer than 32 read errors on the filesystem are ignored.  Each reel
     requires a new process, so parent processes for reels already written
     just hang around until the entire tape is written.

     dump with the W or w options does not report filesystems that have never
     been recorded in /etc/dumpdates, even if listed in /etc/fstab.

     It would be nice if dump knew about the dump sequence, kept track of the
     tapes scribbled on, told the operator which tape to mount when, and
     provided more assistance for the operator running restore.

     It is recommended that incremental dumps also be performed with the
     system running in single-user mode.

     dump needs accurate information regarding the length and density of the
     tapes used. It can dump the filesystem on multiple volumes, but since
     there is no way of specifying different sizes for multiple tapes, all
     tapes used should be at least as long as the specified/default length. If
     dump reaches the end of the tape volume unexpectedly (as a result of a
     longer than actual length specification), it will abort the entire dump.

                                                                        Page 7


dump(5)                                                                dump(5)

NAME
     dump, dumpdates - incremental dump format

SYNOPSIS
     #include <sys/types.h>
     #include <protocols/dumprestore.h>

DESCRIPTION
     Tapes used by dump and restore(1M) contain:

          a header record two groups of bit map records a group of records
          describing directories a group of records describing files

     The format of the header record and of the first record of each
     description as given in the include file <protocols/dumprestore.h> is:

        #define TP_BSIZE                1024
        #define NTREC          10
        #define LBLSIZE        16
        #define NAMELEN        64

        #define TS_TAPE        1
        #define TS_INODE       2
        #define TS_BITS        3
        #define TS_ADDR        4
        #define TS_END         5
        #define TS_CLRI        6
        #define MAGIC           (int) 60011
        #define CHECKSUM                 (int) 84446

        struct spcl {
                int             c_type;
                time_t          c_date;
                time_t          c_ddate;
                int             c_volume;
                daddr_t         c_tapea;
                ino_t           c_inumber;
                int             c_magic;
                int             c_checksum;
                struct bsd_dinode        c_dinode;
                int             c_count;
                char            c_addr[TP_BSIZE/2];
                char            c_label[LBLSIZE];
                long            c_level;
                char            c_filesys[NAMELEN];
                char            c_dev[NAMELEN];
                long            c_flags;
        } spcl;

        struct idates {
                char            id_name[255];
                char            id_incno;

                                                                        Page 1

dump(5)                                                                dump(5)

                time_t          id_ddate;
        };

        #define DUMPOUTFMT "%-16s %c %s"
        #define DUMPINFMT  "%[^ ] %c %[^\n]\n"

     TP_BSIZE is the size of file blocks on the dump tapes.  NTREC is the
     default number of 1024 byte records in a physical tape block (blocking
     factor).

     The TS_ entries are used in the c_type field to indicate what sort of
     header this is.  The types and their meanings are as follows:

     TS_TAPE      Tape volume label
     TS_INODE     A file or directory follows.  The c_dinode field is a copy
                  of the disk inode and contains bits indicating the type of
                  the file.
     TS_BITS      A bit map follows.  This bit map has a one bit for each
                  inode that was dumped.
     TS_ADDR      A subrecord of a file description.  See c_addr below.
     TS_END       End of tape record.
     TS_CLRI      A bit map follows.  This bit map contains a zero bit for all
                  inodes that were empty on the filesystem when dumped.
     MAGIC        All header records have this number in c_magic.
     CHECKSUM     Header records checksum to this value.

     The fields of the header structure are as follows:

     c_type       The type of the header.
     c_date       The date the dump was taken.
     c_ddate      The date the filesystem was dumped from.
     c_volume     The current volume number of the dump.
     c_tapea      The current number of this (1024-byte) record.
     c_inumber    The number of the inode being dumped if this is of type
                  TS_INODE.
     c_magic      This contains the value MAGIC above, truncated as needed.
     c_checksum   This contains whatever value is needed to make the record
                  sum to CHECKSUM.
     c_dinode     This is a copy of the inode as it appears on the filesystem.
                  Extent File System (see fs(4)) disk inodes differ from the
                  Berkeley Fast File System inode format.  Dump converts EFS
                  disk inodes to Berkeley's format, before dumping them on
                  tape.
     c_count      The count of characters in c_addr.
     c_addr       An array of characters describing the blocks of the dumped
                  file.  A character is zero if the block associated with that
                  character was not present on the filesystem, otherwise the
                  character is non-zero.  If the block was not present on the
                  filesystem, no block was dumped; the block will be restored
                  as a hole in the file.  If there is not sufficient space in
                  this record to describe all of the blocks in a file, TS_ADDR
                  records will be scattered through the file, each one picking

                                                                        Page 2

dump(5)                                                                dump(5)

                  up where the last left off.
     c_label      Dump label.
     c_level      Level of this dump.  See dump(1M).
     c_filesys    Name of the dumpped filesystem.
     c_dev        Name of the dump device.
     c_host       Name of the dumpped host.
     c_flags      Additional information.

     Each volume except the last ends with a tapemark (read as an end of
     file).  The last volume ends with a TS_END record and then the tapemark.

     The structure idates describes an entry in the file /etc/dumpdates where
     dump history is kept.  The fields of the structure are:

     id_name  The dumped filesystem is `/dev/id_nam'.
     id_incno The level number of the dump tape; see dump(1M).
     id_ddate The date of the incremental dump in system format see types(5).

FILES
     /etc/dumpdates

SEE ALSO
     dump(1M), restore(1M), fs(4), types(5)