6c2aa84bae76a54a70828313d083ae9f89f6922f
[openafs.git] / doc / man-pages / pod / backup_volrestore.pod
1 =head1 NAME
2
3 backup volrestore - Restores one or more volumes
4
5 =head1 SYNOPSIS
6
7 backup volrestore B<-server> I<destination machine>
8 B<-partition> I<destination partition>
9 B<-volume> I<volume(s) to restore> [I<volume(s) to restore> ...]
10 [B<-extension> I<new volume name extension>]
11 [B<-date> I<date from which to restore> ...]
12 [B<-portoffset> I<TC port offsets> [I<TC port offsets> ...]]  [B<-n>]
13 [B<-localauth>]  [B<-cell> I<cell name>]  [B<-help>]
14
15 backup volr B<-s> I<destination machine>  B<-pa> I<destination partition>
16 B<-v> I<volume(s) to restore> [I<volume(s) to restore> ...]  [B<-e> I<new volume name extension>]
17 [B<-d> I<date from which to restore> ...]  [B<-po> I<TC port offsets> [I<TC port offsets> ...]]
18 [B<-n>]  [B<-l>]  [B<-c> I<cell name>]  [B<-h>]
19
20 =head1 DESCRIPTION
21
22 The C<backup volrestore> command restores the contents of one or more
23 volumes to the site indicated by the B<-server> and B<-partition> arguments.
24 Use the command either to overwrite the contents of existing volumes
25 with the restored data or to create new volumes while retaining the
26 existing ones. The specified site does not have to be the current site
27 for the volumes.
28
29 (If the B<FILE YES> instruction appears in the
30 B</usr/afs/backup/CFG_>I<device_name> file associated with the specified
31 port offset, then the C<backup volrestore> command restores data from the
32 backup data file listed for that port offset in the Tape Coordinator's
33 B</usr/afs/backup/tapeconfig> file, rather than from tape. For the sake
34 of clarity, the following text refers to tapes only, but the Backup
35 System handles backup data files in much the same way.)
36
37 The command's arguments can be combined as indicated:
38
39 =over
40
41 =item *
42
43 To preserve a volume's current contents and also create a new
44 volume to house the restored version, use the B<-extension> argument.
45 The Backup System creates the new volume on the server and
46 partition named by the B<-server> and B<-partition> arguments, assigns
47 it the same name as the current volume with the addition of the
48 specified extension, and creates a new Volume Location Database
49 (VLDB) entry for it. Creating a new volume enables the
50 administrator to compare the two versions.
51
52 =item *
53
54 To overwrite a volume's existing contents with the restored
55 version, omit the B<-extension> argument, and specify the site as
56 indicated:
57
58 =over
59
60 =item *
61
62 To retain the current site, specify it with the B<-server> and
63 B<-partition> arguments.
64
65 =item *
66
67 To move the volume to a different site while overwriting it,
68 specify the new site with the B<-server> argument, B<-partition>
69 argument, or both. The Backup System creates a new volume at
70 that site, removes the existing volume, and updates the site
71 information in the volume's VLDB entry. The backup version of
72 the volume is not removed automatically from the original
73 site, if it exists. Use the C<vos remove> command to remove it
74 and the C<vos backup> command to create a backup version at the
75 new site.
76
77 =back
78
79 =item *
80
81 To restore a volume that no longer exists in the file system,
82 specify its name with the B<-volume> argument and use the B<-server> and
83 B<-partition> arguments to place it at the desired site. The Backup
84 System creates a new volume and new VLDB entry.
85
86 =back
87
88 In each case, the command sets each volume's creation date to the date
89 and time at which it restores it. The creation date appears in the
90 Creation field in the output from the C<vos examine> and C<vos listvol>
91 commands.
92
93 If restoring all of the volumes that resided on a single partition, it
94 is usually more efficient to use the C<backup diskrestore> command. If
95 restoring multiple volumes to many different sites, it can be more
96 efficient to use the C<backup volsetrestore> command.
97
98 By default, the C<backup volrestore> command restores the most recent
99 full dump and all subsequent incremental dumps for each volume,
100 bringing the restored volumes to the most current possible state. To
101 restore the volumes to their state at some time in the past, use the
102 B<-date> argument. The Backup System restores the most recent full dump
103 and each subsequent incremental dump for which the I<clone date> of the
104 volume included in the dump is before the indicated date and time (the
105 clone date timestamp appears in the C<clone date> field of the output
106 from the C<backup volinfo> command). For backup and read-only volumes,
107 the clone date represents the time at which the volume was copied from
108 its read/write source; for read/write volumes, it represents the time
109 at which the volume was locked for inclusion in the dump. The
110 resemblance of a restored volume to its actual state at the indicated
111 time depends on the amount of time that elapsed between the volume's
112 clone date in the last eligible dump and the specified time.
113
114 If the B<-volume> argument specifies the base (read/write) form of the
115 volume name, the Backup System searches the Backup Database for the
116 newest dump set that includes a dump of either the read/write or the
117 backup version of the volume. It restores the dumps of that version of
118 the volume, starting with the most recent full dump. If, in contrast,
119 the volume name explicitly includes the C<.backup> or C<.readonly>
120 extension, the Backup System restores dumps of the corresponding
121 volume version only.
122
123 To generate a list of the tapes the Backup System needs to perform the
124 restore operation, without actually performing it, combine the B<-n> flag
125 with the options to be used on the actual command.
126
127 If all of the full and incremental dumps of all relevant volumes were
128 not written to a type of tape that a single Tape Coordinator can read,
129 use the B<-portoffset> argument to list multiple port offset numbers in
130 the order in which the tapes are needed (first list the port offset
131 for the full dump, second the port offset for the level 1 incremental
132 dump, and so on). If restoring multiple volumes, the same ordered list
133 of port offsets must apply to all of them. If not, either issue this
134 command separately for each volume, or use the C<vos volsetrestore>
135 command after defining groups of volumes that were dumped to
136 compatible tape types. For further discussion, see the IBM AFS
137 Administration Guide.
138
139 The Tape Coordinator's default response to this command is to access
140 the first tape it needs by invoking the B<MOUNT> instruction in the local
141 B</usr/afs/backup/CFG_>I<device_name> file, or by prompting the backup
142 operator to insert the tape if there is no B<MOUNT> instruction. However,
143 if the B<AUTOQUERY NO> instruction appears in the B<CFG_>I<device_name> file,
144 or if the issuer of the B<butc> command included the B<-noautoquery> flag,
145 the Tape Coordinator instead expects the tape to be in the device
146 already. If it is not, or is the wrong tape, the Tape Coordinator
147 invokes the B<MOUNT> instruction or prompts the operator. It also invokes
148 the B<MOUNT> instruction or prompts for any additional tapes needed to
149 complete the restore operation; the backup operator must arrange to
150 provide them.
151
152 =head1 OPTIONS
153
154 =over 4
155
156 =item B<-server> I<destination machine>
157
158 Names the file server machine on which to restore each volume.
159 If this argument and the B<-partition> argument indicate a site
160 other than the current site for each volume, and the B<-extension>
161 argument is not also provided, the Backup System removes the
162 existing volumes from their current sites, places the restored
163 contents at the specified site, and changes the site
164 information in the volume's VLDB entry.
165
166 =item B<-partition> I<destination partition>
167
168 Names the partition to which to restore each volume. If this
169 argument and the B<-server> argument indicate a site other than
170 the current site for each volume, and the B<-extension> argument
171 is not also provided, the Backup System removes the existing
172 volumes from their current sites, places the restored contents
173 at the specified site, and changes the site information in the
174 volume's VLDB entry.
175
176 =item B<-volume> I<volume(s) to restore> [I<volume(s) to restore> ...]
177
178 Names one or more volumes to restore, using the volume name as
179 listed in the Backup Database. Provide the base (read/write)
180 name of each volume to have the Backup System search the Backup
181 Database for the newest dump set that includes a dump of either
182 the read/write or the backup version of the volume; it restores
183 the dumps of that version of the volume, starting with the most
184 recent full dump. If, in contrast, a volume name explicitly
185 includes the C<.backup> or C<.readonly> extension, the Backup System
186 restores dumps of the corresponding volume version only.
187
188 =item B<-extension> I<new volume name extension>
189
190 Creates a new volume to house the restored data, with a name
191 derived by appending the specified string to each volume named
192 by the B<-volume> argument. The Backup System creates a new VLDB
193 entry for the volume. Any string other than C<.readonly> or
194 C<.backup> is acceptable, but the combination of the existing
195 volume name and extension cannot exceed 22 characters in
196 length. To use a period to separate the extension from the
197 name, specify it as the first character of the string (as in
198 C<.rst>, for example).
199
200 =item B<-date> I<date from which to restore> ...
201
202 Specifies a date and optionally time; the restored volume
203 includes data from dumps performed before the date only.
204 Provide a value in the format I<mm>/I<dd>/I<yyyy> [I<hh>:I<MM>], where the
205 required I<mm>/I<dd>/I<yyyy> portion indicates the month (I<mm>), day (I<dd>),
206 and year (I<yyyy>), and the optional I<hh>:I<MM> portion indicates the
207 hour and minutes in 24-hour format (for example, the value
208 B<14:36> represents 2:36 p.m.). If omitted, the time defaults to
209 59 seconds after midnight (00:00:59 hours).
210
211 Valid values for the year range from B<1970> to B<2037>; higher
212 values are not valid because the latest possible date in the
213 standard UNIX representation is in February 2038. The command
214 interpreter automatically reduces any later date to the maximum
215 value.
216
217 If this argument is omitted, the Backup System restores all
218 possible dumps including the most recently created.
219
220 =over
221
222 =item B<Note:>
223
224 A plus sign follows this argument in the command's syntax
225 statement because it accepts a multiword value which does not need to
226 be enclosed in double quotes or other delimiters, not because it
227 accepts multiple dates. Provide only one date (and optionally, time)
228 definition.
229
230 =back
231
232 =item B<-portoffset> I<TC port offsets> [I<TC port offsets> ...]
233
234 Specifies one or more port offset numbers (up to a maximum of
235 128), each corresponding to a Tape Coordinator to use in the
236 operation. If there is more than one value, the Backup System
237 uses the first one when restoring the full dump of each volume,
238 the second one when restoring the level 1 incremental dump of
239 each volume, and so on. It uses the final value in the list
240 when restoring dumps at the corresponding depth in the dump
241 hierarchy and all dumps at lower levels.
242
243 Provide this argument unless the default value of 0 (zero) is
244 appropriate for all dumps. If B<0> is just one of the values in
245 the list, provide it explicitly in the appropriate order.
246
247 =item B<-n>
248
249 Displays the list of tapes that contain the dumps required by
250 the restore operation, without actually performing the
251 operation.
252
253 =item B<-localauth>
254
255 Constructs a server ticket using a key from the local
256 B</usr/afs/etc/KeyFile> file. The C<backup> command interpreter
257 presents it to the Backup Server, Volume Server and VL Server
258 during mutual authentication. Do not combine this flag with the
259 B<-cell> argument. For more details, see the introductory L<backup(1)>
260 reference page.
261
262 =item B<-cell> I<cell name>
263
264 Names the cell in which to run the command. Do not combine this
265 argument with the B<-localauth> flag. For more details, see the
266 introductory L<backup(1)> reference page.
267
268 =item B<-help>
269
270 Prints the online help for this command. All other valid
271 options are ignored.
272
273 =back
274
275 =head1 OUTPUT
276
277 If the issuer includes the B<-n> flag with the command, the following
278 string appears at the head of the list of the tapes necessary to
279 complete the restore operation.
280
281 Tapes needed:
282
283 =head1 EXAMPLES
284
285 The following command restores the volume B<user.pat> to partition
286 B</vicepa> on machine B<fs5.abc.com>:
287
288     backup volrestore -server fs5.abc.com -partition a -volume user.pat
289
290 The following command restores the volumes B<user.smith> and B<user.terry>
291 to partition B</vicepb> on machine B<fs4.abc.com>, adding a B<.rst> extension
292 to each volume name and preserving the existing B<user.smith> and
293 B<user.terry> volumes. Only dumps created before 5:00 p.m. on 31 January
294 1998 are restored. (The command is shown here on multiple lines only
295 for legibility reasons.)
296
297     backup volrestore -server fs4.abc.com -partition b  \
298                       -volume user.smith user.terry  \
299                       -extension .rst -date 1/31/1998 17:00
300
301 The following command restores the volume B<user.pat> to partition
302 B</vicepb> on machine B<fs4.abc.com>. The Tape Coordinator with port offset
303 1 handles the tape containing the full dump; the Tape Coordinator with
304 port offset 0 handles all tapes containing incremental dumps. (The
305 command is shown here on two lines only for legibility reasons.)
306
307     backup volrestore -server fs5.abc.com -partition a  \
308                       -volume user.pat -portoffset 1 0
309
310 =head1 PRIVILEGE REQUIRED
311
312 The issuer must be listed in the B</usr/afs/etc/UserList> file on every
313 machine where the Backup Server or Volume Location (VL) Server is
314 running, and on every file server machine that houses an affected
315 volume. If the B<-localauth> flag is included, the issuer must instead be
316 logged on to a server machine as the local superuser B<root>.
317
318 =head1 COPYRIGHT
319
320 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
321
322 Converted from html to pod by Alf Wachsmann <alfw@slac.stanford.edu>, 2003,
323 and Elizabeth Cassell <e_a_c@mailsnare.net>, 2004,
324 Stanford Linear Accelerator Center, a department of Stanford University.
325
326 =head1 SEE ALSO
327
328 L<backup(1)>,
329 L<backup_dump(1)>,
330 L<backup_diskrestore(1)>,
331 L<backup_volsetrestore(1)>,
332 L<butc(1)>,
333 L<vos_backup(1)>,
334 L<vos_remove(1)>
335
336 =cut