'\"macro stdmacro
.if n .pH g1a.fdisk @(#)fdisk	40.12 of 1/17/90
.\" Copyright 1989 AT&T
.ig
This file is for delivery to OAM10 April 7, 1988.
Reviewed by Roger Massey.
..
'\"macro stdmacro
.nr X
.if \nX=0 .ds x} fdisk 1M "System Administration Utilities" "\&"
.if \nX=1 .ds x} fdisk 1M "System Administration Utilities"
.if \nX=2 .ds x} fdisk 1M "" "\&"
.if \nX=2 .ds x} fdisk "" "" "\&"
.TH \*(x}
.SH NAME
\f4fdisk\f1 \- create (recover) a complete disk archive
.SH SYNOPSIS
\f4fdisk \-B \f1[\f4\-dovAENV\f1]
\f2bkjobid odname
opartdev odlab descript
.PP
\f4fdisk \-RC \f1[\f4\-dovAENV\f1]
\f2odname opartdev descript rsjobid\f1
.SH DESCRIPTION
The \f4fdisk\fP command is invoked as a child process by other
shell commands.
The command name, \f4fdisk\fP, is read either from the
\f2bkhist.tab\f1 or the \f4bkreg \-m\fP command and option.
The \f4 -B, -R, \f1and \f4-C \f1options
are passed to \f4fdisk\fP by the shell commands \f2backup\f1
and \f2restore\f1.
The other options are passed from the
\f4bkhist.tab\f1 file or the \f4bkreg \-p\fP command and option.
The arguments are sent to \f4fdisk\fP from various locations
in the backup service.
.PP
\f4fdisk \-B\f1 is invoked as a child process by \f4backup\fP
to record the formatting information required to recreate
the entire disk as it existed at the time of the archiving operation.
The formatting information consists of the
disk's volume name (not to be confused with the volume
name associated with each filesystem partition on the disk),
the partitions sizes and locations, and volume names.
The resulting backup is a data file,
including the results of a \f4prtvtoc\f1 command
that provides the information required to recreate the disk.
The backup is recorded in the backup history log,
\f4/etc/bkup/bkhist.tab\fP.
.PP
\f4fdisk \-RC\f1 is invoked as a child process by
\f4rsoper\fP to reconstruct a disk using the formatting information
previously archived, and to issue the appropriate
\f4restore\f1 requests to repopulate the most recent
data on the disk.
The archive is assumed to have been created by \f4fdisk \-B\fP.
It contains data
describing the format of the disk and the names of the
filesystems and data partitions that were present on it
at the time of the archiving operation.
.P
The arguments to \f4fdp\fP are defined as follows:
.TP 0.7i
.I bkjobid
the job id assigned by \f4backup\fP.
The method uses the \f2bkjobid\f1 when it creates
history log entries.
.TP
.I odname
the name of the data partition that is to be backed up.
Unused by \f4fdisk\fP, but supplied by \f4backup\fP
for command-line compatibility with other archiving methods.
.TP
.I opartdev
the name of the raw (character) device
(partition of the disk) that represents the entire disk
.TP
.I odlab
the volume name on the filesystem [see \f4labelit\fP(1M)].
Unused by \f4fdisk\fP, but supplied by \f4backup\fP
for command-line compatibility with other archiving methods.
.TP
.I descript
is a description for a destination device in the form:
.in +.5i
.sp .5
.I
dgroup:dname:dchar:dlabels
.sp .5
.in -.5i
.I dgroup
specifies a device group [see \f4devgroup.tab\fP(4)].
.br
\f2dname\fP
specifies a particular device name [see \f4device.tab\fP(4)].
.br
.I dchars
specifies characteristics associated with the device.
If specified, \f2dchar\f1
overrides the defaults for the specified device and group.
(See \f4device.tab\fP(4) for a further description of device characteristics).
.br
.I dlabels
specifies the volume names
for the media to be used for reading or writing the archive.
.TP
.I rsjobid
the job id assigned by \f4restore\fP.
.SS Options
Some options are only significant during
\f4fdisk \-B\f1 invocations;  they are accepted but ignored during
\f4fdisk \-R\f1
invocations because the command is invoked and options are specified
automatically by \f4restore\fP.
These options are flagged with an asterisk (*).
.TP 10
\f4d*\f1
Inhibits recording the archive in the backup history log.
.TP 10
\f4o\f1
Permits the user to override media insertion requests [see
\f4getvol\fP(1M) and the description of the \f4\-o\fP option].
.TP 10
\f4v*\f1
Validates the archive as it is written.
A checksum is computed as the archive is being written;
as each medium is completed, it is re-read and the checksum
recomputed to verify that each block is readable and correct.
If either check fails, the medium is considered unreadable.
If
\f4-A\f1
has been specified, the archiving operation fails;
otherwise, the operator is prompted to replace the failed medium.
.TP 10
\f4A\f1
Establishes automated mode,
(i.e., does not prompt the user to insert or remove media).
.TP 10
\f4E*\f1
Reports an estimate of media usage for the archive;
then performs the backup.
.TP 10
\f4N*\f1
Reports an estimate of media usage for the archive;
does not perform the backup.
.TP 10
\f4V*\f1
Generates the name and type of each partition on the disk
as its formatting information is read-to or written-from
the destination device.
.SS User Interactions
The connection between an archiving method and
\f4backup\fP is more complex than a simple fork/exec or pipe.
\f4backup\fP is responsible for all interactions with the user,
either directly, or through \f4bkoper\fP.
Therefore, \f4fdisk\fP
neither reads from standard-input nor writes to standard-output or
standard-error.
A method library must be used [see \f4libbrmeth\fP(3)] to communicate
reports (estimates, filenames, periods, status, etc.) to \f4backup\fP.
.SH DIAGNOSTICS
The exit codes for \f4fdisk\fP are the following:
.PP
0 = successful completion of the task
.br
1 = one or more parameters to \f4fdisk\fP are invalid.
.br
2 = an error has occurred which caused \f4fdisk\fP to fail to
      complete \f2all\f1 portions of its task.
.SH FILES
.PD 0
.TP 1.5i
\f4/etc/bkup/bkhist.tab\fP
lists the labels of all volumes that have been used for backup operations
.TP
\f4/etc/bkup/bklog\fP
logs errors generated by the backup methods and the \f4backup\f1 command
.TP
\f4/etc/bkup/rslog\fP
logs errors generated by the restore methods and the \f4restore\f1 command
.PD
.SH SEE ALSO
.na
\f4backup\fP(1M),
\f4device.tab\fP(4),
\f4fdp\fP(1),
\f4ffile\fP(1),
\f4fimage\fP(1),
\f4fmthard\fP(1M),
\f4getvol\fP(1M),
\f4incfile\fP(1),
\f4labelit\fP(1M),
\f4libbrmeth\fP(3),
\f4prtvtoc\fP(1M),
\f4restore\fP(1M),
\f4rsoper\fP(1M)




