Whamcloud - gitweb
Lustre 2.x Operations Manual as Docbook 5.0
[doc/manual.git] / TroubleShootingRecovery.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <article version="5.0" xml:lang="en-US" xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink">
3   <info>
4     <title>Troubleshooting Recovery</title>
5   </info>
6   <informaltable frame="none">
7     <tgroup cols="2">
8       <colspec colname="c1" colwidth="50*"/>
9       <colspec colname="c2" colwidth="50*"/>
10       
11       
12       <tbody>
13         <row>
14           <entry align="left"><para>Lustre 2.0 Operations Manual</para></entry>
15           <entry align="right" valign="top"><para><link xl:href="index.html"><inlinemediaobject><imageobject role="html">
16                     <imagedata contentdepth="26" contentwidth="30" fileref="./shared/toc01.gif" scalefit="1"/>
17                   </imageobject>
18 <imageobject role="fo">
19                     <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/toc01.gif" scalefit="1" width="100%"/>
20                   </imageobject>
21 </inlinemediaobject></link><link xl:href="LustreTroubleshooting.html"><inlinemediaobject><imageobject role="html">
22                     <imagedata contentdepth="26" contentwidth="30" fileref="./shared/prev01.gif" scalefit="1"/>
23                   </imageobject>
24 <imageobject role="fo">
25                     <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/prev01.gif" scalefit="1" width="100%"/>
26                   </imageobject>
27 </inlinemediaobject></link><link xl:href="LustreDebugging.html"><inlinemediaobject><imageobject role="html">
28                     <imagedata contentdepth="26" contentwidth="30" fileref="./shared/next01.gif" scalefit="1"/>
29                   </imageobject>
30 <imageobject role="fo">
31                     <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/next01.gif" scalefit="1" width="100%"/>
32                   </imageobject>
33 </inlinemediaobject></link><link xl:href="ix.html"><inlinemediaobject><imageobject role="html">
34                     <imagedata contentdepth="26" contentwidth="30" fileref="./shared/index01.gif" scalefit="1"/>
35                   </imageobject>
36 <imageobject role="fo">
37                     <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/index01.gif" scalefit="1" width="100%"/>
38                   </imageobject>
39 </inlinemediaobject></link></para></entry>
40         </row>
41       </tbody>
42     </tgroup>
43   </informaltable>
44   <para><link xl:href=""/></para>
45   <informaltable frame="none">
46     <tgroup cols="1">
47       <colspec colname="c1" colwidth="100*"/>
48       
49       <tbody>
50         <row>
51           <entry align="right"><para><anchor xml:id="dbdoclet.50438225_pgfId-874" xreflabel=""/>C H A P T E R  27<anchor xml:id="dbdoclet.50438225_33059" xreflabel=""/></para></entry>
52         </row>
53       </tbody>
54     </tgroup>
55   </informaltable>
56   <informaltable frame="none">
57     <tgroup cols="1">
58       <colspec colname="c1" colwidth="100*"/>
59       
60       <tbody>
61         <row>
62           <entry align="right"><para><anchor xml:id="dbdoclet.50438225_pgfId-5529" xreflabel=""/><anchor xml:id="dbdoclet.50438225_28147" xreflabel=""/>Troubleshooting Recovery</para></entry>
63         </row>
64       </tbody>
65     </tgroup>
66   </informaltable>
67   <para><anchor xml:id="dbdoclet.50438225_pgfId-1292105" xreflabel=""/>This chapter describes what to do if something goes wrong during recovery. It describes:</para>
68   <itemizedlist><listitem>
69       <para><anchor xml:id="dbdoclet.50438225_pgfId-1292704" xreflabel=""/><link xl:href="TroubleShootingRecovery.html#50438225_71141">Recovering from Errors or Corruption on a Backing File System</link></para>
70     </listitem>
71 <listitem>
72       <para> </para>
73     </listitem>
74 <listitem>
75       <para><anchor xml:id="dbdoclet.50438225_pgfId-1292709" xreflabel=""/><link xl:href="TroubleShootingRecovery.html#50438225_37365">Recovering from Corruption in the Lustre File System</link></para>
76     </listitem>
77 <listitem>
78       <para> </para>
79     </listitem>
80 <listitem>
81       <para><anchor xml:id="dbdoclet.50438225_pgfId-1292832" xreflabel=""/><link xl:href="TroubleShootingRecovery.html#50438225_12316">Recovering from an Unavailable OST</link></para>
82     </listitem>
83 <listitem>
84       <para> </para>
85     </listitem>
86 </itemizedlist>
87    <informaltable frame="none">
88     <tgroup cols="1">
89       <colspec colname="c1" colwidth="100*"/>
90       <tbody>
91         <row>
92           <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438225_pgfId-1292713" xreflabel=""/>For a description of how recovery is implemented in Lustre, see <link xl:href="LustreRecovery.html#50438268_71884">Chapter 30</link>: <link xl:href="TroubleShootingRecovery.html#50438225_28147">Troubleshooting Recovery</link>.</para></entry>
93         </row>
94       </tbody>
95     </tgroup>
96   </informaltable>
97    <section remap="h2">
98     <title><anchor xml:id="dbdoclet.50438225_pgfId-1292068" xreflabel=""/></title>
99     <section remap="h2">
100       <title>27.1 <anchor xml:id="dbdoclet.50438225_71141" xreflabel=""/>Recovering from Errors or <anchor xml:id="dbdoclet.50438225_marker-1292184" xreflabel=""/>Corruption on a Backing File System</title>
101       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291241" xreflabel=""/>When an OSS, MDS, or MGS server crash occurs, it is not necessary to run e2fsck on the file system. ldiskfs journaling ensures that the file system remains coherent. The backing file systems are never accessed directly from the client, so client crashes are not relevant.</para>
102       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291243" xreflabel=""/>The only time it is REQUIRED that e2fsck be run on a device is when an event causes problems that ldiskfs journaling is unable to handle, such as a hardware device failure or I/O error. If the ldiskfs kernel code detects corruption on the disk, it mounts the file system as read-only to prevent further corruption, but still allows read access to the device. This appears as error &quot;-30&quot; (EROFS) in the syslogs on the server, e.g.:</para>
103       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1291304" xreflabel=""/>Dec 29 14:11:32 mookie kernel: LDISKFS-fs error (device sdz): ldiskfs_looku\
104 p: unlinked inode 5384166 in dir #145170469
105 </screen>
106       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291325" xreflabel=""/>Dec 29 14:11:32 mookie kernel: Remounting filesystem read-only</para>
107       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291305" xreflabel=""/>In such a situation, it is normally required that e2fsck only be run on the bad device before placing the device back into service.</para>
108       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291245" xreflabel=""/>In the vast majority of cases, Lustre can cope with any inconsistencies it finds on the disk and between other devices in the file system.</para>
109       <informaltable frame="none">
110         <tgroup cols="1">
111           <colspec colname="c1" colwidth="100*"/>
112           <tbody>
113             <row>
114               <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438225_pgfId-1291247" xreflabel=""/>lfsck is rarely required for Lustre operation.</para></entry>
115             </row>
116           </tbody>
117         </tgroup>
118       </informaltable>
119       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291249" xreflabel=""/>For problem analysis, it is strongly recommended that e2fsck be run under a logger, like script, to record all of the output and changes that are made to the file system in case this information is needed later.</para>
120       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291251" xreflabel=""/>If time permits, it is also a good idea to first run e2fsck in non-fixing mode (-n option) to assess the type and extent of damage to the file system. The drawback is that in this mode, e2fsck does not recover the file system journal, so there may appear to be file system corruption when none really exists.</para>
121       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291253" xreflabel=""/>To address concern about whether corruption is real or only due to the journal not being replayed, you can briefly mount and unmount the ldiskfs filesystem directly on the node with Lustre stopped (NOT via Lustre), using a command similar to:</para>
122       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1291255" xreflabel=""/>mount -t ldiskfs /dev/{ostdev} /mnt/ost; umount /mnt/ost
123 </screen>
124       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291257" xreflabel=""/>This causes the journal to be recovered.</para>
125       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291259" xreflabel=""/>The e2fsck utility works well when fixing file system corruption (better than similar file system recovery tools and a primary reason why ldiskfs was chosen over other file systems for Lustre). However, it is often useful to identify the type of damage that has occurred so an ldiskfs expert can make intelligent decisions about what needs fixing, in place of e2fsck.</para>
126       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1291261" xreflabel=""/>root# {stop lustre services for this device, if running} 
127 <anchor xml:id="dbdoclet.50438225_pgfId-1291375" xreflabel=""/>root# script /tmp/e2fsck.sda 
128 <anchor xml:id="dbdoclet.50438225_pgfId-1291378" xreflabel=""/>Script started, file is /tmp/e2fsck.sda 
129 <anchor xml:id="dbdoclet.50438225_pgfId-1291381" xreflabel=""/>root# mount -t ldiskfs /dev/sda /mnt/ost 
130 <anchor xml:id="dbdoclet.50438225_pgfId-1291384" xreflabel=""/>root# umount /mnt/ost 
131 <anchor xml:id="dbdoclet.50438225_pgfId-1291387" xreflabel=""/>root# e2fsck -fn /dev/sda   # don&apos;t fix file system, just check for corrupt\
132 ion 
133 <anchor xml:id="dbdoclet.50438225_pgfId-1291268" xreflabel=""/>: 
134 <anchor xml:id="dbdoclet.50438225_pgfId-1291393" xreflabel=""/>[e2fsck output] 
135 <anchor xml:id="dbdoclet.50438225_pgfId-1291270" xreflabel=""/>: 
136 <anchor xml:id="dbdoclet.50438225_pgfId-1291399" xreflabel=""/>root# e2fsck -fp /dev/sda   # fix filesystem using &quot;prudent&quot; answers (usually\
137  &apos;y&apos;)
138 </screen>
139       <para><anchor xml:id="dbdoclet.50438225_pgfId-1291234" xreflabel=""/>In addition, the e2fsprogs package contains the lfsck tool, which does distributed coherency checking for the Lustre file system after e2fsck has been run. Running lfsck is NOT required in a large majority of cases, at a small risk of having some leaked space in the file system. To avoid a lengthy downtime, it can be run (with care) after Lustre is started.</para>
140     </section>
141     <section remap="h2">
142       <title>27.2 <anchor xml:id="dbdoclet.50438225_37365" xreflabel=""/>Recovering from <anchor xml:id="dbdoclet.50438225_marker-1292186" xreflabel=""/>Corruption in the Lustre File System</title>
143       <para><anchor xml:id="dbdoclet.50438225_pgfId-1289918" xreflabel=""/>In cases where the MDS or an OST becomes corrupt, you can run a distributed check on the file system to determine what sort of problems exist. Use lfsck to correct any defects found.</para>
144       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290095" xreflabel=""/> 1. Stop the Lustre file system.</para>
145       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290099" xreflabel=""/> 2. Run e2fsck -f on the individual MDS / OST that had problems to fix any local file system damage.</para>
146       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290108" xreflabel=""/>We recommend running e2fsck under script, to create a log of changes made to the file system in case it is needed later. After e2fsck is run, bring up the file system, if necessary, to reduce the outage window.</para>
147       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290111" xreflabel=""/> 3. Run a full e2fsck of the MDS to create a database for lfsck. You <emphasis>must</emphasis> use the -n option for a mounted file system, otherwise you will corrupt the file system.</para>
148       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1290120" xreflabel=""/>e2fsck -n -v --mdsdb /tmp/mdsdb /dev/{mdsdev}
149 </screen>
150       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290115" xreflabel=""/>The mdsdb file can grow fairly large, depending on the number of files in the file system (10 GB or more for millions of files, though the actual file size is larger because the file is sparse). It is quicker to write the file to a local file system due to seeking and small writes. Depending on the number of files, this step can take several hours to complete.</para>
151       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290147" xreflabel=""/><emphasis role="bold">Example</emphasis></para>
152       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1290148" xreflabel=""/>e2fsck -n -v --mdsdb /tmp/mdsdb /dev/sdb
153 <anchor xml:id="dbdoclet.50438225_pgfId-1290149" xreflabel=""/>e2fsck 1.39.cfs1 (29-May-2006)
154 <anchor xml:id="dbdoclet.50438225_pgfId-1290150" xreflabel=""/>Warning: skipping journal recovery because doing a read-only filesystem che\
155 ck.
156 <anchor xml:id="dbdoclet.50438225_pgfId-1290151" xreflabel=""/>lustre-MDT0000 contains a file system with errors, check forced.
157 <anchor xml:id="dbdoclet.50438225_pgfId-1290152" xreflabel=""/>Pass 1: Checking inodes, blocks, and sizes
158 <anchor xml:id="dbdoclet.50438225_pgfId-1290153" xreflabel=""/>MDS: ost_idx 0 max_id 288
159 <anchor xml:id="dbdoclet.50438225_pgfId-1290154" xreflabel=""/>MDS: got 8 bytes = 1 entries in lov_objids
160 <anchor xml:id="dbdoclet.50438225_pgfId-1290155" xreflabel=""/>MDS: max_files = 13
161 <anchor xml:id="dbdoclet.50438225_pgfId-1290156" xreflabel=""/>MDS: num_osts = 1
162 <anchor xml:id="dbdoclet.50438225_pgfId-1290157" xreflabel=""/>mds info db file written
163 <anchor xml:id="dbdoclet.50438225_pgfId-1290158" xreflabel=""/>Pass 2: Checking directory structure
164 <anchor xml:id="dbdoclet.50438225_pgfId-1290159" xreflabel=""/>Pass 3: Checking directory connectivity
165 <anchor xml:id="dbdoclet.50438225_pgfId-1290160" xreflabel=""/>Pass 4: Checking reference counts
166 <anchor xml:id="dbdoclet.50438225_pgfId-1290161" xreflabel=""/>Pass 5: Checking group summary information
167 <anchor xml:id="dbdoclet.50438225_pgfId-1290162" xreflabel=""/>Free blocks count wrong (656160, counted=656058).
168 <anchor xml:id="dbdoclet.50438225_pgfId-1290163" xreflabel=""/>Fix? no
169 <anchor xml:id="dbdoclet.50438225_pgfId-1290164" xreflabel=""/> 
170 <anchor xml:id="dbdoclet.50438225_pgfId-1290165" xreflabel=""/>Free inodes count wrong (786419, counted=786036).
171 <anchor xml:id="dbdoclet.50438225_pgfId-1290166" xreflabel=""/>Fix? no
172 <anchor xml:id="dbdoclet.50438225_pgfId-1290167" xreflabel=""/> 
173 <anchor xml:id="dbdoclet.50438225_pgfId-1290168" xreflabel=""/>Pass 6: Acquiring information for lfsck
174 <anchor xml:id="dbdoclet.50438225_pgfId-1290169" xreflabel=""/>MDS: max_files = 13
175 <anchor xml:id="dbdoclet.50438225_pgfId-1290170" xreflabel=""/>MDS: num_osts = 1
176 <anchor xml:id="dbdoclet.50438225_pgfId-1290171" xreflabel=""/>MDS: &apos;lustre-MDT0000_UUID&apos; mdt idx 0: compat 0x4 rocomp 0x1 incomp 0x4
177 <anchor xml:id="dbdoclet.50438225_pgfId-1290172" xreflabel=""/>lustre-MDT0000: ******* WARNING: Filesystem still has errors *******
178 <anchor xml:id="dbdoclet.50438225_pgfId-1290173" xreflabel=""/>   13 inodes used (0%)
179 <anchor xml:id="dbdoclet.50438225_pgfId-1290174" xreflabel=""/>           2 non-contiguous inodes (15.4%)
180 <anchor xml:id="dbdoclet.50438225_pgfId-1290175" xreflabel=""/>                   # of inodes with ind/dind/tind blocks: 0/0/0
181 <anchor xml:id="dbdoclet.50438225_pgfId-1290176" xreflabel=""/>130272 blocks used (16%)
182 <anchor xml:id="dbdoclet.50438225_pgfId-1290177" xreflabel=""/>   0 bad blocks
183 <anchor xml:id="dbdoclet.50438225_pgfId-1290178" xreflabel=""/>   1 large file
184 <anchor xml:id="dbdoclet.50438225_pgfId-1290179" xreflabel=""/>   296 regular files
185 <anchor xml:id="dbdoclet.50438225_pgfId-1290180" xreflabel=""/>   91 directories
186 <anchor xml:id="dbdoclet.50438225_pgfId-1290181" xreflabel=""/>   0 character device files
187 <anchor xml:id="dbdoclet.50438225_pgfId-1290182" xreflabel=""/>   0 block device files
188 <anchor xml:id="dbdoclet.50438225_pgfId-1290183" xreflabel=""/>   0 fifos
189 <anchor xml:id="dbdoclet.50438225_pgfId-1290184" xreflabel=""/>   0 links
190 <anchor xml:id="dbdoclet.50438225_pgfId-1290185" xreflabel=""/>   0 symbolic links (0 fast symbolic links)
191 <anchor xml:id="dbdoclet.50438225_pgfId-1290186" xreflabel=""/>   0 sockets
192 <anchor xml:id="dbdoclet.50438225_pgfId-1290187" xreflabel=""/>   --------
193 <anchor xml:id="dbdoclet.50438225_pgfId-1290188" xreflabel=""/>   387 files
194 </screen>
195       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290139" xreflabel=""/> 4. Make this file accessible on all OSTs, either by using a shared file system or copying the file to the OSTs. The pdcp command is useful here.</para>
196       <para><anchor xml:id="dbdoclet.50438225_pgfId-1289927" xreflabel=""/>The pdcp command (installed with pdsh), can be used to copy files to groups of hosts. Pdcp is available here:</para>
197       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290242" xreflabel=""/><link xl:href="http://sourceforge.net/projects/pdsh">http://sourceforge.net/projects/pdsh</link></para>
198       <para><anchor xml:id="dbdoclet.50438225_pgfId-1289928" xreflabel=""/> 5. Run a similar e2fsck step on the OSTs. The e2fsck --ostdb command can be run in parallel on all OSTs.</para>
199       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1290293" xreflabel=""/>e2fsck -n -v --mdsdb /tmp/mdsdb --ostdb /tmp/{ostNdb} \/dev/{ostNdev}
200 </screen>
201       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290266" xreflabel=""/>The mdsdb file is read-only in this step; a single copy can be shared by all OSTs.</para>
202       <informaltable frame="none">
203         <tgroup cols="1">
204           <colspec colname="c1" colwidth="100*"/>
205           <tbody>
206             <row>
207               <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438225_pgfId-1290279" xreflabel=""/>If the OSTs do not have shared file system access to the MDS, a stub mdsdb file, {mdsdb}.mdshdr, is generated. This can be used instead of the full mdsdb file.</para></entry>
208             </row>
209           </tbody>
210         </tgroup>
211       </informaltable>
212        <para><anchor xml:id="dbdoclet.50438225_pgfId-1292837" xreflabel=""/><emphasis role="bold">Example:</emphasis></para>
213       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1290319" xreflabel=""/>[root@oss161 ~]# e2fsck -n -v --mdsdb /tmp/mdsdb --ostdb \ /tmp/ostdb /dev/\
214 sda 
215 <anchor xml:id="dbdoclet.50438225_pgfId-1290349" xreflabel=""/>e2fsck 1.39.cfs1 (29-May-2006)
216 <anchor xml:id="dbdoclet.50438225_pgfId-1290321" xreflabel=""/>Warning: skipping journal recovery because doing a read-only filesystem che\
217 ck.
218 <anchor xml:id="dbdoclet.50438225_pgfId-1290322" xreflabel=""/>lustre-OST0000 contains a file system with errors, check forced.
219 <anchor xml:id="dbdoclet.50438225_pgfId-1290323" xreflabel=""/>Pass 1: Checking inodes, blocks, and sizes
220 <anchor xml:id="dbdoclet.50438225_pgfId-1290324" xreflabel=""/>Pass 2: Checking directory structure
221 <anchor xml:id="dbdoclet.50438225_pgfId-1290325" xreflabel=""/>Pass 3: Checking directory connectivity
222 <anchor xml:id="dbdoclet.50438225_pgfId-1290326" xreflabel=""/>Pass 4: Checking reference counts
223 <anchor xml:id="dbdoclet.50438225_pgfId-1290327" xreflabel=""/>Pass 5: Checking group summary information
224 <anchor xml:id="dbdoclet.50438225_pgfId-1290328" xreflabel=""/>Free blocks count wrong (989015, counted=817968).
225 <anchor xml:id="dbdoclet.50438225_pgfId-1290329" xreflabel=""/>Fix? no
226 <anchor xml:id="dbdoclet.50438225_pgfId-1290330" xreflabel=""/> 
227 <anchor xml:id="dbdoclet.50438225_pgfId-1290331" xreflabel=""/>Free inodes count wrong (262088, counted=261767).
228 <anchor xml:id="dbdoclet.50438225_pgfId-1290332" xreflabel=""/>Fix? no
229 <anchor xml:id="dbdoclet.50438225_pgfId-1290333" xreflabel=""/> 
230 <anchor xml:id="dbdoclet.50438225_pgfId-1290334" xreflabel=""/>Pass 6: Acquiring information for lfsck
231 <anchor xml:id="dbdoclet.50438225_pgfId-1290335" xreflabel=""/>OST: &apos;lustre-OST0000_UUID&apos; ost idx 0: compat 0x2 rocomp 0 incomp 0x2
232 <anchor xml:id="dbdoclet.50438225_pgfId-1290336" xreflabel=""/>OST: num files = 321
233 <anchor xml:id="dbdoclet.50438225_pgfId-1290337" xreflabel=""/>OST: last_id = 321
234 <anchor xml:id="dbdoclet.50438225_pgfId-1290338" xreflabel=""/> 
235 <anchor xml:id="dbdoclet.50438225_pgfId-1290358" xreflabel=""/>lustre-OST0000: ******* WARNING: Filesystem still has errors *******
236 <anchor xml:id="dbdoclet.50438225_pgfId-1290359" xreflabel=""/> 
237 <anchor xml:id="dbdoclet.50438225_pgfId-1290360" xreflabel=""/>   56 inodes used (0%)
238 <anchor xml:id="dbdoclet.50438225_pgfId-1290361" xreflabel=""/>   27 non-contiguous inodes (48.2%)
239 <anchor xml:id="dbdoclet.50438225_pgfId-1290362" xreflabel=""/>           # of inodes with ind/dind/tind blocks: 13/0/0
240 <anchor xml:id="dbdoclet.50438225_pgfId-1290363" xreflabel=""/>59561 blocks used (5%)
241 <anchor xml:id="dbdoclet.50438225_pgfId-1290364" xreflabel=""/>   0 bad blocks
242 <anchor xml:id="dbdoclet.50438225_pgfId-1290365" xreflabel=""/>   1 large file
243 <anchor xml:id="dbdoclet.50438225_pgfId-1290366" xreflabel=""/>   329 regular files
244 <anchor xml:id="dbdoclet.50438225_pgfId-1290367" xreflabel=""/>   39 directories
245 <anchor xml:id="dbdoclet.50438225_pgfId-1290368" xreflabel=""/>   0 character device files
246 <anchor xml:id="dbdoclet.50438225_pgfId-1290369" xreflabel=""/>   0 block device files
247 <anchor xml:id="dbdoclet.50438225_pgfId-1290370" xreflabel=""/>   0 fifos
248 <anchor xml:id="dbdoclet.50438225_pgfId-1290371" xreflabel=""/>   0 links
249 <anchor xml:id="dbdoclet.50438225_pgfId-1290372" xreflabel=""/>   0 symbolic links (0 fast symbolic links)
250 <anchor xml:id="dbdoclet.50438225_pgfId-1290373" xreflabel=""/>   0 sockets
251 <anchor xml:id="dbdoclet.50438225_pgfId-1290374" xreflabel=""/>   --------
252 <anchor xml:id="dbdoclet.50438225_pgfId-1290375" xreflabel=""/>   368 files
253 <anchor xml:id="dbdoclet.50438225_pgfId-1290356" xreflabel=""/> 
254 </screen>
255       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290316" xreflabel=""/> 6. Make the mdsdb file and all ostdb files available on a mounted client and run lfsck to examine the file system. Optionally, correct the defects found by lfsck.</para>
256       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1289934" xreflabel=""/>script /root/lfsck.lustre.log 
257 <anchor xml:id="dbdoclet.50438225_pgfId-1290406" xreflabel=""/>lfsck -n -v --mdsdb /tmp/mdsdb --ostdb /tmp/{ost1db} /tmp/{ost2db} ... /lus\
258 tre/mount/point
259 </screen>
260       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290428" xreflabel=""/><emphasis role="bold">Example:</emphasis></para>
261       <screen><anchor xml:id="dbdoclet.50438225_pgfId-1290429" xreflabel=""/>script /root/lfsck.lustre.log
262 <anchor xml:id="dbdoclet.50438225_pgfId-1290430" xreflabel=""/>lfsck -n -v --mdsdb /home/mdsdb --ostdb /home/{ost1db} \/mnt/lustre/client/
263 <anchor xml:id="dbdoclet.50438225_pgfId-1290431" xreflabel=""/>MDSDB: /home/mdsdb
264 <anchor xml:id="dbdoclet.50438225_pgfId-1290432" xreflabel=""/>OSTDB[0]: /home/ostdb
265 <anchor xml:id="dbdoclet.50438225_pgfId-1290433" xreflabel=""/>MOUNTPOINT: /mnt/lustre/client/
266 <anchor xml:id="dbdoclet.50438225_pgfId-1290434" xreflabel=""/>MDS: max_id 288 OST: max_id 321
267 <anchor xml:id="dbdoclet.50438225_pgfId-1290435" xreflabel=""/>lfsck: ost_idx 0: pass1: check for duplicate objects
268 <anchor xml:id="dbdoclet.50438225_pgfId-1290436" xreflabel=""/>lfsck: ost_idx 0: pass1 OK (287 files total)
269 <anchor xml:id="dbdoclet.50438225_pgfId-1290437" xreflabel=""/>lfsck: ost_idx 0: pass2: check for missing inode objects
270 <anchor xml:id="dbdoclet.50438225_pgfId-1290438" xreflabel=""/>lfsck: ost_idx 0: pass2 OK (287 objects)
271 <anchor xml:id="dbdoclet.50438225_pgfId-1290439" xreflabel=""/>lfsck: ost_idx 0: pass3: check for orphan objects
272 <anchor xml:id="dbdoclet.50438225_pgfId-1290440" xreflabel=""/>[0] uuid lustre-OST0000_UUID
273 <anchor xml:id="dbdoclet.50438225_pgfId-1290441" xreflabel=""/>[0] last_id 288
274 <anchor xml:id="dbdoclet.50438225_pgfId-1290442" xreflabel=""/>[0] zero-length orphan objid 1
275 <anchor xml:id="dbdoclet.50438225_pgfId-1290443" xreflabel=""/>lfsck: ost_idx 0: pass3 OK (321 files total)
276 <anchor xml:id="dbdoclet.50438225_pgfId-1290444" xreflabel=""/>lfsck: pass4: check for duplicate object references
277 <anchor xml:id="dbdoclet.50438225_pgfId-1290445" xreflabel=""/>lfsck: pass4 OK (no duplicates)
278 <anchor xml:id="dbdoclet.50438225_pgfId-1290446" xreflabel=""/>lfsck: fixed 0 errors
279 </screen>
280       <para><anchor xml:id="dbdoclet.50438225_pgfId-1290426" xreflabel=""/>By default, lfsck reports errors, but it does not repair any inconsistencies found. lfsck checks for three kinds of inconsistencies:</para>
281       <itemizedlist><listitem>
282           <para><anchor xml:id="dbdoclet.50438225_pgfId-1290034" xreflabel=""/> Inode exists but has missing objects (dangling inode). This normally happens if there was a problem with an OST.</para>
283         </listitem>
284 <listitem>
285           <para> </para>
286         </listitem>
287 <listitem>
288           <para><anchor xml:id="dbdoclet.50438225_pgfId-1290418" xreflabel=""/> Inode is missing but OST has unreferenced objects (orphan object). Normally, this happens if there was a problem with the MDS.</para>
289         </listitem>
290 <listitem>
291           <para> </para>
292         </listitem>
293 <listitem>
294           <para><anchor xml:id="dbdoclet.50438225_pgfId-1290421" xreflabel=""/> Multiple inodes reference the same objects. This can happen if the MDS is corrupted or if the MDS storage is cached and loses some, but not all, writes.</para>
295         </listitem>
296 <listitem>
297           <para> </para>
298         </listitem>
299 </itemizedlist>
300       <para><anchor xml:id="dbdoclet.50438225_pgfId-1289943" xreflabel=""/>If the file system is in use and being modified while the --mdsdb and --ostdb steps are running, lfsck may report inconsistencies where none exist due to files and objects being created/removed after the database files were collected. Examine the lfsck results closely. You may want to re-run the test.</para>
301       <section remap="h3">
302         <title><anchor xml:id="dbdoclet.50438225_pgfId-1290574" xreflabel=""/>27.2.1 <anchor xml:id="dbdoclet.50438225_13916" xreflabel=""/>Working with Orphaned <anchor xml:id="dbdoclet.50438225_marker-1292187" xreflabel=""/>Objects</title>
303         <para><anchor xml:id="dbdoclet.50438225_pgfId-1289945" xreflabel=""/>The easiest problem to resolve is that of orphaned objects. When the -l option for lfsck is used, these objects are linked to new files and put into lost+found in the Lustre file system, where they can be examined and saved or deleted as necessary. If you are certain the objects are not useful, run lfsck with the -d option to delete orphaned objects and free up any space they are using.</para>
304         <para><anchor xml:id="dbdoclet.50438225_pgfId-1290628" xreflabel=""/>To fix dangling inodes, use lfsck with the -c option to create new, zero-length objects on the OSTs. These files read back with binary zeros for stripes that had objects re-created. Even without lfsck repair, these files can be read by entering:</para>
305         <screen><anchor xml:id="dbdoclet.50438225_pgfId-1289949" xreflabel=""/>dd if=/lustre/bad/file of=/new/file bs=4k conv=sync,noerror
306 </screen>
307         <para><anchor xml:id="dbdoclet.50438225_pgfId-1289951" xreflabel=""/>Because it is rarely useful to have files with large holes in them, most users delete these files after reading them (if useful) and/or restoring them from backup.</para>
308         <informaltable frame="none">
309           <tgroup cols="1">
310             <colspec colname="c1" colwidth="100*"/>
311             <tbody>
312               <row>
313                 <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438225_pgfId-1290487" xreflabel=""/>You cannot write to the holes of such files without having lfsck re-create the objects. Generally, it is easier to delete these files and restore them from backup.</para></entry>
314               </row>
315             </tbody>
316           </tgroup>
317         </informaltable>
318         <para><anchor xml:id="dbdoclet.50438225_pgfId-1289916" xreflabel=""/>To fix inodes with duplicate objects, use lfsck with the -c option to copy the duplicate object to a new object and assign it to a file. One file will be okay and the duplicate will likely contain garbage. By itself, lfsck cannot tell which file is the usable one.</para>
319       </section>
320     </section>
321     <section remap="h2">
322       <title>27.3 <anchor xml:id="dbdoclet.50438225_12316" xreflabel=""/>Recovering from an <anchor xml:id="dbdoclet.50438225_marker-1292768" xreflabel=""/>Unavailable OST</title>
323       <para><anchor xml:id="dbdoclet.50438225_pgfId-1292771" xreflabel=""/>One of the most common problems encountered in a Lustre environment is when an OST becomes unavailable, because of a network partition, OSS node crash, etc. When this happens, the OST’s clients pause and wait for the OST to become available again, either on the primary OSS or a failover OSS. When the OST comes back online, Lustre starts a recovery process to enable clients to reconnect to the OST. Lustre servers put a limit on the time they will wait in recovery for clients to reconnect. The timeout length is determined by the obd_timeout parameter.</para>
324       <para><anchor xml:id="dbdoclet.50438225_pgfId-1292775" xreflabel=""/>During recovery, clients reconnect and replay their requests serially, in the same order they were done originally. Until a client receives a confirmation that a given transaction has been written to stable storage, the client holds on to the transaction, in case it needs to be replayed. Periodically, a progress message prints to the log, stating how_many/expected clients have reconnected. If the recovery is aborted, this log shows how many clients managed to reconnect. When all clients have completed recovery, or if the recovery timeout is reached, the recovery period ends and the OST resumes normal request processing.</para>
325       <para><anchor xml:id="dbdoclet.50438225_pgfId-1292779" xreflabel=""/>If some clients fail to replay their requests during the recovery period, this will not stop the recovery from completing. You may have a situation where the OST recovers, but some clients are not able to participate in recovery (e.g. network problems or client failure), so they are evicted and their requests are not replayed. This would result in any operations on the evicted clients failing, including in-progress writes, which would cause cached writes to be lost. This is a normal outcome; the recovery cannot wait indefinitely, or the file system would be hung any time a client failed. The lost transactions are an unfortunate result of the recovery process.</para>
326       <informaltable frame="none">
327         <tgroup cols="1">
328           <colspec colname="c1" colwidth="100*"/>
329           <tbody>
330             <row>
331               <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438225_pgfId-1292780" xreflabel=""/>The version-based recovery (VBR) feature enables a failed client to be &apos;&apos;skipped&apos;&apos;, so remaining clients can replay their requests, resulting in a more successful recovery from a downed OST. For more information about the VBR feature, see <link xl:href="LustreRecovery.html#50438268_80068">Version-based Recovery</link>.</para></entry>
332             </row>
333           </tbody>
334         </tgroup>
335       </informaltable>
336       <para><anchor xml:id="dbdoclet.50438225_pgfId-1292766" xreflabel=""/> </para>
337       <!--
338 Begin SiteCatalyst code version: G.5.
339 -->
340       <!--
341 End SiteCatalyst code version: G.5.
342 -->
343         <informaltable frame="none">
344         <tgroup cols="3">
345           <colspec colname="c1" colwidth="33*"/>
346           <colspec colname="c2" colwidth="33*"/>
347           <colspec colname="c3" colwidth="33*"/>
348           
349           
350           
351           <tbody>
352             <row>
353               <entry align="left"><para>Lustre 2.0 Operations Manual</para></entry>
354               <entry align="right"><para>821-2076-10</para></entry>
355               <entry align="right" valign="top"><para><link xl:href="index.html"><inlinemediaobject><imageobject role="html">
356                         <imagedata contentdepth="26" contentwidth="30" fileref="./shared/toc01.gif" scalefit="1"/>
357                       </imageobject>
358 <imageobject role="fo">
359                         <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/toc01.gif" scalefit="1" width="100%"/>
360                       </imageobject>
361 </inlinemediaobject></link><link xl:href="LustreTroubleshooting.html"><inlinemediaobject><imageobject role="html">
362                         <imagedata contentdepth="26" contentwidth="30" fileref="./shared/prev01.gif" scalefit="1"/>
363                       </imageobject>
364 <imageobject role="fo">
365                         <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/prev01.gif" scalefit="1" width="100%"/>
366                       </imageobject>
367 </inlinemediaobject></link><link xl:href="LustreDebugging.html"><inlinemediaobject><imageobject role="html">
368                         <imagedata contentdepth="26" contentwidth="30" fileref="./shared/next01.gif" scalefit="1"/>
369                       </imageobject>
370 <imageobject role="fo">
371                         <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/next01.gif" scalefit="1" width="100%"/>
372                       </imageobject>
373 </inlinemediaobject></link><link xl:href="ix.html"><inlinemediaobject><imageobject role="html">
374                         <imagedata contentdepth="26" contentwidth="30" fileref="./shared/index01.gif" scalefit="1"/>
375                       </imageobject>
376 <imageobject role="fo">
377                         <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/index01.gif" scalefit="1" width="100%"/>
378                       </imageobject>
379 </inlinemediaobject></link></para></entry>
380             </row>
381           </tbody>
382         </tgroup>
383       </informaltable>
384       <para><link xl:href=""/></para>
385       <para><link xl:href="copyright.html">Copyright</link> © 2011, Oracle and/or its affiliates. All rights reserved.</para>
386     </section>
387   </section>
388 </article>