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