Whamcloud - gitweb
LUDOC-328 tbf: add UID/GID based policy to NRS-TBF section
[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.changingservernid"/></para>
19     </listitem>
20     <listitem>
21       <para><xref linkend="dbdoclet.adding_new_mdt"/></para>
22     </listitem>
23     <listitem>
24       <para><xref linkend="dbdoclet.adding_new_ost"/></para>
25     </listitem>
26     <listitem>
27       <para><xref linkend="dbdoclet.deactivating_mdt_ost"/></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_remove_ost"/></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_restore_ost"/></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.changingservernid">
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.adding_new_mdt" 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.adding_new_ost">
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>A new OST can be added to existing Lustre file system on either
341       an existing OSS node or on a new OSS node.  In order to keep client IO
342       load balanced across OSS nodes for maximum aggregate performance, it is
343       not recommended to configure different numbers of OSTs to each OSS node.
344       </para>
345       <orderedlist>
346         <listitem>
347           <para> Add a new OST by using <literal>mkfs.lustre</literal> as when
348           the filesystem was first formatted, see
349           <xref linkend="dbdoclet.format_ost" /> for details.  Each new OST
350           must have a unique index number, use <literal>lctl dl</literal> to
351           see a list of all OSTs. For example, to add a new OST at index 12
352           to the <literal>testfs</literal> filesystem run following commands
353           should be run on the OSS:</para>
354           <screen>oss# mkfs.lustre --fsname=testfs --mgsnode=mds16@tcp0 --ost --index=12 /dev/sda
355 oss# mkdir -p /mnt/testfs/ost12
356 oss# mount -t lustre /dev/sda /mnt/testfs/ost12</screen>
357         </listitem>
358         <listitem>
359           <para>Balance OST space usage (possibly).</para>
360           <para>The file system can be quite unbalanced when new empty OSTs
361           are added to a relatively full filesystem. New file creations are
362           automatically balanced to favour the new OSTs. If this is a scratch
363           file system or files are pruned at regular intervals, then no further
364           work may be needed to balance the OST space usage as new files being
365           created will preferentially be placed on the less full OST(s). As old
366           files are deleted, they will release space on the old OST(s).</para>
367           <para>Files existing prior to the expansion can optionally be
368           rebalanced using the <literal>lfs_migrate</literal> utility.
369           This redistributes file data over the entire set of OSTs.</para>
370           <para>For example, to rebalance all files within the directory
371           <literal>/mnt/lustre/dir</literal>, enter:</para>
372           <screen>client# lfs_migrate /mnt/lustre/file</screen>
373           <para>To migrate files within the <literal>/test</literal> file
374           system on <literal>OST0004</literal> that are larger than 4GB in
375           size to other OSTs, enter:</para>
376           <screen>client# lfs find /test --ost test-OST0004 -size +4G | lfs_migrate -y</screen>
377           <para>See <xref linkend="dbdoclet.lfs_migrate"/> for details.</para>
378         </listitem>
379       </orderedlist>
380     </section>
381     <section xml:id="dbdoclet.deactivating_mdt_ost">
382       <title><indexterm><primary>maintenance</primary><secondary>restoring an OST</secondary></indexterm>
383       <indexterm><primary>maintenance</primary><secondary>removing an OST</secondary></indexterm>
384 Removing and Restoring MDTs and OSTs</title>
385       <para>OSTs and DNE MDTs can be removed from and restored to a Lustre
386       filesystem.  Deactivating an OST means that it is temporarily or
387       permanently marked unavailable.  Deactivating an OST on the MDS means
388       it will not try to allocate new objects there or perform OST recovery,
389       while deactivating an OST the client means it will not wait for OST
390       recovery if it cannot contact the OST and will instead return an IO
391       error to the application immediately if files on the OST are accessed.
392       An OST may be permanently deactivated from the file system,
393       depending on the situation and commands used.</para>
394       <note><para>A permanently deactivated MDT or OST still appears in the
395         filesystem configuration until the configuration is regenerated with
396         <literal>writeconf</literal> or it is replaced with a new MDT or OST
397         at the same index and permanently reactivated.  A deactivated OST
398         will not be listed by <literal>lfs df</literal>.
399       </para></note>
400       <para>You may want to temporarily deactivate an OST on the MDS to
401       prevent new files from being written to it in several situations:</para>
402       <itemizedlist>
403         <listitem>
404           <para>A hard drive has failed and a RAID resync/rebuild is underway,
405           though the OST can also be marked <emphasis>degraded</emphasis> by
406           the RAID system to avoid allocating new files on the slow OST which
407           can reduce performance, see <xref linkend='dbdoclet.degraded_ost' />
408           for more details.
409           </para>
410         </listitem>
411         <listitem>
412           <para>OST is nearing its space capacity, though the MDS will already
413           try to avoid allocating new files on overly-full OSTs if possible,
414           see <xref linkend='dbdoclet.balancing_free_space' /> for details.
415           </para>
416         </listitem>
417         <listitem>
418           <para>MDT/OST storage or MDS/OSS node has failed, and will not
419           be available for some time (or forever), but there is still a
420           desire to continue using the filesystem before it is repaired.</para>
421         </listitem>
422       </itemizedlist>
423       <section condition="l24" xml:id="dbdoclet.rmremotedir">
424       <title><indexterm><primary>maintenance</primary><secondary>removing an MDT</secondary></indexterm>Removing an MDT from the File System</title>
425         <para>If the MDT is permanently inaccessible,
426     <literal>lfs rm_entry {directory}</literal> can be used to delete the
427     directory entry for the unavailable MDT. Using <literal>rmdir</literal>
428     would otherwise report an IO error due to the remote MDT being inactive.
429     Please note that if the MDT <emphasis>is</emphasis> available, standard
430     <literal>rm -r</literal> should be used to delete the remote directory.
431     After the remote directory has been removed, the administrator should
432     mark the MDT as permanently inactive with:</para>
433 <screen>lctl conf_param {MDT name}.mdc.active=0</screen>
434 <para>A user can identify which MDT holds a remote sub-directory using
435 the <literal>lfs</literal> utility. For example:</para>
436 <screen>client$ lfs getstripe --mdt-index /mnt/lustre/remote_dir1
437 1
438 client$ mkdir /mnt/lustre/local_dir0
439 client$ lfs getstripe --mdt-index /mnt/lustre/local_dir0
440 0
441 </screen>
442         <para>The <literal>lfs getstripe --mdt-index</literal> command
443         returns the index of the MDT that is serving the given directory.</para>
444           </section>
445           <section xml:id="dbdoclet.inactivemdt" condition='l24'>
446       <title>
447           <indexterm><primary>maintenance</primary></indexterm>
448           <indexterm><primary>maintenance</primary><secondary>inactive MDTs</secondary></indexterm>Working with Inactive MDTs</title>
449     <para>Files located on or below an inactive MDT are inaccessible until
450     the MDT is activated again. Clients accessing an inactive MDT will receive
451     an EIO error.</para>
452       </section>
453       <section remap="h3" xml:id="section_remove_ost">
454       <title><indexterm>
455           <primary>maintenance</primary>
456           <secondary>removing an OST</secondary>
457         </indexterm>Removing an OST from the File System</title>
458       <para>When deactivating an OST, note that the client and MDS each have
459       an OSC device that handles communication with the corresponding OST.
460       To remove an OST from the file system:</para>
461       <orderedlist>
462         <listitem>
463           <para>If the OST is functional, and there are files located on
464           the OST that need to be migrated off of the OST, the file creation
465           for that OST should be temporarily deactivated on the MDS (each MDS
466           if running with multiple MDS nodes in DNE mode).
467           </para>
468           <orderedlist>
469             <listitem>
470               <para condition="l29">With Lustre 2.9 and later, the MDS should be
471               set to only disable file creation on that OST by setting
472               <literal>max_create_count</literal> to zero:
473               <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.max_create_count=0</screen>
474               This ensures that files deleted or migrated off of the OST
475               will have their corresponding OST objects destroyed, and the space
476               will be freed.  For example, to disable <literal>OST0000</literal>
477               in the filesystem <literal>testfs</literal>, run:
478               <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.max_create_count=0</screen>
479               on each MDS in the <literal>testfs</literal> filesystem.</para>
480             </listitem>
481             <listitem>
482               <para>With older versions of Lustre, to deactivate the OSC on the
483               MDS node(s) use:
484               <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.active=0</screen>
485               This will prevent the MDS from attempting any communication with
486               that OST, including destroying objects located thereon.  This is
487               fine if the OST will be removed permanently, if the OST is not
488               stable in operation, or if it is in a read-only state.  Otherwise,
489               the free space and objects on the OST will not decrease when
490               files are deleted, and object destruction will be deferred until
491               the MDS reconnects to the OST.</para>
492               <para>For example, to deactivate <literal>OST0000</literal> in
493               the filesystem <literal>testfs</literal>, run:
494               <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.active=0</screen>
495               Deactivating the OST on the <emphasis>MDS</emphasis> does not
496               prevent use of existing objects for read/write by a client.</para>
497               <note>
498                 <para>If migrating files from a working OST, do not deactivate
499                 the OST on clients. This causes IO errors when accessing files
500                 located there, and migrating files on the OST would fail.</para>
501               </note>
502               <caution>
503                 <para>Do not use <literal>lctl conf_param</literal> to
504                 deactivate the OST if it is still working, as this immediately
505                 and permanently deactivates it in the file system configuration
506                 on both the MDS and all clients.</para>
507               </caution>
508             </listitem>
509           </orderedlist>
510         </listitem>
511         <listitem>
512           <para>Discover all files that have objects residing on the
513           deactivated OST. Depending on whether the deactivated OST is
514           available or not, the data from that OST may be migrated to
515           other OSTs, or may need to be restored from backup.</para>
516           <orderedlist>
517             <listitem>
518               <para>If the OST is still online and available, find all
519               files with objects on the deactivated OST, and copy them
520               to other OSTs in the file system to: </para>
521               <screen>client# lfs find --ost <replaceable>ost_name</replaceable> <replaceable>/mount/point</replaceable> | lfs_migrate -y</screen>
522             </listitem>
523             <listitem>
524               <para>If the OST is no longer available, delete the files
525                 on that OST and restore them from backup:
526                 <screen>client# lfs find --ost <replaceable>ost_uuid</replaceable> -print0 <replaceable>/mount/point</replaceable> |
527         tee /tmp/files_to_restore | xargs -0 -n 1 unlink</screen>
528                 The list of files that need to be restored from backup is
529                 stored in <literal>/tmp/files_to_restore</literal>. Restoring
530                 these files is beyond the scope of this document.</para>
531             </listitem>
532           </orderedlist>
533         </listitem>
534         <listitem>
535           <para>Deactivate the OST.</para>
536           <orderedlist>
537             <listitem>
538               <para>
539                 If there is expected to be a replacement OST in some short
540                 time (a few days), the OST can temporarily be deactivated on
541                 the clients using:
542                 <screen>client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=0</screen>
543                 <note><para>This setting is only temporary and will be reset
544                 if the clients are remounted or rebooted. It needs to be run
545                 on all clients.</para>
546                 </note>
547               </para>
548             </listitem>
549             <listitem>
550               <para>If there is not expected to be a replacement for this OST in
551               the near future, permanently deactivate it on all clients and
552               the MDS by running the following command on the MGS:
553               <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=0</screen></para>
554               <note><para>A deactivated OST still appears in the file system
555                 configuration, though a replacement OST can be created using the
556                 <literal>mkfs.lustre --replace</literal> option, see
557                 <xref linkend="section_restore_ost"/>.
558               </para></note>
559             </listitem>
560           </orderedlist>
561         </listitem>
562       </orderedlist>
563     </section>
564       <section remap="h3" xml:id="section_ydg_pgt_tl">
565       <title><indexterm>
566           <primary>maintenance</primary>
567           <secondary>backing up OST config</secondary>
568         </indexterm>
569         <indexterm>
570           <primary>backup</primary>
571           <secondary>OST config</secondary>
572         </indexterm> Backing Up OST Configuration Files</title>
573       <para>If the OST device is still accessible, then the Lustre
574       configuration files on the OST should be backed up and saved for
575       future use in order to avoid difficulties when a replacement OST is
576       returned to service. These files rarely change, so they can and
577       should be backed up while the OST is functional and accessible. If
578       the deactivated OST is still available to mount (i.e. has not
579       permanently failed or is unmountable due to severe corruption), an
580       effort should be made to preserve these files. </para>
581       <orderedlist>
582         <listitem>
583           <para>Mount the OST file system.
584             <screen>oss# mkdir -p /mnt/ost
585 oss# mount -t ldiskfs <replaceable>/dev/ost_device</replaceable> /mnt/ost</screen>
586           </para>
587         </listitem>
588         <listitem>
589           <para>Back up the OST configuration files.
590             <screen>oss# tar cvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost last_rcvd \
591            CONFIGS/ O/0/LAST_ID</screen>
592           </para>
593         </listitem>
594         <listitem>
595           <para> Unmount the OST file system. <screen>oss# umount /mnt/ost</screen>
596           </para>
597         </listitem>
598       </orderedlist>
599     </section>
600       <section xml:id="section_restore_ost">
601       <title><indexterm>
602           <primary>maintenance</primary>
603           <secondary>restoring OST config</secondary>
604         </indexterm>
605         <indexterm>
606           <primary>backup</primary>
607           <secondary>restoring OST config</secondary>
608         </indexterm> Restoring OST Configuration Files</title>
609       <para>If the original OST is still available, it is best to follow the
610         OST backup and restore procedure given in either
611         <xref linkend="dbdoclet.backup_device"/>, or
612         <xref linkend="backup_fs_level"/> and
613         <xref linkend="backup_fs_level.restore"/>.</para>
614       <para>To replace an OST that was removed from service due to corruption
615       or hardware failure, the replacement OST needs to be formatted using
616       <literal>mkfs.lustre</literal>, and the Lustre file system configuration
617       should be restored, if available.  Any objects stored on the OST will
618       be permanently lost, and files using the OST should be deleted and/or
619       restored from backup.</para>
620       <para condition="l25">With Lustre 2.5 and later, it is possible to
621         replace an OST to the same index without restoring the configuration
622         files, using the <literal>--replace</literal> option at format time.
623         <screen>oss# mkfs.lustre --ost --reformat --replace --index=<replaceable>old_ost_index</replaceable> \
624         <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
625         The MDS and OSS will negotiate the <literal>LAST_ID</literal> value
626         for the replacement OST.
627       </para>
628       <para>If the OST configuration files were not backed up, due to the
629       OST file system being completely inaccessible, it is still possible to
630       replace the failed OST with a new one at the same OST index. </para>
631       <orderedlist>
632         <listitem>
633          <para>For older versions, format the OST file system without the
634            <literal>--replace</literal> option and restore the saved
635            configuration:
636            <screen>oss# mkfs.lustre --ost --reformat --index=<replaceable>old_ost_index</replaceable> \
637            <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
638          </para>
639         </listitem>
640         <listitem>
641           <para> Mount the OST file system.
642             <screen>oss# mkdir /mnt/ost
643 oss# mount -t ldiskfs <replaceable>/dev/new_ost_dev</replaceable> <replaceable>/mnt/ost</replaceable></screen>
644           </para>
645         </listitem>
646         <listitem>
647           <para>Restore the OST configuration files, if available.
648             <screen>oss# tar xvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost</screen></para>
649         </listitem>
650         <listitem>
651           <para>Recreate the OST configuration files, if unavailable. </para>
652           <para>Follow the procedure in
653             <xref linkend="dbdoclet.repair_ost_lastid"/> to recreate the LAST_ID
654             file for this OST index. The <literal>last_rcvd</literal> file
655             will be recreated when the OST is first mounted using the default
656             parameters, which are normally correct for all file systems. The
657             <literal>CONFIGS/mountdata</literal> file is created by
658             <literal>mkfs.lustre</literal> at format time, but has flags set
659             that request it to register itself with the MGS. It is possible to
660             copy the flags from another working OST (which should be the same):
661             <screen>oss1# debugfs -c -R &quot;dump CONFIGS/mountdata /tmp&quot; <replaceable>/dev/other_osdev</replaceable>
662 oss1# scp /tmp/mountdata oss0:/tmp/mountdata
663 oss0# dd if=/tmp/mountdata of=/mnt/ost/CONFIGS/mountdata bs=4 count=1 seek=5 skip=5 conv=notrunc</screen></para>
664         </listitem>
665         <listitem>
666           <para> Unmount the OST file system.
667             <screen>oss# umount /mnt/ost</screen>
668           </para>
669         </listitem>
670       </orderedlist>
671     </section>
672       <section xml:id="section_ucf_qgt_tl">
673       <title><indexterm>
674           <primary>maintenance</primary>
675           <secondary>reintroducing an OSTs</secondary>
676         </indexterm>Returning a Deactivated OST to Service</title>
677       <para>If the OST was permanently deactivated, it needs to be
678       reactivated in the MGS configuration.
679         <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=1</screen>
680         If the OST was temporarily deactivated, it needs to be reactivated on
681         the MDS and clients.
682         <screen>mds# lctl set_param osp.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1
683 client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1</screen></para>
684     </section>
685     </section>
686     <section xml:id="dbdoclet.50438199_77819">
687       <title><indexterm><primary>maintenance</primary><secondary>aborting recovery</secondary></indexterm>
688       <indexterm><primary>backup</primary><secondary>aborting recovery</secondary></indexterm>
689 Aborting Recovery</title>
690       <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>
691       <note>
692         <para>The recovery process is blocked until all OSTs are available. </para>
693       </note>
694     </section>
695     <section xml:id="dbdoclet.50438199_12607">
696       <title><indexterm><primary>maintenance</primary><secondary>identifying OST host</secondary></indexterm>
697 Determining Which Machine is Serving an OST </title>
698       <para>In the course of administering a Lustre file system, you may need to determine which
699       machine is serving a specific OST. It is not as simple as identifying the machine’s IP
700       address, as IP is only one of several networking protocols that the Lustre software uses and,
701       as such, LNet does not use IP addresses as node identifiers, but NIDs instead. To identify the
702       NID that is serving a specific OST, run one of the following commands on a client (you do not
703       need to be a root user):
704       <screen>client$ lctl get_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>*.ost_conn_uuid</screen>
705       For example:
706       <screen>client$ lctl get_param osc.*-OST0000*.ost_conn_uuid 
707 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen>-
708       OR -
709       <screen>client$ lctl get_param osc.*.ost_conn_uuid 
710 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
711 osc.testfs-OST0001-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
712 osc.testfs-OST0002-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
713 osc.testfs-OST0003-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
714 osc.testfs-OST0004-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen></para>
715     </section>
716     <section xml:id="dbdoclet.50438199_62333">
717       <title><indexterm><primary>maintenance</primary><secondary>changing failover node address</secondary></indexterm>
718 Changing the Address of a Failover Node</title>
719       <para>To change the address of a failover node (e.g, to use node X instead of node Y), run
720       this command on the OSS/OST partition (depending on which option was used to originally
721       identify the NID):
722       <screen>oss# tunefs.lustre --erase-params --servicenode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
723       or
724       <screen>oss# tunefs.lustre --erase-params --failnode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
725       For more information about the <literal>--servicenode</literal> and
726         <literal>--failnode</literal> options, see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
727         linkend="configuringfailover"/>.</para>
728     </section>
729     <section xml:id="dbdoclet.50438199_62545">
730       <title><indexterm><primary>maintenance</primary><secondary>separate a
731         combined MGS/MDT</secondary></indexterm>
732         Separate a combined MGS/MDT</title>
733       <para>These instructions assume the MGS node will be the same as the MDS
734         node. For instructions on how to move MGS to a different node, see
735         <xref linkend="dbdoclet.changingservernid"/>.</para>
736       <para>These instructions are for doing the split without shutting down
737         other servers and clients.</para>
738       <orderedlist>
739         <listitem>
740           <para>Stop the MDS.</para>
741           <para>Unmount the MDT</para>
742               <screen>umount -f <replaceable>/dev/mdt_device</replaceable> </screen>
743         </listitem>
744         <listitem>
745           <para>Create the MGS.</para>
746               <screen>mds# mkfs.lustre --mgs --device-size=<replaceable>size</replaceable> <replaceable>/dev/mgs_device</replaceable></screen>
747         </listitem>
748         <listitem>
749           <para>Copy the configuration data from MDT disk to the new MGS disk.</para>
750               <screen>mds# mount -t ldiskfs -o ro <replaceable>/dev/mdt_device</replaceable> <replaceable>/mdt_mount_point</replaceable></screen>
751               <screen>mds# mount -t ldiskfs -o rw <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable> </screen>
752               <screen>mds# cp -r <replaceable>/mdt_mount_point</replaceable>/CONFIGS/<replaceable>filesystem_name</replaceable>-* <replaceable>/mgs_mount_point</replaceable>/CONFIGS/. </screen>
753               <screen>mds# umount <replaceable>/mgs_mount_point</replaceable></screen>
754               <screen>mds# umount <replaceable>/mdt_mount_point</replaceable></screen>
755           <para>See <xref linkend="dbdoclet.50438199_54623"/> for alternative method.</para>
756         </listitem>
757         <listitem>
758           <para>Start the MGS.</para>
759               <screen>mgs# mount -t lustre <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable></screen>
760           <para>Check to make sure it knows about all your file system</para>
761               <screen>mgs:/root# lctl get_param mgs.MGS.filesystems</screen>
762         </listitem>
763         <listitem>
764           <para>Remove the MGS option from the MDT, and set the new MGS nid.</para>
765               <screen>mds# tunefs.lustre --nomgs --mgsnode=<replaceable>new_mgs_nid</replaceable> <replaceable>/dev/mdt-device</replaceable></screen>
766         </listitem>
767         <listitem>
768           <para>Start the MDT.</para>
769               <screen>mds# mount -t lustre <replaceable>/dev/mdt_device /mdt_mount_point</replaceable></screen>
770           <para>Check to make sure the MGS configuration looks right:</para>
771               <screen>mgs# lctl get_param mgs.MGS.live.<replaceable>filesystem_name</replaceable></screen>
772         </listitem>
773       </orderedlist>
774     </section>
775 </chapter>