31bbdef993d8e5e5cae32d72859d462e0e7935e7
[openafs.git] / doc / man-pages / pod / backup_diskrestore.pod
1 =head1 NAME
2
3 backup diskrestore - Restores the entire contents of a partition
4
5 =head1 SYNOPSIS
6
7 backup diskrestore B<-server> I<machine to restore>
8 B<-partition> I<partition to restore>
9 [B<-portoffset> I<TC port offset> [I<TC port offset> ...]]
10 [B<-newserver> I<destination machine>]
11 [B<-newpartition> I<destination partition>]
12 [B<-extension> I<new volume name extension>]
13 [B<-n>]  [B<-localauth>]  [B<-cell> I<cell name>]  [B<-help>]
14
15 backup di B<-s> I<machine to restore> B<-pa> I<partition to restore>
16 [B<-po> I<TC port offset> [I<TC port offset> ...]]  [B<-news> I<destination machine>]
17 [B<-newp> I<destination partition>]  [B<-e> I<new volume name extension>]
18 [B<-n>]  [B<-l>]  [B<-c> I<cell name>]  [B<-h>]
19
20 =head1 DESCRIPTION
21
22 The C<backup diskrestore> command restores all of the volumes for which
23 the Volume Location Database (VLDB) lists a read/write site on the
24 partition specified with the B<-server> and B<-partition> arguments. It is
25 useful if a disk or machine failure corrupts or destroys the data on
26 an entire partition. (To restore any read-only or backup volumes that
27 resided on the partition, use the C<vos release> and C<vos backup> commands,
28 respectively, after restoring the read/write version.)
29
30 If restoring only selected volumes to a single site, it is usually
31 more efficient to use the C<backup volrestore> command. To restore
32 multiple volumes to many different sites, use the C<backup volsetrestore> command.
33
34 (If the B<FILE YES> instruction appears in the
35 B</usr/afs/backup/CFG>I<_device_name> file on the Tape Coordinator machine
36 associated with the specified port offset, then the Backup System
37 restores data from the backup data file listed for that port offset in
38 the Tape Coordinator's B</usr/afs/backup/tapeconfig> file, instead of
39 from tape. For the sake of clarity, the following text refers to tapes
40 only, but the Backup System handles backup data files in much the same
41 way.)
42
43 The Backup System determines whether the read/write or backup version
44 of each volume was dumped more recently, and restores the dumps of
45 that version, starting with the most recent full dump. It resets the
46 creation timestamp of each restored volume to the date and time at
47 which it begins restoring the volume (the creation timestamp appears
48 in the Creation field of the output from the C<vos examine> and C<vos
49 listvol> commands).
50
51 If all of the full and incremental dumps of all relevant volumes were
52 not written on compatible tape devices, use the B<-portoffset> argument
53 to list multiple port offset numbers in the order in which the tapes
54 are needed (first list the port offset for the full dump, second the
55 port offset for the level 1 incremental dump, and so on). This implies
56 that the full dumps of all relevant volumes must have been written to
57 a type of tape that the first Tape Coordinator can read, the level 1
58 incremental dumps to a type of tape the second Tape Coordinator can
59 read, and so on. If dumps are on multiple incompatible tape types, use
60 the C<backup volrestore> command to restore individual volumes, or the
61 C<backup volsetrestore> command after defining groups of volumes that
62 were dumped to compatible tape types. For further discussion, see the
63 IBM AFS Administration Guide.
64
65 By default, the Backup System restores the contents of the specified
66 partition to that same partition. To restore the contents to an
67 alternate site, combine the following options as indicated. The Backup
68 System removes each volume from the original site, if it still exists,
69 and records the change of site in the VLDB.
70
71 =over
72
73 =item *
74
75 To restore to a different partition on the same file server
76 machine, provide the B<-newpartition> argument.
77
78 =item *
79
80 To restore to the partition with the same name on a different file
81 server machine, provide the B<-newserver> argument.
82
83 =item *
84
85 To restore to a completely different site, combine the B<-newserver>
86 and B<-newpartition> arguments.
87
88 =back
89
90 By default, the Backup System overwrites the contents of existing
91 volumes with the restored data. To create a new volume to house the
92 restored data instead, use the B<-extension> argument. The Backup System
93 creates the new volume at the site designated by the B<-newserver> and
94 B<-newpartition> arguments if they are used or the B<-server> and B<-partition>
95 arguments otherwise. It derives the volume name by adding the
96 extension to the read/write base name listed in the VLDB, and creates
97 a new VLDB entry. The command does not affect the existing volume in
98 any way. However, if a volume with the specified extension also
99 already exists, the command overwrites it.
100
101 To print out a list of the tapes containing the needed dumps, without
102 actually performing the restore operation, include the B<-n> flag along
103 with the other options to be used on the actual command.
104
105 The Tape Coordinator's default response to this command is to access
106 the first tape it needs by invoking the B<MOUNT> instruction in the local
107 B<CFG>I<_device_name> file, or by prompting the backup operator to insert
108 the tape if there is no B<MOUNT> instruction. However, if the B<AUTOQUERY
109 NO> instruction appears in the B<CFG>I<_device_name> file, or if the issuer
110 of the C<butc> command included the B<-noautoquery> flag, the Tape
111 Coordinator instead expects the tape to be in the device already. If
112 it is not, or is the wrong tape, the Tape Coordinator invokes the
113 B<MOUNT> instruction or prompts the operator. It also invokes the B<MOUNT>
114 instruction or prompts for any additional tapes needed to complete the
115 restore operation; the backup operator must arrange to provide them.
116
117 =head1 OPTIONS
118
119 =over 4
120
121 =item B<-server> I<machine to restore>
122
123 Names the file server machine that the VLDB lists as the site
124 of the volumes that need to be restored.
125
126 =item B<-partition> I<partition to restore>
127
128 Names the partition that the VLDB lists as the site of the
129 volumes that need to be restored.
130
131 =item B<-portoffset> I<TC port offset> [I<TC port offset> ...]
132
133 Specifies one or more port offset numbers (up to a maximum of
134 128), each corresponding to a Tape Coordinator to use in the
135 operation. If there is more than one value, the Backup System
136 uses the first one when restoring the full dump of each volume,
137 the second one when restoring the level 1 incremental dump of
138 each volume, and so on. It uses the final value in the list
139 when restoring dumps at the corresponding depth in the dump
140 hierarchy and at all lower levels.
141
142 Provide this argument unless the default value of 0 (zero) is
143 appropriate for all dumps. If B<0> is just one of the values in
144 the list, provide it explicitly in the appropriate order.
145
146 =item B<-newserver> I<destination machine>
147
148 Names an alternate file server machine to which to restore the
149 volumes. If this argument is omitted, the volumes are restored
150 to the file server machine named by the B<-server> argument.
151
152 =item B<-newpartition> I<destination partition>
153
154 Names an alternate partition to which to restore the data. If
155 this argument is omitted, the volumes are restored to the
156 partition named by the B<-partition> argument.
157
158 =item B<-extension> I<new volume name extension>
159
160 Creates a new volume for each volume being restored, to house
161 the restored data. The Backup System derives the new volume's
162 name by appending the specified string to the read/write base
163 name listed in the VLDB, and creates a new VLDB volume entry.
164 The Backup System preserves the contents of the volumes on the
165 partition, if any still exist. Any string other than B<.readonly>
166 or B<.backup> is acceptable, but the combination of the base name
167 and extension cannot exceed 22 characters in length. To use a
168 period to separate the extension from the name, specify it as
169 the first character of the string (as in B<.rst>, for example).
170
171 =item B<-n>
172
173 Displays a list of the tapes necessary to perform the requested
174 restore, without actually performing the operation.
175
176 =item B<-localauth>
177
178 Constructs a server ticket using a key from the local
179 B</usr/afs/etc/KeyFile> file. The C<backup> command interpreter
180 presents it to the Backup Server, Volume Server and VL Server
181 during mutual authentication. Do not combine this flag with the
182 B<-cell> argument. For more details, see the introductory L<backup(1)> reference page.
183
184 =item B<-cell>
185
186 Names the cell in which to run the command. Do not combine this
187 argument with the B<-localauth> flag. For more details, see the
188 introductory L<backup(1)> reference page.
189
190 =item B<-help>
191
192 Prints the online help for this command. All other valid
193 options are ignored.
194
195 =back
196
197 =head1 OUTPUT
198
199 If a tape error occurs during the restore operation, the Tape
200 Coordinator displays the following messages:
201
202    Restore operation on volume name failed due to tape error
203    Do you want to continue (y/n)?
204
205 where I<name> is the name of the volume that was being restored when the
206 tape error occurred. Enter the value B<y> to continue the operation
207 without restoring the indicated volume or the value B<n> to terminate the
208 operation. In the latter case, the operator can then attempt to
209 determine the cause of the tape error.
210
211 If the issuer includes the B<-n> flag with the command, the following
212 string appears at the head of the list of the tapes necessary to
213 perform the restore operation:
214
215    Tapes needed:
216
217 =head1 EXAMPLES
218
219 The following command restores the volumes for which the VLDB lists a
220 read/write site on the B</vicepd> partition of the machine B<fs5.abc.com>.
221 The Tape Coordinator associated with port offset 3 performs the
222 operation.
223
224    backup diskrestore -server fs5.abc.com -partition /vicepd -portoffset 3
225
226 The following command restores the volumes for which the VLDB lists a
227 read/write site on the B</vicepb> partition of the machine B<fs1.abc.com> to
228 a new site: the B</vicepa> partition on the machine B<fs3.abc.com>. The Tape
229 Coordinator associated with port offset 0 performs the operation. (The
230 command appears here on two lines only for legibility.)
231
232    backup diskrestore  -server fs1.abc.com -partition /vicepb   \
233                        -newserver fs3.abc.com -newpartition /vicepa
234
235 The following command lists the tapes required to restore the volumes
236 for which the VLDB lists a read/write site on the B</vicepm> partition of
237 the machine B<fs4.abc.com>:
238
239    backup diskrestore -server fs4.abc.com -partition /vicepm -n
240    Tapes needed:
241    user.sunday1.1
242    user.sunday1.2
243    user.monday1.1
244    user.tuesday1.1
245    user.wednesday1.1
246
247 =head1 PRIVILEGE REQUIRED
248
249 The issuer must be listed in the B</usr/afs/etc/UserList> file on every
250 machine where the Backup Server or Volume Location (VL) Server is
251 running, and on every file server machine that houses an affected
252 volume. If the B<-localauth> flag is included, the issuer must instead be
253 logged on to a server machine as the local superuser B<root>.
254
255 =head1 CAVEATS
256
257 If issuing this command to recover data after a disk crash or other
258 damage, be sure not to issue the C<vos syncserv> command first. Doing so
259 destroys the VLDB record of the volumes that resided on the partition.
260
261 =head1 COPYRIGHT
262
263 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
264
265 Converted from html to pod by Alf Wachsmann <alfw@slac.stanford.edu>, 2003,
266 Stanford Linear Accelerator Center, a department of Stanford University.
267
268 =head1 SEE ALSO
269
270 L<backup(1)>,
271 L<backup_dump(1)>,
272 L<backup_volrestore(1)>,
273 L<backup_volsetrestore(1)>,
274 L<butc(1)>,
275 L<vos_backup(1)>,
276 L<vos_examine(1)>,
277 L<vos_listvol(1)>,
278 L<vos_release(1)>
279
280 =cut