Whamcloud - gitweb
LUDOC-388 stats: Correct extents_stats information
[doc/manual.git] / LustreMaintenance.xml
1 <?xml version='1.0' encoding='UTF-8'?><chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="lustremaintenance">
2   <title xml:id="lustremaintenance.title">Lustre Maintenance</title>
3   <para>Once you have the Lustre file system up and running, you can use the procedures in this section to perform these basic Lustre maintenance tasks:</para>
4   <itemizedlist>
5     <listitem>
6       <para><xref linkend="dbdoclet.50438199_42877"/></para>
7     </listitem>
8     <listitem>
9       <para><xref linkend="dbdoclet.50438199_15240"/></para>
10     </listitem>
11     <listitem>
12       <para><xref linkend="dbdoclet.50438199_26070"/></para>
13     </listitem>
14     <listitem>
15       <para><xref linkend="dbdoclet.50438199_54623"/></para>
16     </listitem>
17     <listitem>
18       <para><xref linkend="dbdoclet.50438199_31353"/></para>
19     </listitem>
20     <listitem>
21       <para><xref linkend="dbdoclet.addingamdt"/></para>
22     </listitem>
23     <listitem>
24       <para><xref linkend="dbdoclet.50438199_22527"/></para>
25     </listitem>
26     <listitem>
27       <para><xref linkend="dbdoclet.50438199_14978"/></para>
28     </listitem>
29     <listitem>
30       <para><xref linkend="dbdoclet.rmremotedir"/></para>
31     </listitem>
32     <listitem>
33       <para><xref linkend="dbdoclet.inactivemdt"/>\</para>
34     </listitem>
35     <listitem>
36       <para><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="section_k3l_4gt_tl"/></para>
37     </listitem>
38     <listitem>
39       <para><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="section_ydg_pgt_tl"/></para>
40     </listitem>
41     <listitem>
42       <para><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="section_kzs_pgt_tl"/></para>
43     </listitem>
44     <listitem>
45       <para><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="section_ucf_qgt_tl"/></para>
46     </listitem>
47     <listitem>
48       <para><xref linkend="dbdoclet.50438199_77819"/></para>
49     </listitem>
50     <listitem>
51       <para><xref linkend="dbdoclet.50438199_12607"/></para>
52     </listitem>
53     <listitem>
54       <para><xref linkend="dbdoclet.50438199_62333"/></para>
55     </listitem>
56     <listitem>
57       <para><xref linkend="dbdoclet.50438199_62545"/></para>
58     </listitem>
59   </itemizedlist>
60   <section xml:id="dbdoclet.50438199_42877">
61       <title>
62           <indexterm><primary>maintenance</primary></indexterm>
63           <indexterm><primary>maintenance</primary><secondary>inactive OSTs</secondary></indexterm>
64           Working with Inactive OSTs</title>
65     <para>To mount a client or an MDT with one or more inactive OSTs, run commands similar to this:</para>
66     <screen>client# mount -o exclude=testfs-OST0000 -t lustre \
67            uml1:/testfs /mnt/testfs
68             client# lctl get_param lov.testfs-clilov-*.target_obd</screen>
69     <para>To activate an inactive OST on a live client or MDT, use the
70     <literal>lctl activate</literal> command on the OSC device. For example:</para>
71     <screen>lctl --device 7 activate</screen>
72     <note>
73       <para>A colon-separated list can also be specified. For example,
74       <literal>exclude=testfs-OST0000:testfs-OST0001</literal>.</para>
75     </note>
76     </section>
77     <section xml:id="dbdoclet.50438199_15240">
78       <title><indexterm><primary>maintenance</primary><secondary>finding nodes</secondary></indexterm>
79 Finding Nodes in the Lustre File System</title>
80       <para>There may be situations in which you need to find all nodes in
81       your Lustre file system or get the names of all OSTs.</para>
82       <para>To get a list of all Lustre nodes, run this command on the MGS:</para>
83       <screen># lctl get_param mgs.MGS.live.*</screen>
84       <note>
85         <para>This command must be run on the MGS.</para>
86       </note>
87       <para>In this example, file system <literal>testfs</literal> has three
88       nodes, <literal>testfs-MDT0000</literal>,
89       <literal>testfs-OST0000</literal>, and
90       <literal>testfs-OST0001</literal>.</para>
91       <screen>mgs:/root# lctl get_param mgs.MGS.live.* 
92                 fsname: testfs 
93                 flags: 0x0     gen: 26 
94                 testfs-MDT0000 
95                 testfs-OST0000 
96                 testfs-OST0001 </screen>
97       <para>To get the names of all OSTs, run this command on the MDS:</para>
98       <screen>mds:/root# lctl get_param lov.*-mdtlov.target_obd </screen>
99       <note>
100         <para>This command must be run on the MDS.</para>
101       </note>
102       <para>In this example, there are two OSTs, testfs-OST0000 and
103       testfs-OST0001, which are both active.</para>
104       <screen>mgs:/root# lctl get_param lov.testfs-mdtlov.target_obd 
105 0: testfs-OST0000_UUID ACTIVE 
106 1: testfs-OST0001_UUID ACTIVE </screen>
107     </section>
108     <section xml:id="dbdoclet.50438199_26070">
109       <title><indexterm><primary>maintenance</primary><secondary>mounting a server</secondary></indexterm>
110 Mounting a Server Without Lustre Service</title>
111       <para>If you are using a combined MGS/MDT, but you only want to start the MGS and not the MDT, run this command:</para>
112       <screen>mount -t lustre <replaceable>/dev/mdt_partition</replaceable> -o nosvc <replaceable>/mount_point</replaceable></screen>
113       <para>The <literal><replaceable>mdt_partition</replaceable></literal> variable is the combined MGS/MDT block device.</para>
114       <para>In this example, the combined MGS/MDT is <literal>testfs-MDT0000</literal> and the mount point is <literal>/mnt/test/mdt</literal>.</para>
115       <screen>$ mount -t lustre -L testfs-MDT0000 -o nosvc /mnt/test/mdt</screen>
116     </section>
117     <section xml:id="dbdoclet.50438199_54623">
118       <title><indexterm><primary>maintenance</primary><secondary>regenerating config logs</secondary></indexterm>
119 Regenerating Lustre Configuration Logs</title>
120       <para>If the Lustre file system configuration logs are in a state where the file system cannot
121       be started, use the <literal>writeconf</literal> command to erase them. After the
122         <literal>writeconf</literal> command is run and the servers restart, the configuration logs
123       are re-generated and stored on the MGS (as in a new file system).</para>
124       <para>You should only use the <literal>writeconf</literal> command if:</para>
125       <itemizedlist>
126         <listitem>
127           <para>The configuration logs are in a state where the file system cannot start</para>
128         </listitem>
129         <listitem>
130           <para>A server NID is being changed</para>
131         </listitem>
132       </itemizedlist>
133       <para>The <literal>writeconf</literal> command is destructive to some configuration items (i.e., OST pools information and items set via <literal>conf_param</literal>), and should be used with caution. To avoid problems:</para>
134       <itemizedlist>
135         <listitem>
136           <para>Shut down the file system before running the <literal>writeconf</literal> command</para>
137         </listitem>
138         <listitem>
139           <para>Run the <literal>writeconf</literal> command on all servers (MDT first, then OSTs)</para>
140         </listitem>
141         <listitem>
142           <para>Start the file system in this order:</para>
143           <itemizedlist>
144             <listitem>
145               <para>MGS (or the combined MGS/MDT)</para>
146             </listitem>
147             <listitem>
148               <para>MDT</para>
149             </listitem>
150             <listitem>
151               <para>OSTs</para>
152             </listitem>
153             <listitem>
154               <para>Lustre clients</para>
155             </listitem>
156           </itemizedlist>
157         </listitem>
158       </itemizedlist>
159       <caution>
160         <para>The OST pools feature enables a group of OSTs to be named for file striping purposes. If you use OST pools, be aware that running the <literal>writeconf</literal> command erases <emphasis role="bold">all</emphasis> pools information (as well as any other parameters set via <literal>lctl conf_param</literal>). We recommend that the pools definitions (and <literal>conf_param</literal> settings) be executed via a script, so they can be reproduced easily after a <literal>writeconf</literal> is performed.</para>
161       </caution>
162       <para>To regenerate Lustre file system configuration logs:</para>
163       <orderedlist>
164         <listitem>
165           <para>Shut down the file system in this order.</para>
166           <orderedlist>
167             <listitem>
168               <para>Unmount the clients.</para>
169             </listitem>
170             <listitem>
171               <para>Unmount the MDT.</para>
172             </listitem>
173             <listitem>
174               <para>Unmount all OSTs.</para>
175             </listitem>
176           </orderedlist>
177         </listitem>
178         <listitem>
179           <para>Make sure the the MDT and OST devices are available.</para>
180         </listitem>
181         <listitem>
182           <para>Run the <literal>writeconf</literal> command on all servers.</para>
183           <para>Run writeconf on the MDT first, and then the OSTs.</para>
184           <orderedlist>
185             <listitem>
186               <para>On the MDT, run:</para>
187               <screen>mdt# tunefs.lustre --writeconf <replaceable>/dev/mdt_device</replaceable></screen>
188             </listitem>
189             <listitem>
190               <para>
191               On each OST, run:
192               
193           <screen>ost# tunefs.lustre --writeconf <replaceable>/dev/ost_device</replaceable></screen>
194           </para>
195             </listitem>
196           </orderedlist>
197         </listitem>
198         <listitem>
199           <para>Restart the file system in this order.</para>
200           <orderedlist>
201             <listitem>
202               <para>Mount the MGS (or the combined MGS/MDT).</para>
203             </listitem>
204             <listitem>
205               <para>Mount the MDT.</para>
206             </listitem>
207             <listitem>
208               <para>Mount the OSTs.</para>
209             </listitem>
210             <listitem>
211               <para>Mount the clients.</para>
212             </listitem>
213           </orderedlist>
214         </listitem>
215       </orderedlist>
216       <para>After the <literal>writeconf</literal> command is run, the configuration logs are re-generated as servers restart.</para>
217     </section>
218     <section xml:id="dbdoclet.50438199_31353">
219       <title><indexterm><primary>maintenance</primary><secondary>changing a NID</secondary></indexterm>
220 Changing a Server NID</title>
221       <para>In Lustre software release 2.3 or earlier, the <literal>tunefs.lustre
222         --writeconf</literal> command is used to rewrite all of the configuration files.</para>
223       <para condition="l24">If you need to change the NID on the MDT or OST, a new
224         <literal>replace_nids</literal> command was added in Lustre software release 2.4 to simplify
225       this process. The <literal>replace_nids</literal> command differs from <literal>tunefs.lustre
226         --writeconf</literal> in that it does not erase the entire configuration log, precluding the
227       need the need to execute the <literal>writeconf</literal> command on all servers and
228       re-specify all permanent parameter settings. However, the <literal>writeconf</literal> command
229       can still be used if desired.</para>
230       <para>Change a server NID in these situations:</para>
231       <itemizedlist>
232         <listitem>
233           <para>New server hardware is added to the file system, and the MDS or an OSS is being moved to the new machine.</para>
234         </listitem>
235         <listitem>
236           <para>New network card is installed in the server.</para>
237         </listitem>
238         <listitem>
239           <para>You want to reassign IP addresses.</para>
240         </listitem>
241       </itemizedlist>
242       <para>To change a server NID:</para>
243       <orderedlist>
244         <listitem>
245                 <para>Update the LNet configuration in the <literal>/etc/modprobe.conf</literal> file so the list of server NIDs is correct. Use <literal>lctl list_nids</literal> to view the list of server NIDS.</para>
246           <para>The <literal>lctl list_nids</literal> command indicates which network(s) are
247           configured to work with the Lustre file system.</para>
248         </listitem>
249         <listitem>
250           <para>Shut down the file system in this order:</para>
251           <orderedlist>
252             <listitem>
253               <para>Unmount the clients.</para>
254             </listitem>
255             <listitem>
256               <para>Unmount the MDT.</para>
257             </listitem>
258             <listitem>
259               <para>Unmount all OSTs.</para>
260             </listitem>
261           </orderedlist>
262         </listitem>
263         <listitem>
264           <para>If the MGS and MDS share a partition, start the MGS only:</para>
265           <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
266         </listitem>
267         <listitem>
268           <para>Run the <literal>replace_nids</literal> command on the MGS:</para>
269           <screen>lctl replace_nids <replaceable>devicename</replaceable> <replaceable>nid1</replaceable>[,nid2,nid3 ...]</screen>
270           <para>where <replaceable>devicename</replaceable> is the Lustre target name, e.g.
271             <literal>testfs-OST0013</literal></para>
272         </listitem>
273         <listitem>
274           <para>If the MGS and MDS share a partition, stop the MGS:</para>
275           <screen>umount <replaceable>mount_point</replaceable></screen>
276         </listitem>
277       </orderedlist>
278       <note><para>The <literal>replace_nids</literal> command also cleans
279       all old, invalidated records out of the configuration log, while
280       preserving all other current settings.</para></note> 
281       <note><para>The previous configuration log is backed up on the MGS
282       disk with the suffix <literal>'.bak'</literal>.</para></note>
283     </section>
284     <section xml:id="dbdoclet.addingamdt" condition='l24'>
285       <title><indexterm>
286         <primary>maintenance</primary>
287         <secondary>adding an MDT</secondary>
288       </indexterm>Adding a New MDT to a Lustre File System</title>
289         <para>Additional MDTs can be added using the DNE feature to serve one
290         or more remote sub-directories within a filesystem, in order to
291         increase the total number of files that can be created in the
292         filesystem, to increase aggregate metadata performance, or to isolate
293         user or application workloads from other users of the filesystem. It
294         is possible to have multiple remote sub-directories reference the
295         same MDT.  However, the root directory will always be located on
296         MDT0. To add a new MDT into the file system:</para>
297       <orderedlist>
298         <listitem>
299           <para>Discover the maximum MDT index. Each MDT must have unique index.</para>
300 <screen>
301 client$ lctl dl | grep mdc
302 36 UP mdc testfs-MDT0000-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
303 37 UP mdc testfs-MDT0001-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
304 38 UP mdc testfs-MDT0002-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
305 39 UP mdc testfs-MDT0003-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
306 </screen>
307         </listitem>
308         <listitem>
309           <para>Add the new block device as a new MDT at the next available
310           index. In this example, the next available index is 4.</para>
311 <screen>
312 mds# mkfs.lustre --reformat --fsname=<replaceable>testfs</replaceable> --mdt --mgsnode=<replaceable>mgsnode</replaceable> --index 4 <replaceable>/dev/mdt4_device</replaceable>
313 </screen>
314         </listitem>
315         <listitem>
316           <para>Mount the MDTs.</para>
317 <screen>
318 mds# mount –t lustre <replaceable>/dev/mdt4_blockdevice</replaceable> /mnt/mdt4
319 </screen>
320         </listitem>
321         <listitem>
322            <para>In order to start creating new files and directories on the
323            new MDT(s) they need to be attached into the namespace at one or
324            more subdirectories using the <literal>lfs mkdir</literal> command.
325            All files and directories below those created with
326            <literal>lfs mkdir</literal> will also be created on the same MDT
327            unless otherwise specified.
328            </para>
329 <screen>
330 client# lfs mkdir -i 3 /mnt/testfs/new_dir_on_mdt3
331 client# lfs mkdir -i 4 /mnt/testfs/new_dir_on_mdt4
332 client# lfs mkdir -c 4 /mnt/testfs/new_directory_striped_across_4_mdts
333 </screen>
334         </listitem>
335       </orderedlist>
336     </section>
337     <section xml:id="dbdoclet.50438199_22527">
338       <title><indexterm><primary>maintenance</primary><secondary>adding a OST</secondary></indexterm>
339 Adding a New OST to a Lustre File System</title>
340       <para>To add an OST to existing Lustre file system:</para>
341       <orderedlist>
342         <listitem>
343           <para> Add a new OST by passing on the following commands, run:</para>
344           <screen>oss# mkfs.lustre --fsname=spfs --mgsnode=mds16@tcp0 --ost --index=12 /dev/sda
345 oss# mkdir -p /mnt/test/ost12
346 oss# mount -t lustre /dev/sda /mnt/test/ost12</screen>
347         </listitem>
348         <listitem>
349           <para> Migrate the data (possibly).</para>
350           <para>The file system is quite unbalanced when new empty OSTs are added. New file creations are automatically balanced. If this is a scratch file system or files are pruned at a regular interval, then no further work may be needed.</para>
351           <para>New files being created will preferentially be placed on the empty OST. As old files are deleted, they will release space on the old OST.</para>
352           <para>Files existing prior to the expansion can optionally be rebalanced with an in-place copy, which can be done with a simple script. The basic method is to copy existing files to a temporary file, then move the temp file over the old one. This should not be attempted with files which are currently being written to by users or applications. This operation redistributes the stripes over the entire set of OSTs.</para>
353           <para>For example, to rebalance all files within <literal>/mnt/lustre/dir</literal>, enter:</para>
354           <screen>client# lfs_migrate /mnt/lustre/file</screen>
355           <para>To migrate files within the <literal>/test</literal> file system on
356             <literal>OST0004</literal> that are larger than 4GB in size, enter:</para>
357           <screen>client# lfs find /test -obd test-OST0004 -size +4G | lfs_migrate -y</screen>
358           <para>See <xref linkend="dbdoclet.50438206_42260"/>  for more details.</para>
359         </listitem>
360       </orderedlist>
361     </section>
362     <section xml:id="dbdoclet.50438199_14978">
363       <title><indexterm><primary>maintenance</primary><secondary>restoring a OST</secondary></indexterm>
364       <indexterm><primary>maintenance</primary><secondary>removing a OST</secondary></indexterm>
365 Removing and Restoring OSTs</title>
366       <para>OSTs can be removed from and restored to a Lustre file system. Removing a OST means the
367       OST is <emphasis role="italic">deactivated</emphasis> in the file system, not permanently
368       removed.</para>
369                 <note><para>A removed OST still appears in the file system; do not create a new OST with the same name.</para></note>
370       <para>You may want to remove (deactivate) an OST and prevent new files from being written to it in several situations:</para>
371       <itemizedlist>
372         <listitem>
373           <para>Hard drive has failed and a RAID resync/rebuild is underway</para>
374         </listitem>
375         <listitem>
376           <para>OST is nearing its space capacity</para>
377         </listitem>
378         <listitem>
379                   <para>OST storage has failed permanently</para>
380             </listitem>
381       </itemizedlist>
382       <section condition="l24" xml:id="dbdoclet.rmremotedir">
383       <title><indexterm><primary>maintenance</primary><secondary>removing a MDT</secondary></indexterm>Removing a MDT from the File System</title>
384         <para>If the MDT is permanently inaccessible,
385     <literal>lfs rm_entry {directory}</literal> can be used to delete the
386     directory entry on the unavailable MDT. A normal <literal>rmdir</literal>
387     will report an IO error due to the remote MDT being inactive. Please note
388     that if the MDT is available, a standard <literal>rm -r</literal> should
389     be used to delete the remote directory.  After the remote directory has been
390     removed, the administrator should mark the MDT as permanently inactive
391     with:</para>
392 <screen>lctl conf_param {MDT name}.mdc.active=0
393 </screen>
394 <para>A user can identify which MDT holds a remote sub-directory using
395 the <literal>lfs</literal> utility. For example:</para>
396 <screen>client$ lfs getstripe -M /mnt/lustre/remote_dir1
397 1
398 client$ mkdir /mnt/lustre/local_dir0
399 client$ lfs getstripe -M /mnt/lustre/local_dir0
400 0
401 </screen>
402         <para>The <literal>getstripe [--mdt-index|-M]</literal> parameters return
403         the index of the MDT that is serving the given directory.</para>
404           </section>
405           <section xml:id="dbdoclet.inactivemdt" condition='l24'>
406       <title>
407           <indexterm><primary>maintenance</primary></indexterm>
408           <indexterm><primary>maintenance</primary><secondary>inactive MDTs</secondary></indexterm>Working with Inactive MDTs</title>
409     <para>Files located on or below an inactive MDT are inaccessible until the MDT is activated again. Clients accessing an inactive MDT will receive an EIO error.</para></section>
410       <section remap="h3" xml:id="section_k3l_4gt_tl">
411       <title><indexterm>
412           <primary>maintenance</primary>
413           <secondary>removing a OST</secondary>
414         </indexterm> Removing an OST from the File System</title>
415       <para>When removing an OST, remember that the MDT does not communicate directly with OSTs.
416         Rather, each OST has a corresponding OSC which communicates with the MDT. It is necessary to
417         determine the device number of the OSC that corresponds to the OST. Then, you use this
418         device number to deactivate the OSC on the MDT.</para>
419       <para>To remove an OST from the file system:</para>
420       <orderedlist>
421         <listitem>
422           <para>For the OST to be removed, determine the device number of the corresponding OSC on
423             the MDT.</para>
424           <orderedlist>
425             <listitem>
426               <para>List all OSCs on the node, along with their device numbers. Run:</para>
427               <screen>lctl dl | grep osc</screen>
428               <para>For example: <literal>lctl dl | grep</literal></para>
429               <screen>11 UP osc testfs-OST-0000-osc-cac94211 4ea5b30f-6a8e-55a0-7519-2f20318ebdb4 5
430 12 UP osc testfs-OST-0001-osc-cac94211 4ea5b30f-6a8e-55a0-7519-2f20318ebdb4 5
431 13 IN osc testfs-OST-0000-osc testfs-MDT0000-mdtlov_UUID 5
432 14 UP osc testfs-OST-0001-osc testfs-MDT0000-mdtlov_UUID 5</screen>
433             </listitem>
434             <listitem>
435               <para>Determine the device number of the OSC that corresponds to the OST to be
436                 removed.</para>
437             </listitem>
438           </orderedlist>
439         </listitem>
440         <listitem>
441           <para>Temporarily deactivate the OSC on the MDT. On the MDT, run: </para>
442           <screen>mds# lctl --device <replaceable>lustre_devno</replaceable> deactivate</screen>
443           <para>For example, based on the command output in Step 1, to deactivate device 13 (the
444             MDT’s OSC for <literal>OST-0000</literal>), the command would be: </para>
445           <screen>mds# lctl --device 13 deactivate</screen>
446           <para>This marks the OST as inactive on the MDS, so no new objects are assigned to the
447             OST. This does not prevent use of existing objects for reads or writes. </para>
448           <note>
449             <para>Do not deactivate the OST on the clients. Do so causes errors (EIOs), and the copy
450               out to fail. </para>
451           </note>
452           <caution>
453             <para>Do not use <literal>lctl conf_param</literal> to deactivate the OST. It
454               permanently sets a parameter in the file system configuration.</para>
455           </caution>
456         </listitem>
457         <listitem>
458           <para>Discover all files that have objects residing on the deactivated OST. </para>
459           <para>Depending on whether the deactivated OST is available or not, the data from that OST
460             may be migrated to other OSTs, or may need to be restored from backup. </para>
461           <orderedlist>
462             <listitem>
463               <para>If the OST is still online and available, find all files with objects on the
464                 deactivated OST, and copy them to other OSTs in the file system to: </para>
465               <screen>client# lfs find --obd <replaceable>ost_name</replaceable> <replaceable>/mount/point</replaceable> | lfs_migrate -y</screen>
466             </listitem>
467             <listitem>
468               <para>If the OST is no longer available, delete the files on that OST and restore them
469                 from backup:
470                 <screen>client# lfs find --obd <replaceable>ost_uuid</replaceable> -print0 <replaceable>/mount/point</replaceable> | \
471            tee /tmp/files_to_restore | xargs -0 -n 1 unlink</screen>
472                 The list of files that need to be restored from backup is stored in
473                   <literal>/tmp/files_to_restore</literal>. Restoring these files is beyond the
474                 scope of this document.</para>
475             </listitem>
476           </orderedlist>
477         </listitem>
478         <listitem>
479           <para>Deactivate the OST.</para>
480           <orderedlist>
481             <listitem>
482               <para>
483                 If there is expected to be a replacement OST in some short
484                 time (a few days), the OST can temporarily be deactivated on
485                 the clients using:
486                 <screen>client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=0</screen>
487                 <note><para>This setting is only temporary and will be reset
488                 if the clients are remounted or rebooted. It needs to be run
489                 on all clients.</para>
490                 </note></para>
491             </listitem>
492           </orderedlist>
493           <para>If there is not expected to be a replacement for this OST in
494           the near future, permanently deactivate it on all clients and the MDS
495           by running the following command on the MGS:
496             <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=0</screen></para>
497           <note>
498             <para>A deactivated OST still appears in the file system
499             configuration, though a new OST with the same name can be
500             created using the <literal>--replace</literal> option for
501             <literal>mkfs.lustre</literal>.</para>
502           </note>
503         </listitem>
504       </orderedlist>
505     </section>
506       <section remap="h3" xml:id="section_ydg_pgt_tl">
507       <title><indexterm>
508           <primary>maintenance</primary>
509           <secondary>backing up OST config</secondary>
510         </indexterm>
511         <indexterm>
512           <primary>backup</primary>
513           <secondary>OST config</secondary>
514         </indexterm> Backing Up OST Configuration Files</title>
515       <para>If the OST device is still accessible, then the Lustre configuration files on the OST
516         should be backed up and saved for future use in order to avoid difficulties when a
517         replacement OST is returned to service. These files rarely change, so they can and should be
518         backed up while the OST is functional and accessible. If the deactivated OST is still
519         available to mount (i.e. has not permanently failed or is unmountable due to severe
520         corruption), an effort should be made to preserve these files. </para>
521       <orderedlist>
522         <listitem>
523           <para>Mount the OST file system.
524             <screen>oss# mkdir -p /mnt/ost
525 [oss]# mount -t ldiskfs <replaceable>/dev/ost_device</replaceable> /mnt/ost</screen>
526           </para>
527         </listitem>
528         <listitem>
529           <para>Back up the OST configuration files.
530             <screen>oss# tar cvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost last_rcvd \
531            CONFIGS/ O/0/LAST_ID</screen>
532           </para>
533         </listitem>
534         <listitem>
535           <para> Unmount the OST file system. <screen>oss# umount /mnt/ost</screen>
536           </para>
537         </listitem>
538       </orderedlist>
539     </section>
540       <section xml:id="section_kzs_pgt_tl">
541       <title><indexterm>
542           <primary>maintenance</primary>
543           <secondary>restoring OST config</secondary>
544         </indexterm>
545         <indexterm>
546           <primary>backup</primary>
547           <secondary>restoring OST config</secondary>
548         </indexterm> Restoring OST Configuration Files</title>
549       <para>If the original OST is still available, it is best to follow the OST backup and restore
550         procedure given in either <xref linkend="dbdoclet.backup_device"/>, or
551         <xref linkend="dbdoclet.backup_target_filesystem"/> and
552         <xref linkend="dbdoclet.restore_target_filesystem"/>.</para>
553       <para>To replace an OST that was removed from service due to corruption or hardware failure,
554         the file system needs to be formatted using <literal>mkfs.lustre</literal>, and the Lustre
555         file system configuration should be restored, if available. </para>
556       <para>If the OST configuration files were not backed up, due to the OST file system being
557         completely inaccessible, it is still possible to replace the failed OST with a new one at
558         the same OST index. </para>
559       <orderedlist>
560         <listitem>
561           <para> Format the OST file system.
562             <screen>oss# mkfs.lustre --ost --index=<replaceable>old_ost_index</replaceable> <replaceable>other_options</replaceable> \
563            <replaceable>/dev/new_ost_dev</replaceable></screen>
564           </para>
565         </listitem>
566         <listitem>
567           <para> Mount the OST file system.
568             <screen>oss# mkdir /mnt/ost
569 oss# mount -t ldiskfs <replaceable>/dev/new_ost_dev</replaceable> <replaceable>/mnt/ost</replaceable></screen>
570           </para>
571         </listitem>
572         <listitem>
573           <para>Restore the OST configuration files, if available.
574             <screen>oss# tar xvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost</screen></para>
575         </listitem>
576         <listitem>
577           <para>Recreate the OST configuration files, if unavailable. </para>
578           <para>Follow the procedure in <xref linkend="dbdoclet.50438198_69657"/> to recreate the
579             LAST_ID file for this OST index. The <literal>last_rcvd</literal> file will be recreated
580             when the OST is first mounted using the default parameters, which are normally correct
581             for all file systems. The <literal>CONFIGS/mountdata</literal> file is created by
582               <literal>mkfs.lustre</literal> at format time, but has flags set that request it to
583             register itself with the MGS. It is possible to copy these flags from another working
584             OST (which should be the same):
585             <screen>oss1# debugfs -c -R &quot;dump CONFIGS/mountdata /tmp/ldd&quot; <replaceable>/dev/other_osdev</replaceable>
586 oss1# scp /tmp/ldd oss0:/tmp/ldd
587 oss0# dd if=/tmp/ldd of=/mnt/ost/CONFIGS/mountdata bs=4 count=1 seek=5 skip=5 conv=notrunc</screen></para>
588         </listitem>
589         <listitem>
590           <para> Unmount the OST file system. <screen>oss# umount /mnt/ost</screen>
591           </para>
592         </listitem>
593       </orderedlist>
594     </section>
595       <section xml:id="section_ucf_qgt_tl">
596       <title><indexterm>
597           <primary>maintenance</primary>
598           <secondary>reintroducing an OSTs</secondary>
599         </indexterm>Returning a Deactivated OST to Service</title>
600       <para>If the OST was permanently deactivated, it needs to be
601       reactivated in the MGS configuration.
602         <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=1</screen>
603         If the OST was temporarily deactivated, it needs to be reactivated on
604         the MDS and clients.
605         <screen>mds# lctl --device <replaceable>lustre_devno</replaceable> activate
606 client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1</screen></para>
607     </section>
608     </section>
609     <section xml:id="dbdoclet.50438199_77819">
610       <title><indexterm><primary>maintenance</primary><secondary>aborting recovery</secondary></indexterm>
611       <indexterm><primary>backup</primary><secondary>aborting recovery</secondary></indexterm>
612 Aborting Recovery</title>
613       <para>You can abort recovery with either the <literal>lctl</literal> utility or by mounting the target with the <literal>abort_recov</literal> option (<literal>mount -o abort_recov</literal>). When starting a target, run: <screen>mds# mount -t lustre -L <replaceable>mdt_name</replaceable> -o abort_recov <replaceable>/mount_point</replaceable></screen></para>
614       <note>
615         <para>The recovery process is blocked until all OSTs are available. </para>
616       </note>
617     </section>
618     <section xml:id="dbdoclet.50438199_12607">
619       <title><indexterm><primary>maintenance</primary><secondary>identifying OST host</secondary></indexterm>
620 Determining Which Machine is Serving an OST </title>
621       <para>In the course of administering a Lustre file system, you may need to determine which
622       machine is serving a specific OST. It is not as simple as identifying the machine’s IP
623       address, as IP is only one of several networking protocols that the Lustre software uses and,
624       as such, LNet does not use IP addresses as node identifiers, but NIDs instead. To identify the
625       NID that is serving a specific OST, run one of the following commands on a client (you do not
626       need to be a root user):
627       <screen>client$ lctl get_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>*.ost_conn_uuid</screen>
628       For example:
629       <screen>client$ lctl get_param osc.*-OST0000*.ost_conn_uuid 
630 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen>-
631       OR -
632       <screen>client$ lctl get_param osc.*.ost_conn_uuid 
633 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
634 osc.testfs-OST0001-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
635 osc.testfs-OST0002-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
636 osc.testfs-OST0003-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
637 osc.testfs-OST0004-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen></para>
638     </section>
639     <section xml:id="dbdoclet.50438199_62333">
640       <title><indexterm><primary>maintenance</primary><secondary>changing failover node address</secondary></indexterm>
641 Changing the Address of a Failover Node</title>
642       <para>To change the address of a failover node (e.g, to use node X instead of node Y), run
643       this command on the OSS/OST partition (depending on which option was used to originally
644       identify the NID):
645       <screen>oss# tunefs.lustre --erase-params --servicenode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
646       or
647       <screen>oss# tunefs.lustre --erase-params --failnode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
648       For more information about the <literal>--servicenode</literal> and
649         <literal>--failnode</literal> options, see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
650         linkend="configuringfailover"/>.</para>
651     </section>
652     <section xml:id="dbdoclet.50438199_62545">
653       <title><indexterm><primary>maintenance</primary><secondary>separate a combined MGS/MDT</secondary></indexterm>
654 Separate a combined MGS/MDT</title>
655       <para>These instructions assume the MGS node will be the same as the MDS node. For instructions on how to move MGS to a different node, see <xref linkend="dbdoclet.50438199_31353"/>.</para>
656       <para>These instructions are for doing the split without shutting down other servers and clients.</para>
657       <orderedlist>
658         <listitem>
659           <para>Stop the MDS.</para>
660           <para>Unmount the MDT</para>
661               <screen>umount -f <replaceable>/dev/mdt_device</replaceable> </screen>
662         </listitem>
663         <listitem>
664           <para>Create the MGS.</para>
665               <screen>mds# mkfs.lustre --mgs --device-size=<replaceable>size</replaceable> <replaceable>/dev/mgs_device</replaceable></screen>
666         </listitem>
667         <listitem>
668           <para>Copy the configuration data from MDT disk to the new MGS disk.</para>
669               <screen>mds# mount -t ldiskfs -o ro <replaceable>/dev/mdt_device</replaceable> <replaceable>/mdt_mount_point</replaceable></screen>
670               <screen>mds# mount -t ldiskfs -o rw <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable> </screen>
671               <screen>mds# cp -r <replaceable>/mdt_mount_point</replaceable>/CONFIGS/<replaceable>filesystem_name</replaceable>-* <replaceable>/mgs_mount_point</replaceable>/CONFIGS/. </screen>
672               <screen>mds# umount <replaceable>/mgs_mount_point</replaceable></screen>
673               <screen>mds# umount <replaceable>/mdt_mount_point</replaceable></screen>
674           <para>See <xref linkend="dbdoclet.50438199_54623"/> for alternative method.</para>
675         </listitem>
676         <listitem>
677           <para>Start the MGS.</para>
678               <screen>mgs# mount -t lustre <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable></screen>
679           <para>Check to make sure it knows about all your file system</para>
680               <screen>mgs:/root# lctl get_param mgs.MGS.filesystems</screen>
681         </listitem>
682         <listitem>
683           <para>Remove the MGS option from the MDT, and set the new MGS nid.</para>
684               <screen>mds# tunefs.lustre --nomgs --mgsnode=<replaceable>new_mgs_nid</replaceable> <replaceable>/dev/mdt-device</replaceable></screen>
685         </listitem>
686         <listitem>
687           <para>Start the MDT.</para>
688               <screen>mds# mount -t lustre <replaceable>/dev/mdt_device /mdt_mount_point</replaceable></screen>
689           <para>Check to make sure the MGS configuration looks right:</para>
690               <screen>mgs# lctl get_param mgs.MGS.live.<replaceable>filesystem_name</replaceable></screen>
691         </listitem>
692       </orderedlist>
693     </section>
694 </chapter>