Whamcloud - gitweb
LUDOC-394 manual: Remove extra 'held' word
[doc/manual.git] / ZFSSnapshots.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <chapter xmlns="http://docbook.org/ns/docbook"
3  xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US"
4  xml:id="zfssnapshots" condition='l2A'>
5   <title xml:id="zfssnapshots.title">Lustre ZFS Snapshots</title>
6   <para>This chapter describes the ZFS Snapshot feature support in Lustre and
7       contains following sections:</para>
8   <itemizedlist>
9     <listitem>
10       <para><xref linkend="zfssnapshotIntro"/></para>
11     </listitem>
12     <listitem>
13       <para><xref linkend="zfssnapshotConfig"/></para>
14     </listitem>
15     <listitem>
16         <para><xref linkend="zfssnapshotOps"/></para>
17     </listitem>
18     <listitem>
19         <para><xref linkend="zfssnapshotBarrier"/></para>
20     </listitem>
21     <listitem>
22         <para><xref linkend="zfssnapshotLogs"/></para>
23     </listitem>
24     <listitem>
25         <para><xref linkend="zfssnapshotLustreLogs"/></para>
26     </listitem>
27   </itemizedlist>
28   <section xml:id="zfssnapshotIntro">
29       <title><indexterm><primary>Introduction</primary>
30       </indexterm>Introduction</title>
31       <para>Snapshots provide fast recovery of files from a previously created
32       checkpoint without recourse to an offline backup or remote replica.
33       Snapshots also provide a means to version-control storage, and can be used
34       to recover lost files or previous versions of files.</para>
35       <para>Filesystem snapshots are intended to be mounted on user-accessible
36       nodes, such as login nodes, so that users can restore files (e.g. after
37       accidental delete or overwrite) without administrator intervention.  It
38       would be possible to mount the snapshot filesystem(s) via automount when
39       users access them, rather than mounting all snapshots, to reduce overhead
40       on login nodes when the snapshots are not in use.</para>
41       <para>Recovery of lost files from a snapshot is usually considerably
42       faster than from any offline backup or remote replica. However, note that
43       snapshots do not improve storage reliability and are just as exposed to
44       hardware failure as any other storage volume.</para>
45       <section xml:id="zfssnapshotsReq">
46           <title><indexterm><primary>Introduction</primary>
47               <secondary>Requirements</secondary></indexterm>Requirements
48           </title>
49           <para>All Lustre server targets must be ZFS file systems running
50           Lustre version 2.10 or later.  In addition, the MGS must be able to
51           communicate via ssh or another remote access protocol, without
52           password authentication, to all other servers.</para>
53           <para>The feature is enabled by default and cannot be disabled.  The
54           management of snapshots is done through <literal>lctl</literal>
55           commands on the MGS.</para>
56           <para>Lustre snapshot is based on Copy-On-Write; the snapshot and file
57           system may share a single copy of the data until a file is changed on
58           the file system.  The snapshot will prevent the space of deleted or
59           overwritten files from being released until the snapshot(s)
60           referencing those files is deleted.  The file system administrator
61           needs to establish a snapshot create/backup/remove policy according to
62           their system’s actual size and usage.</para>
63       </section>
64   </section>
65   <section xml:id="zfssnapshotConfig">
66         <title><indexterm><primary>feature overview</primary>
67             <secondary>configuration</secondary></indexterm>Configuration
68         </title>
69         <para>The snapshot tool loads system configuration from the
70         <literal>/etc/ldev.conf</literal> file on the MGS and calls related
71         ZFS commands to maintian the Lustre snapshot pieces on all targets
72         (MGS/MDT/OST).  Please note that the <literal>/etc/ldev.conf</literal>
73         file is used for other purposes as well.</para>
74         <para>The format of the file is:</para>
75         <screen>&lt;host&gt; foreign/- &lt;label&gt; &lt;device&gt; [journal-path]/- [raidtab]</screen>
76         <para>The format of <literal>&lt;label&gt;</literal> is:</para>
77         <screen>fsname-&lt;role&gt;&lt;index&gt; or &lt;role&gt;&lt;index&gt;</screen>
78         <para>The format of &lt;device&gt; is:</para>
79         <screen>[md|zfs:][pool_dir/]&lt;pool&gt;/&lt;filesystem&gt;</screen>
80         <para>Snapshot only uses the fields &lt;host&gt;, &lt;label&gt; and
81         &lt;device&gt;.</para>
82         <para>Example:</para>
83         <screen>mgs# cat /etc/ldev.conf
84 host-mdt1 - myfs-MDT0000 zfs:/tmp/myfs-mdt1/mdt1
85 host-mdt2 - myfs-MDT0001 zfs:myfs-mdt2/mdt2
86 host-ost1 - OST0000 zfs:/tmp/myfs-ost1/ost1
87 host-ost2 - OST0001 zfs:myfs-ost2/ost2</screen>
88         <para>The configuration file is edited manually.</para>
89         <para> Once the configuration file is updated to reflect the current
90         file system setup, you are ready to create a file system snapshot.
91         </para>
92   </section>
93   <section xml:id="zfssnapshotOps">
94       <title><indexterm><primary>operations</primary>
95       </indexterm>Snapshot Operations</title>
96   <section xml:id="zfssnapshotCreate">
97       <title><indexterm><primary>operations</primary>
98           <secondary>create</secondary></indexterm>Creating a Snapshot
99       </title>
100       <para>To create a snapshot of an existing Lustre file system, run the
101       following <literal>lctl</literal> command on the MGS:</para>
102       <screen>lctl snapshot_create [-b | --barrier [on | off]] [-c | --comment
103 comment] -F | --fsname fsname> [-h | --help] -n | --name ssname>
104 [-r | --rsh remote_shell][-t | --timeout timeout]</screen>
105       <informaltable frame="all">
106           <tgroup cols="2">
107               <colspec colname="c1" colwidth="50*"/>
108               <colspec colname="c2" colwidth="50*"/>
109               <thead>
110                   <row>
111                       <entry>
112                           <para><emphasis role="bold">Option</emphasis></para>
113                       </entry>
114                       <entry>
115                           <para><emphasis role="bold">Description</emphasis></para>
116                       </entry>
117                   </row>
118               </thead>
119               <tbody>
120                   <row>
121                       <entry>
122                           <para> <literal>-b</literal></para>
123                       </entry>
124                       <entry>
125                           <para>set write barrier before creating snapshot.  The
126                           default value is 'on'.</para>
127                       </entry>
128                   </row>
129                   <row>
130                       <entry>
131                           <para> <literal>-c</literal></para>
132                       </entry>
133                       <entry>
134                           <para>a description for the purpose of the snapshot
135                           </para>
136                       </entry>
137                   </row>
138                   <row>
139                       <entry>
140                           <para> <literal>-F</literal></para>
141                       </entry>
142                       <entry>
143                           <para>the filesystem name</para>
144                       </entry>
145                   </row>
146                   <row>
147                       <entry>
148                           <para> <literal>-h</literal></para>
149                       </entry>
150                       <entry>
151                           <para>help information</para>
152                       </entry>
153                   </row>
154                   <row>
155                       <entry>
156                           <para> <literal>-n</literal></para>
157                       </entry>
158                       <entry>
159                           <para>the name of the snapshot</para>
160                       </entry>
161                   </row>
162                   <row>
163                       <entry>
164                           <para> <literal>-r</literal></para>
165                       </entry>
166                       <entry>
167                           <para>the remote shell used for communication with
168                           remote target.  The default value is 'ssh'</para>
169                       </entry>
170                   </row>
171                   <row>
172                       <entry>
173                           <para> <literal>-t</literal></para>
174                       </entry>
175                       <entry>
176                           <para>the lifetime (seconds) for write barrier.  The
177                           default value is 30 seconds</para>
178                       </entry>
179                   </row>
180               </tbody>
181           </tgroup>
182       </informaltable>
183   </section>
184   <section xml:id="zfssnapshotDelete">
185       <title><indexterm><primary>operations</primary>
186           <secondary>delete</secondary></indexterm>Delete a Snapshot
187       </title>
188       <para>To delete an existing snapshot, run the following
189       <literal>lctl</literal> command on the MGS:</para>
190       <screen>lctl snapshot_destroy [-f | --force] &lt;-F | --fsname fsname&gt;
191 &lt;-n | --name ssname&gt; [-r | --rsh remote_shell]</screen>
192       <informaltable frame="all">
193           <tgroup cols="2">
194               <colspec colname="c1" colwidth="50*"/>
195               <colspec colname="c2" colwidth="50*"/>
196               <thead>
197                   <row>
198                       <entry>
199                           <para><emphasis role="bold">Option</emphasis></para>
200                       </entry>
201                       <entry>
202                           <para><emphasis role="bold">Description</emphasis>
203                           </para>
204                       </entry>
205                   </row>
206               </thead>
207               <tbody>
208                   <row>
209                       <entry>
210                           <para> <literal>-f</literal></para>
211                       </entry>
212                       <entry>
213                           <para>destroy the snapshot by force</para>
214                       </entry>
215                   </row>
216                   <row>
217                       <entry>
218                           <para> <literal>-F</literal></para>
219                       </entry>
220                       <entry>
221                           <para>the filesystem name</para>
222                       </entry>
223                   </row>
224                   <row>
225                       <entry>
226                           <para> <literal>-h</literal></para>
227                       </entry>
228                       <entry>
229                           <para>help information</para>
230                       </entry>
231                   </row>
232                   <row>
233                       <entry>
234                           <para> <literal>-n</literal></para>
235                       </entry>
236                       <entry>
237                           <para>the name of the snapshot</para>
238                       </entry>
239                   </row>
240                   <row>
241                       <entry>
242                           <para> <literal>-r</literal></para>
243                       </entry>
244                       <entry>
245                           <para>the remote shell used for communication with
246                               remote target.  The default value is 'ssh'</para>
247                       </entry>
248                   </row>
249               </tbody>
250           </tgroup>
251       </informaltable>
252   </section>
253   <section xml:id="zfssnapshotMount">
254       <title><indexterm><primary>operations</primary>
255           <secondary>mount</secondary></indexterm>Mounting a Snapshot
256       </title>
257       <para>Snapshots are treated as separate file systems and can be mounted on
258       Lustre clients. The snapshot file system must be mounted as a
259       read-only file system with the <literal>-o ro</literal> option.
260       If the <literal>mount</literal> command does not include the read-only
261       option, the mount will fail.</para>
262       <note><para>Before a snapshot can be mounted on the client, the snapshot
263       must first be mounted on the servers using the <literal>lctl</literal>
264       utility.</para></note>
265       <para>To mount a snapshot on the server, run the following lctl command
266       on the MGS:</para>
267       <screen>lctl snapshot_mount &lt;-F | --fsname fsname&gt; [-h | --help]
268 &lt;-n | --name ssname&gt; [-r | --rsh remote_shell]</screen>
269       <informaltable frame="all">
270           <tgroup cols="2">
271               <colspec colname="c1" colwidth="50*"/>
272               <colspec colname="c2" colwidth="50*"/>
273               <thead>
274                   <row>
275                       <entry>
276                           <para><emphasis role="bold">Option</emphasis></para>
277                       </entry>
278                       <entry>
279                           <para><emphasis role="bold">Description</emphasis>
280                           </para>
281                       </entry>
282                   </row>
283               </thead>
284               <tbody>
285                   <row>
286                       <entry>
287                           <para> <literal>-F</literal></para>
288                       </entry>
289                       <entry>
290                           <para>the filesystem name</para>
291                       </entry>
292                   </row>
293                   <row>
294                       <entry>
295                           <para> <literal>-h</literal></para>
296                       </entry>
297                       <entry>
298                           <para>help information</para>
299                       </entry>
300                   </row>
301                   <row>
302                       <entry>
303                           <para> <literal>-n</literal></para>
304                       </entry>
305                       <entry>
306                           <para>the name of the snapshot</para>
307                       </entry>
308                   </row>
309                   <row>
310                       <entry>
311                           <para> <literal>-r</literal></para>
312                       </entry>
313                       <entry>
314                           <para>the remote shell used for communication with
315                               remote target.  The default value is 'ssh'</para>
316                       </entry>
317                   </row>
318               </tbody>
319           </tgroup>
320       </informaltable>
321       <para>After the successful mounting of the snapshot on the server, clients
322       can now mount the snapshot as a read-only filesystem.  For example, to
323       mount a snapshot named <replaceable>snapshot_20170602</replaceable> for a
324       filesystem named <replaceable>myfs</replaceable>, the following mount
325       command would be used:</para>
326       <screen>mgs# lctl snapshot_mount -F myfs -n snapshot_20170602</screen>
327       <para>After mounting on the server, use
328       <literal>lctl snapshot_list</literal> to get the fsname for the snapshot
329       itself as follows:</para>
330       <screen>ss_fsname=$(lctl snapshot_list -F myfs -n snapshot_20170602 |
331           awk '/^snapshot_fsname/ { print $2 }')</screen>
332       <para>Finally, mount the snapshot on the client:</para>
333       <screen>mount -t lustre -o ro $MGS_nid:/$ss_fsname $local_mount_point</screen>
334   </section>
335   <section xml:id="zfssnapshotUnmount">
336       <title><indexterm><primary>operations</primary>
337           <secondary>unmount</secondary></indexterm>Unmounting a Snapshot
338       </title>
339       <para>To unmount a snapshot from the servers, first unmount the snapshot
340       file system from all clients, using the standard <literal>umount</literal>
341       command on each client.  For example, to unmount the snapshot file system
342       named <replaceable>snapshot_20170602</replaceable> run the following
343       command on each client that has it mounted:</para>
344       <screen>client# umount $local_mount_point</screen>
345       <para>After all clients have unmounted the snapshot file system, run the
346       following <literal>lctl</literal>command on a server node where the
347       snapshot is mounted:</para>
348       <screen>lctl snapshot_umount [-F | --fsname fsname] [-h | --help]
349 &lt;-n | -- name ssname&gt; [-r | --rsh remote_shell]</screen>
350       <informaltable frame="all">
351           <tgroup cols="2">
352               <colspec colname="c1" colwidth="50*"/>
353               <colspec colname="c2" colwidth="50*"/>
354               <thead>
355                   <row>
356                       <entry>
357                           <para><emphasis role="bold">Option</emphasis></para>
358                       </entry>
359                       <entry>
360                           <para><emphasis role="bold">Description</emphasis>
361                           </para>
362                       </entry>
363                   </row>
364               </thead>
365               <tbody>
366                   <row>
367                       <entry>
368                           <para> <literal>-F</literal></para>
369                       </entry>
370                       <entry>
371                           <para>the filesystem name</para>
372                       </entry>
373                   </row>
374                   <row>
375                       <entry>
376                           <para> <literal>-h</literal></para>
377                       </entry>
378                       <entry>
379                           <para>help information</para>
380                       </entry>
381                   </row>
382                   <row>
383                       <entry>
384                           <para> <literal>-n</literal></para>
385                       </entry>
386                       <entry>
387                           <para>the name of the snapshot</para>
388                       </entry>
389                   </row>
390                   <row>
391                       <entry>
392                           <para> <literal>-r</literal></para>
393                       </entry>
394                       <entry>
395                           <para>the remote shell used for communication with
396                               remote target.  The default value is 'ssh'</para>
397                       </entry>
398                   </row>
399               </tbody>
400           </tgroup>
401       </informaltable>
402       <para>For example:</para>
403       <screen>lctl snapshot_umount -F myfs -n snapshot_20170602</screen>
404   </section>
405   <section xml:id="zfssnapshotList">
406       <title><indexterm><primary>operations</primary>
407           <secondary>list</secondary></indexterm>List Snapshots
408       </title>
409       <para>To list the available snapshots for a given file system, use the
410           following <literal>lctl</literal> command on the MGS:</para>
411       <screen>lctl snapshot_list [-d | --detail] &lt;-F | --fsname fsname&gt;
412 [-h | -- help] [-n | --name ssname] [-r | --rsh remote_shell]</screen>
413       <informaltable frame="all">
414           <tgroup cols="2">
415               <colspec colname="c1" colwidth="50*"/>
416               <colspec colname="c2" colwidth="50*"/>
417               <thead>
418                   <row>
419                       <entry>
420                           <para><emphasis role="bold">Option</emphasis></para>
421                       </entry>
422                       <entry>
423                           <para><emphasis role="bold">Description</emphasis>
424                           </para>
425                       </entry>
426                   </row>
427               </thead>
428               <tbody>
429                   <row>
430                       <entry>
431                           <para> <literal>-d</literal></para>
432                       </entry>
433                       <entry>
434                           <para>list every piece for the specified snapshot
435                           </para>
436                       </entry>
437                   </row>
438                   <row>
439                       <entry>
440                           <para> <literal>-F</literal></para>
441                       </entry>
442                       <entry>
443                           <para>the filesystem name</para>
444                       </entry>
445                   </row>
446                   <row>
447                       <entry>
448                           <para> <literal>-h</literal></para>
449                       </entry>
450                       <entry>
451                           <para>help information</para>
452                       </entry>
453                   </row>
454                   <row>
455                       <entry>
456                           <para> <literal>-n</literal></para>
457                       </entry>
458                       <entry>
459                           <para>the snapshot's name. If the snapshot name is not
460                           supplied, all snapshots for this file system will be
461                           displayed</para>
462                       </entry>
463                   </row>
464                   <row>
465                       <entry>
466                           <para> <literal>-r</literal></para>
467                       </entry>
468                       <entry>
469                           <para>the remote shell used for communication with
470                               remote target.  The default value is 'ssh'</para>
471                       </entry>
472                   </row>
473               </tbody>
474           </tgroup>
475       </informaltable>
476   </section>
477   <section xml:id="zfssnapshotModify">
478       <title><indexterm><primary>operations</primary>
479           <secondary>modify</secondary></indexterm>Modify Snapshot Attributes
480       </title>
481       <para>Currently, Lustre snapshot has five user visible attributes;
482       snapshot name, snapshot comment, create time, modification time, and
483       snapshot file system name. Among them, the former two attributes can be
484       modified. Renaming follows the general ZFS snapshot name rules, such as
485       the maximum length is 256 bytes, cannot conflict with the reserved names,
486       and so on.</para>
487       <para>To modify a snapshot’s attributes, use the following
488       <literal>lctl</literal> command on the MGS:</para>
489       <screen>lctl snapshot_modify [-c | --comment comment]
490 &lt;-F | --fsname fsname&gt; [-h | --help] &lt;-n | --name ssname&gt;
491 [-N | --new new_ssname] [-r | --rsh remote_shell]</screen>
492       <informaltable frame="all">
493           <tgroup cols="2">
494               <colspec colname="c1" colwidth="50*"/>
495               <colspec colname="c2" colwidth="50*"/>
496               <thead>
497                   <row>
498                       <entry>
499                           <para><emphasis role="bold">Option</emphasis></para>
500                       </entry>
501                       <entry>
502                           <para><emphasis role="bold">Description</emphasis>
503                           </para>
504                       </entry>
505                   </row>
506               </thead>
507               <tbody>
508                   <row>
509                       <entry>
510                           <para> <literal>-c</literal></para>
511                       </entry>
512                       <entry>
513                           <para>update the snapshot's comment</para>
514                       </entry>
515                   </row>
516                   <row>
517                       <entry>
518                           <para> <literal>-F</literal></para>
519                       </entry>
520                       <entry>
521                           <para>the filesystem name</para>
522                       </entry>
523                   </row>
524                   <row>
525                       <entry>
526                           <para> <literal>-h</literal></para>
527                       </entry>
528                       <entry>
529                           <para>help information</para>
530                       </entry>
531                   </row>
532                   <row>
533                       <entry>
534                           <para> <literal>-n</literal></para>
535                       </entry>
536                       <entry>
537                           <para>the snapshot's name</para>
538                       </entry>
539                   </row>
540                   <row>
541                       <entry>
542                           <para> <literal>-N</literal></para>
543                       </entry>
544                       <entry>
545                           <para>rename the snapshot's name as
546                           <replaceable>new_ssname</replaceable></para>
547                       </entry>
548                   </row>
549                   <row>
550                       <entry>
551                           <para> <literal>-r</literal></para>
552                       </entry>
553                       <entry>
554                           <para>the remote shell used for communication with
555                               remote target.  The default value is 'ssh'</para>
556                       </entry>
557                   </row>
558               </tbody>
559           </tgroup>
560       </informaltable>
561   </section>
562   </section>
563   <section xml:id="zfssnapshotBarrier">
564       <title><indexterm><primary>barrier</primary>
565       </indexterm>Global Write Barriers</title>
566       <para>Snapshots are non-atomic across multiple MDTs and OSTs, which means
567       that if there is activity on the file system while a snapshot is being
568       taken, there may be user-visible namespace inconsistencies with files
569       created or destroyed in the interval between the MDT and OST snapshots.
570       In order to create a consistent snapshot of the file system, we are able
571       to set a global write barrier, or “freeze” the system. Once set, all
572       metadata modifications will be blocked until the write barrier is actively
573       removed (“thawed”) or expired. The user can set a timeout parameter on a
574       global barrier or the barrier can be explicitly removed. The default
575       timeout period is 30 seconds.</para>
576       <para>It is important to note that snapshots are usable without the global
577       barrier.  Only files that are currently being modified by clients (write,
578       create, unlink) may be inconsistent as noted above if the barrier is not
579       used.  Other files not curently being modified would be usable even
580       without the barrier.</para>
581       <para>The snapshot create command will call the write barrier internally
582       when requested using the <literal>-b</literal> option to
583       <literal>lctl snapshot_create</literal>. So, explicit use of the barrier
584       is not required when using snapshots but included here as an option to
585       quiet the file system before a snapshot is created.</para>
586       <section xml:id="zfssnapshotBarrierImpose">
587           <title><indexterm><primary>barrier</primary>
588               <secondary>impose</secondary></indexterm>Impose Barrier
589           </title>
590           <para>To impose a global write barrier, run the
591           <literal>lctl barrier_freeze</literal> command on the MGS:</para>
592           <screen>lctl barrier_freeze &lt;fsname&gt; [timeout (in seconds)]
593 where timeout default is 30.</screen>
594           <para>For example, to freeze the filesystem
595           <replaceable>testfs</replaceable> for <literal>15</literal> seconds:
596           </para>
597           <screen>mgs# lctl barrier_freeze testfs 15</screen>
598           <para>If the command is successful, there will be no output from
599           the command.  Otherwise, an error message will be printed.</para>
600       </section>
601       <section xml:id="zfssnapshotBarrierRemove">
602           <title><indexterm><primary>barrier</primary>
603                   <secondary>remove</secondary></indexterm>Remove Barrier
604               </title>
605           <para>To remove a global write barrier, run the
606           <literal>lctl barrier_thaw</literal> command on the MGS:</para>
607           <screen>lctl barrier_thaw &lt;fsname&gt;</screen>
608           <para>For example, to thaw the write barrier for the filesystem
609               <replaceable>testfs</replaceable>:
610           </para>
611           <screen>mgs# lctl barrier_thaw testfs</screen>
612           <para>If the command is successful, there will be no output from
613               the command.  Otherwise, an error message will be printed.</para>
614       </section>
615       <section xml:id="zfssnapshotBarrierQuery">
616           <title><indexterm><primary>barrier</primary>
617               <secondary>query</secondary></indexterm>Query Barrier
618           </title>
619           <para>To see how much time is left on a global write barrier, run the
620           <literal>lctl barrier_stat</literal> command on the MGS:</para>
621           <screen># lctl barrier_stat &lt;fsname&gt;</screen>
622           <para>For example, to stat the write barrier for the filesystem
623               <replaceable>testfs</replaceable>:
624           </para>
625           <screen>mgs# lctl barrier_stat testfs
626 The barrier for testfs is in 'frozen'
627 The barrier will be expired after 7 seconds</screen>
628           <para>If the command is successful, a status from the table below
629           will be printed.  Otherwise, an error message will be printed.</para>
630           <para>The possible status and related meanings for the write barrier
631           are as follows:</para>
632           <table frame="all" xml:id="writebarrierstatus.tab1">
633               <title>Write Barrier Status</title>
634               <tgroup cols="2">
635                   <colspec colname="c1" colwidth="50*"/>
636                   <colspec colname="c2" colwidth="50*"/>
637                   <thead>
638                       <row>
639                           <entry>
640                               <para><emphasis role="bold">Status</emphasis>
641                               </para>
642                           </entry>
643                           <entry>
644                               <para><emphasis role="bold">Meaning</emphasis>
645                               </para>
646                           </entry>
647                       </row>
648                   </thead>
649                   <tbody>
650                       <row>
651                           <entry>
652                               <para> <literal>init</literal></para>
653                           </entry>
654                           <entry>
655                               <para>barrier has never been set on the system
656                               </para>
657                           </entry>
658                       </row>
659                       <row>
660                           <entry>
661                               <para> <literal>freezing_p1</literal></para>
662                           </entry>
663                           <entry>
664                               <para>In the first stage of setting the write
665                               barrier</para>
666                           </entry>
667                       </row>
668                       <row>
669                           <entry>
670                               <para> <literal>freezing_p2</literal></para>
671                           </entry>
672                           <entry>
673                               <para> the second stage of setting the write
674                               barrier</para>
675                           </entry>
676                       </row>
677                       <row>
678                           <entry>
679                               <para> <literal>frozen</literal></para>
680                           </entry>
681                           <entry>
682                               <para>the write barrier has been set successfully
683                               </para>
684                           </entry>
685                       </row>
686                       <row>
687                           <entry>
688                               <para> <literal>thawing</literal></para>
689                           </entry>
690                           <entry>
691                               <para>In thawing the write barrier</para>
692                           </entry>
693                       </row>
694                       <row>
695                           <entry>
696                               <para> <literal>thawed</literal></para>
697                           </entry>
698                           <entry>
699                               <para>The write barrier has been thawed</para>
700                           </entry>
701                       </row>
702                       <row>
703                           <entry>
704                               <para> <literal>failed</literal></para>
705                           </entry>
706                           <entry>
707                               <para>Failed to set write barrier</para>
708                           </entry>
709                       </row>
710                       <row>
711                           <entry>
712                               <para> <literal>expired</literal></para>
713                           </entry>
714                           <entry>
715                               <para>The write barrier is expired</para>
716                           </entry>
717                       </row>
718                       <row>
719                           <entry>
720                               <para> <literal>rescan</literal></para>
721                           </entry>
722                           <entry>
723                               <para>In scanning the MDTs status, see the command
724                               <literal>barrier_rescan</literal></para>
725                           </entry>
726                       </row>
727                       <row>
728                           <entry>
729                               <para> <literal>unknown</literal></para>
730                           </entry>
731                           <entry>
732                               <para>Other cases</para>
733                           </entry>
734                       </row>
735                   </tbody>
736               </tgroup>
737           </table>
738           <para>If the barrier is in ’freezing_p1’, ’freezing_p2’ or ’frozen’
739           status, then the remaining lifetime will be returned also.</para>
740       </section>
741       <section xml:id="zfssnapshotBarrierRescan">
742           <title><indexterm><primary>barrier</primary>
743               <secondary>rescan</secondary></indexterm>Rescan Barrier
744           </title>
745           <para> To rescan a global write barrier to check which MDTs are
746           active, run the <literal>lctl barrier_rescan</literal> command on the
747           MGS:</para>
748           <screen>lctl barrier_rescan &lt;fsname&gt; [timeout (in seconds)],
749 where the default timeout is 30 seconds.</screen>
750           <para>For example, to rescan the barrier for filesystem
751           <replaceable>testfs</replaceable>:</para>
752           <screen>mgs# lctl barrier_rescan testfs
753 1 of 4 MDT(s) in the filesystem testfs are inactive</screen>
754           <para>If the command is successful, the number of MDTs that are
755           unavailable against the total MDTs will be reported.  Otherwise, an
756           error message will be printed.</para>
757       </section>
758   </section>
759   <section xml:id="zfssnapshotLogs">
760       <title><indexterm><primary>logs</primary>
761       </indexterm>Snapshot Logs</title>
762       <para>A log of all snapshot activity can be found in the following file:
763       <literal>/var/log/lsnapshot.log</literal>.  This file contains information
764       on when a snapshot was created, an attribute was changed, when it was
765       mounted, and other snapshot information.</para>
766       <para>The following is a sample <literal>/var/log/lsnapshot</literal>
767       file:</para>
768       <screen>Mon Mar 21 19:43:06 2016
769 (15826:jt_snapshot_create:1138:scratch:ssh): Create snapshot lss_0_0
770 successfully with comment &lt;(null)&gt;, barrier &lt;enable&gt;, timeout &lt;30&gt;
771 Mon Mar 21 19:43:11 2016(13030:jt_snapshot_create:1138:scratch:ssh):
772 Create snapshot lss_0_1 successfully with comment &lt;(null)&gt;, barrier
773 &lt;disable&gt;, timeout &lt;-1&gt;
774 Mon Mar 21 19:44:38 2016 (17161:jt_snapshot_mount:2013:scratch:ssh):
775 The snapshot lss_1a_0 is mounted
776 Mon Mar 21 19:44:46 2016
777 (17662:jt_snapshot_umount:2167:scratch:ssh): the snapshot lss_1a_0
778 have been umounted
779 Mon Mar 21 19:47:12 2016
780 (20897:jt_snapshot_destroy:1312:scratch:ssh): Destroy snapshot
781 lss_2_0 successfully with force &lt;disable&gt;</screen>
782   </section>
783   <section xml:id="zfssnapshotLustreLogs">
784       <title><indexterm><primary>configlogs</primary>
785       </indexterm>Lustre Configuration Logs</title>
786       <para>A snapshot is independent from the original file system that it is
787       derived from and is treated as a new file system name that can be mounted
788       by Lustre client nodes. The file system name is part of the configuration
789       log names and exists in configuration log entries. Two commands exist to
790       manipulate configuration logs:  <literal>lctl fork_lcfg</literal> and
791       <literal>lctl erase_lcfg</literal>.</para>
792       <para>The snapshot commands will use configuration log functionality
793       internally when needed. So, use of the barrier is not required to use
794       snapshots but included here as an option. The following configuration log
795       commands are independent of snapshots and can be used independent of
796       snapshot use.</para>
797       <para>To fork a configuration log, run the following
798       <literal>lctl</literal> command on the MGS:</para>
799       <screen>lctl fork_lcfg</screen>
800       <para>Usage:  fork_lcfg &lt;fsname&gt; &lt;newname&gt;</para>
801       <para>To erase a configuration log, run the following
802       <literal>lctl</literal> command on the MGS:</para>
803       <screen>lctl erase_lcfg</screen>
804       <para>Usage:  erase_lcfg &lt;fsname&gt;</para>
805   </section>
806 </chapter>
807 <!--
808   vim:expandtab:shiftwidth=2:tabstop=8:
809   -->