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