Whamcloud - gitweb
LUDOC-11 osc: document tunable parameters
[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
121       the file system cannot be started, use the
122       <literal>tunefs.lustre --writeconf</literal> command to regenerate them.
123       After the <literal>writeconf</literal> command is run and the servers
124       restart, the configuration logs are re-generated and stored on the MGS
125       (as with a new file system).</para>
126       <para>You should only use the <literal>writeconf</literal> command if:</para>
127       <itemizedlist>
128         <listitem>
129           <para>The configuration logs are in a state where the file system cannot start</para>
130         </listitem>
131         <listitem>
132           <para>A server NID is being changed</para>
133         </listitem>
134       </itemizedlist>
135       <para>The <literal>writeconf</literal> command is destructive to some
136       configuration items (e.g. OST pools information and tunables set via
137       <literal>conf_param</literal>), and should be used with caution.</para>
138       <caution>
139         <para>The OST pools feature enables a group of OSTs to be named for
140         file striping purposes. If you use OST pools, be aware that running
141         the <literal>writeconf</literal> command erases
142         <emphasis role="bold">all</emphasis> pools information (as well as
143         any other parameters set via <literal>lctl conf_param</literal>).
144         We recommend that the pools definitions (and
145         <literal>conf_param</literal> settings) be executed via a script,
146         so they can be regenerated easily after <literal>writeconf</literal>
147         is performed.  However, tunables saved with <literal>lctl set_param
148         -P</literal> are <emphasis>not</emphasis> erased in this case.</para>
149       </caution>
150       <note>
151         <para>If the MGS still holds any configuration logs, it may be
152         possible to dump these logs to save any parameters stored with
153         <literal>lctl conf_param</literal> by dumping the config logs on
154         the MGS and saving the output:</para>
155 <screen>
156 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-client
157 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-MDT0000
158 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-OST0000
159 </screen>
160       </note>
161       <para>To regenerate Lustre file system configuration logs:</para>
162       <orderedlist>
163         <listitem>
164           <para>Stop the file system services in the following order before
165             running the <literal>tunefs.lustre --writeconf</literal> command:
166           </para>
167           <orderedlist>
168             <listitem>
169               <para>Unmount the clients.</para>
170             </listitem>
171             <listitem>
172               <para>Unmount the MDT(s).</para>
173             </listitem>
174             <listitem>
175               <para>Unmount the OST(s).</para>
176             </listitem>
177             <listitem>
178               <para>If the MGS is separate from the MDT it can remain mounted
179                 during this process.</para>
180             </listitem>
181           </orderedlist>
182         </listitem>
183         <listitem>
184           <para>Make sure the MDT and OST devices are available.</para>
185         </listitem>
186         <listitem>
187           <para>Run the <literal>tunefs.lustre --writeconf</literal> command
188             on all target devices.</para>
189           <para>Run writeconf on the MDT(s) first, and then the OST(s).</para>
190           <orderedlist>
191             <listitem>
192               <para>On each MDS, for each MDT run:</para>
193               <screen>mds# tunefs.lustre --writeconf <replaceable>/dev/mdt_device</replaceable></screen>
194             </listitem>
195             <listitem>
196               <para> On each OSS, for each OST run:
197           <screen>oss# tunefs.lustre --writeconf <replaceable>/dev/ost_device</replaceable></screen>
198           </para>
199             </listitem>
200           </orderedlist>
201         </listitem>
202         <listitem>
203           <para>Restart the file system in the following order:</para>
204           <orderedlist>
205             <listitem>
206               <para>Mount the separate MGT, if it is not already mounted.</para>
207             </listitem>
208             <listitem>
209               <para>Mount the MDT(s) in order, starting with MDT0000.</para>
210             </listitem>
211             <listitem>
212               <para>Mount the OSTs in order, starting with OST0000.</para>
213             </listitem>
214             <listitem>
215               <para>Mount the clients.</para>
216             </listitem>
217           </orderedlist>
218         </listitem>
219       </orderedlist>
220       <para>After the <literal>tunefs.lustre --writeconf</literal> command is
221       run, the configuration logs are re-generated as servers connect to the
222       MGS.</para>
223     </section>
224     <section xml:id="dbdoclet.changingservernid">
225       <title><indexterm><primary>maintenance</primary><secondary>changing a NID</secondary></indexterm>
226 Changing a Server NID</title>
227       <para>In Lustre software release 2.3 or earlier, the <literal>tunefs.lustre
228         --writeconf</literal> command is used to rewrite all of the configuration files.</para>
229       <para condition="l24">If you need to change the NID on the MDT or OST, a new
230         <literal>replace_nids</literal> command was added in Lustre software release 2.4 to simplify
231       this process. The <literal>replace_nids</literal> command differs from <literal>tunefs.lustre
232         --writeconf</literal> in that it does not erase the entire configuration log, precluding the
233       need the need to execute the <literal>writeconf</literal> command on all servers and
234       re-specify all permanent parameter settings. However, the <literal>writeconf</literal> command
235       can still be used if desired.</para>
236       <para>Change a server NID in these situations:</para>
237       <itemizedlist>
238         <listitem>
239           <para>New server hardware is added to the file system, and the MDS or an OSS is being moved to the new machine.</para>
240         </listitem>
241         <listitem>
242           <para>New network card is installed in the server.</para>
243         </listitem>
244         <listitem>
245           <para>You want to reassign IP addresses.</para>
246         </listitem>
247       </itemizedlist>
248       <para>To change a server NID:</para>
249       <orderedlist>
250         <listitem>
251                 <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>
252           <para>The <literal>lctl list_nids</literal> command indicates which network(s) are
253           configured to work with the Lustre file system.</para>
254         </listitem>
255         <listitem>
256           <para>Shut down the file system in this order:</para>
257           <orderedlist>
258             <listitem>
259               <para>Unmount the clients.</para>
260             </listitem>
261             <listitem>
262               <para>Unmount the MDT.</para>
263             </listitem>
264             <listitem>
265               <para>Unmount all OSTs.</para>
266             </listitem>
267           </orderedlist>
268         </listitem>
269         <listitem>
270           <para>If the MGS and MDS share a partition, start the MGS only:</para>
271           <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
272         </listitem>
273         <listitem>
274           <para>Run the <literal>replace_nids</literal> command on the MGS:</para>
275           <screen>lctl replace_nids <replaceable>devicename</replaceable> <replaceable>nid1</replaceable>[,nid2,nid3 ...]</screen>
276           <para>where <replaceable>devicename</replaceable> is the Lustre target name, e.g.
277             <literal>testfs-OST0013</literal></para>
278         </listitem>
279         <listitem>
280           <para>If the MGS and MDS share a partition, stop the MGS:</para>
281           <screen>umount <replaceable>mount_point</replaceable></screen>
282         </listitem>
283       </orderedlist>
284       <note><para>The <literal>replace_nids</literal> command also cleans
285       all old, invalidated records out of the configuration log, while
286       preserving all other current settings.</para></note> 
287       <note><para>The previous configuration log is backed up on the MGS
288       disk with the suffix <literal>'.bak'</literal>.</para></note>
289     </section>
290     <section xml:id="dbdoclet.clear_conf" condition="l2B">
291       <title><indexterm>
292             <primary>maintenance</primary>
293                 <secondary>Clearing a config</secondary>
294           </indexterm> Clearing configuration</title>
295       <para>
296           This command runs on MGS node having the MGS device mounted with
297           <literal>-o nosvc.</literal> It cleans up configuration files
298           stored in the CONFIGS/ directory of any records marked SKIP.
299           If the device name is given, then the specific logs for that
300           filesystem (e.g. testfs-MDT0000) are processed.  Otherwise, if a
301           filesystem name is given then all configuration files are cleared.
302           The previous configuration log is backed up on the MGS disk with
303           the suffix 'config.timestamp.bak'. Eg: Lustre-MDT0000-1476454535.bak.
304           </para>
305           <para> To clear a configuration:</para>
306           <orderedlist>
307              <listitem>
308                    <para>Shut down the file system in this order:</para>
309              <orderedlist>
310                <listitem>
311                  <para>Unmount the clients.</para>
312                </listitem>
313                <listitem>
314                  <para>Unmount the MDT.</para>
315                </listitem>
316                <listitem>
317                  <para>Unmount all OSTs.</para>
318                </listitem>
319              </orderedlist>
320              </listitem>
321              <listitem>
322                <para>
323                  If the MGS and MDS share a partition, start the MGS only
324                  using "nosvc" option.
325                </para>
326            <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
327              </listitem>
328              <listitem>
329                  <para>Run the <literal>clear_conf</literal> command on the MGS:
330                  </para>
331            <screen>lctl clear_conf <replaceable>config</replaceable></screen>
332              <para>
333                         Example: To clear the configuration for
334                         <literal>MDT0000</literal> on a filesystem named
335                         <literal>testfs</literal>
336              </para>
337            <screen>mgs# lctl clear_conf testfs-MDT0000</screen>
338              </listitem>
339            </orderedlist>
340         </section>
341     <section xml:id="dbdoclet.adding_new_mdt" condition='l24'>
342       <title><indexterm>
343         <primary>maintenance</primary>
344         <secondary>adding an MDT</secondary>
345       </indexterm>Adding a New MDT to a Lustre File System</title>
346         <para>Additional MDTs can be added using the DNE feature to serve one
347         or more remote sub-directories within a filesystem, in order to
348         increase the total number of files that can be created in the
349         filesystem, to increase aggregate metadata performance, or to isolate
350         user or application workloads from other users of the filesystem. It
351         is possible to have multiple remote sub-directories reference the
352         same MDT.  However, the root directory will always be located on
353         MDT0. To add a new MDT into the file system:</para>
354       <orderedlist>
355         <listitem>
356           <para>Discover the maximum MDT index. Each MDT must have unique index.</para>
357 <screen>
358 client$ lctl dl | grep mdc
359 36 UP mdc testfs-MDT0000-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
360 37 UP mdc testfs-MDT0001-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
361 38 UP mdc testfs-MDT0002-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
362 39 UP mdc testfs-MDT0003-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
363 </screen>
364         </listitem>
365         <listitem>
366           <para>Add the new block device as a new MDT at the next available
367           index. In this example, the next available index is 4.</para>
368 <screen>
369 mds# mkfs.lustre --reformat --fsname=<replaceable>testfs</replaceable> --mdt --mgsnode=<replaceable>mgsnode</replaceable> --index 4 <replaceable>/dev/mdt4_device</replaceable>
370 </screen>
371         </listitem>
372         <listitem>
373           <para>Mount the MDTs.</para>
374 <screen>
375 mds# mount –t lustre <replaceable>/dev/mdt4_blockdevice</replaceable> /mnt/mdt4
376 </screen>
377         </listitem>
378         <listitem>
379            <para>In order to start creating new files and directories on the
380            new MDT(s) they need to be attached into the namespace at one or
381            more subdirectories using the <literal>lfs mkdir</literal> command.
382            All files and directories below those created with
383            <literal>lfs mkdir</literal> will also be created on the same MDT
384            unless otherwise specified.
385            </para>
386 <screen>
387 client# lfs mkdir -i 3 /mnt/testfs/new_dir_on_mdt3
388 client# lfs mkdir -i 4 /mnt/testfs/new_dir_on_mdt4
389 client# lfs mkdir -c 4 /mnt/testfs/new_directory_striped_across_4_mdts
390 </screen>
391         </listitem>
392       </orderedlist>
393     </section>
394     <section xml:id="dbdoclet.adding_new_ost">
395       <title><indexterm><primary>maintenance</primary><secondary>adding a OST</secondary></indexterm>
396 Adding a New OST to a Lustre File System</title>
397       <para>A new OST can be added to existing Lustre file system on either
398       an existing OSS node or on a new OSS node.  In order to keep client IO
399       load balanced across OSS nodes for maximum aggregate performance, it is
400       not recommended to configure different numbers of OSTs to each OSS node.
401       </para>
402       <orderedlist>
403         <listitem>
404           <para> Add a new OST by using <literal>mkfs.lustre</literal> as when
405           the filesystem was first formatted, see
406           <xref linkend="dbdoclet.format_ost" /> for details.  Each new OST
407           must have a unique index number, use <literal>lctl dl</literal> to
408           see a list of all OSTs. For example, to add a new OST at index 12
409           to the <literal>testfs</literal> filesystem run following commands
410           should be run on the OSS:</para>
411           <screen>oss# mkfs.lustre --fsname=testfs --mgsnode=mds16@tcp0 --ost --index=12 /dev/sda
412 oss# mkdir -p /mnt/testfs/ost12
413 oss# mount -t lustre /dev/sda /mnt/testfs/ost12</screen>
414         </listitem>
415         <listitem>
416           <para>Balance OST space usage (possibly).</para>
417           <para>The file system can be quite unbalanced when new empty OSTs
418           are added to a relatively full filesystem. New file creations are
419           automatically balanced to favour the new OSTs. If this is a scratch
420           file system or files are pruned at regular intervals, then no further
421           work may be needed to balance the OST space usage as new files being
422           created will preferentially be placed on the less full OST(s). As old
423           files are deleted, they will release space on the old OST(s).</para>
424           <para>Files existing prior to the expansion can optionally be
425           rebalanced using the <literal>lfs_migrate</literal> utility.
426           This redistributes file data over the entire set of OSTs.</para>
427           <para>For example, to rebalance all files within the directory
428           <literal>/mnt/lustre/dir</literal>, enter:</para>
429           <screen>client# lfs_migrate /mnt/lustre/dir</screen>
430           <para>To migrate files within the <literal>/test</literal> file
431           system on <literal>OST0004</literal> that are larger than 4GB in
432           size to other OSTs, enter:</para>
433           <screen>client# lfs find /test --ost test-OST0004 -size +4G | lfs_migrate -y</screen>
434           <para>See <xref linkend="dbdoclet.lfs_migrate"/> for details.</para>
435         </listitem>
436       </orderedlist>
437     </section>
438     <section xml:id="dbdoclet.deactivating_mdt_ost">
439       <title><indexterm><primary>maintenance</primary><secondary>restoring an OST</secondary></indexterm>
440       <indexterm><primary>maintenance</primary><secondary>removing an OST</secondary></indexterm>
441 Removing and Restoring MDTs and OSTs</title>
442       <para>OSTs and DNE MDTs can be removed from and restored to a Lustre
443       filesystem.  Deactivating an OST means that it is temporarily or
444       permanently marked unavailable.  Deactivating an OST on the MDS means
445       it will not try to allocate new objects there or perform OST recovery,
446       while deactivating an OST the client means it will not wait for OST
447       recovery if it cannot contact the OST and will instead return an IO
448       error to the application immediately if files on the OST are accessed.
449       An OST may be permanently deactivated from the file system,
450       depending on the situation and commands used.</para>
451       <note><para>A permanently deactivated MDT or OST still appears in the
452         filesystem configuration until the configuration is regenerated with
453         <literal>writeconf</literal> or it is replaced with a new MDT or OST
454         at the same index and permanently reactivated.  A deactivated OST
455         will not be listed by <literal>lfs df</literal>.
456       </para></note>
457       <para>You may want to temporarily deactivate an OST on the MDS to
458       prevent new files from being written to it in several situations:</para>
459       <itemizedlist>
460         <listitem>
461           <para>A hard drive has failed and a RAID resync/rebuild is underway,
462           though the OST can also be marked <emphasis>degraded</emphasis> by
463           the RAID system to avoid allocating new files on the slow OST which
464           can reduce performance, see <xref linkend='dbdoclet.degraded_ost' />
465           for more details.
466           </para>
467         </listitem>
468         <listitem>
469           <para>OST is nearing its space capacity, though the MDS will already
470           try to avoid allocating new files on overly-full OSTs if possible,
471           see <xref linkend='dbdoclet.balancing_free_space' /> for details.
472           </para>
473         </listitem>
474         <listitem>
475           <para>MDT/OST storage or MDS/OSS node has failed, and will not
476           be available for some time (or forever), but there is still a
477           desire to continue using the filesystem before it is repaired.</para>
478         </listitem>
479       </itemizedlist>
480       <section condition="l24" xml:id="dbdoclet.rmremotedir">
481       <title><indexterm><primary>maintenance</primary><secondary>removing an MDT</secondary></indexterm>Removing an MDT from the File System</title>
482         <para>If the MDT is permanently inaccessible,
483         <literal>lfs rm_entry {directory}</literal> can be used to delete the
484         directory entry for the unavailable MDT. Using <literal>rmdir</literal>
485         would otherwise report an IO error due to the remote MDT being inactive.
486         Please note that if the MDT <emphasis>is</emphasis> available, standard
487         <literal>rm -r</literal> should be used to delete the remote directory.
488         After the remote directory has been removed, the administrator should
489         mark the MDT as permanently inactive with:</para>
490         <screen>lctl conf_param {MDT name}.mdc.active=0</screen>
491         <para>A user can identify which MDT holds a remote sub-directory using
492         the <literal>lfs</literal> utility. For example:</para>
493 <screen>client$ lfs getstripe --mdt-index /mnt/lustre/remote_dir1
494 1
495 client$ mkdir /mnt/lustre/local_dir0
496 client$ lfs getstripe --mdt-index /mnt/lustre/local_dir0
497 0
498 </screen>
499         <para>The <literal>lfs getstripe --mdt-index</literal> command
500         returns the index of the MDT that is serving the given directory.</para>
501       </section>
502       <section xml:id="dbdoclet.inactivemdt" condition='l24'>
503       <title>
504           <indexterm><primary>maintenance</primary></indexterm>
505           <indexterm><primary>maintenance</primary><secondary>inactive MDTs</secondary></indexterm>Working with Inactive MDTs</title>
506     <para>Files located on or below an inactive MDT are inaccessible until
507     the MDT is activated again. Clients accessing an inactive MDT will receive
508     an EIO error.</para>
509       </section>
510       <section remap="h3" xml:id="section_remove_ost">
511       <title><indexterm>
512           <primary>maintenance</primary>
513           <secondary>removing an OST</secondary>
514         </indexterm>Removing an OST from the File System</title>
515       <para>When deactivating an OST, note that the client and MDS each have
516       an OSC device that handles communication with the corresponding OST.
517       To remove an OST from the file system:</para>
518       <orderedlist>
519         <listitem>
520           <para>If the OST is functional, and there are files located on
521           the OST that need to be migrated off of the OST, the file creation
522           for that OST should be temporarily deactivated on the MDS (each MDS
523           if running with multiple MDS nodes in DNE mode).
524           </para>
525           <orderedlist>
526             <listitem>
527               <para condition="l29">With Lustre 2.9 and later, the MDS should be
528               set to only disable file creation on that OST by setting
529               <literal>max_create_count</literal> to zero:
530               <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.max_create_count=0</screen>
531               This ensures that files deleted or migrated off of the OST
532               will have their corresponding OST objects destroyed, and the space
533               will be freed.  For example, to disable <literal>OST0000</literal>
534               in the filesystem <literal>testfs</literal>, run:
535               <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.max_create_count=0</screen>
536               on each MDS in the <literal>testfs</literal> filesystem.</para>
537             </listitem>
538             <listitem>
539               <para>With older versions of Lustre, to deactivate the OSC on the
540               MDS node(s) use:
541               <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.active=0</screen>
542               This will prevent the MDS from attempting any communication with
543               that OST, including destroying objects located thereon.  This is
544               fine if the OST will be removed permanently, if the OST is not
545               stable in operation, or if it is in a read-only state.  Otherwise,
546               the free space and objects on the OST will not decrease when
547               files are deleted, and object destruction will be deferred until
548               the MDS reconnects to the OST.</para>
549               <para>For example, to deactivate <literal>OST0000</literal> in
550               the filesystem <literal>testfs</literal>, run:
551               <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.active=0</screen>
552               Deactivating the OST on the <emphasis>MDS</emphasis> does not
553               prevent use of existing objects for read/write by a client.</para>
554               <note>
555                 <para>If migrating files from a working OST, do not deactivate
556                 the OST on clients. This causes IO errors when accessing files
557                 located there, and migrating files on the OST would fail.</para>
558               </note>
559               <caution>
560                 <para>Do not use <literal>lctl conf_param</literal> to
561                 deactivate the OST if it is still working, as this immediately
562                 and permanently deactivates it in the file system configuration
563                 on both the MDS and all clients.</para>
564               </caution>
565             </listitem>
566           </orderedlist>
567         </listitem>
568         <listitem>
569           <para>Discover all files that have objects residing on the
570           deactivated OST. Depending on whether the deactivated OST is
571           available or not, the data from that OST may be migrated to
572           other OSTs, or may need to be restored from backup.</para>
573           <orderedlist>
574             <listitem>
575               <para>If the OST is still online and available, find all
576               files with objects on the deactivated OST, and copy them
577               to other OSTs in the file system to: </para>
578               <screen>client# lfs find --ost <replaceable>ost_name</replaceable> <replaceable>/mount/point</replaceable> | lfs_migrate -y</screen>
579               <para>Note that if multiple OSTs are being deactivated at one
580               time, the <literal>lfs find</literal> command can take multiple
581               <literal>--ost</literal> arguments, and will return files that
582               are located on <emphasis>any</emphasis> of the specified OSTs.
583               </para>
584             </listitem>
585             <listitem>
586               <para>If the OST is no longer available, delete the files
587                 on that OST and restore them from backup:
588                 <screen>client# lfs find --ost <replaceable>ost_uuid</replaceable> -print0 <replaceable>/mount/point</replaceable> |
589         tee /tmp/files_to_restore | xargs -0 -n 1 unlink</screen>
590                 The list of files that need to be restored from backup is
591                 stored in <literal>/tmp/files_to_restore</literal>. Restoring
592                 these files is beyond the scope of this document.</para>
593             </listitem>
594           </orderedlist>
595         </listitem>
596         <listitem>
597           <para>Deactivate the OST.</para>
598           <orderedlist>
599             <listitem>
600               <para>
601                 If there is expected to be a replacement OST in some short
602                 time (a few days), the OST can temporarily be deactivated on
603                 the clients using:
604                 <screen>client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=0</screen>
605                 <note><para>This setting is only temporary and will be reset
606                 if the clients are remounted or rebooted. It needs to be run
607                 on all clients.</para>
608                 </note>
609               </para>
610             </listitem>
611             <listitem>
612               <para>If there is not expected to be a replacement for this OST in
613               the near future, permanently deactivate it on all clients and
614               the MDS by running the following command on the MGS:
615               <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=0</screen></para>
616               <note><para>A deactivated OST still appears in the file system
617                 configuration, though a replacement OST can be created using the
618                 <literal>mkfs.lustre --replace</literal> option, see
619                 <xref linkend="section_restore_ost"/>.
620               </para></note>
621             </listitem>
622           </orderedlist>
623         </listitem>
624       </orderedlist>
625     </section>
626       <section remap="h3" xml:id="section_ydg_pgt_tl">
627       <title><indexterm>
628           <primary>maintenance</primary>
629           <secondary>backing up OST config</secondary>
630         </indexterm>
631         <indexterm>
632           <primary>backup</primary>
633           <secondary>OST config</secondary>
634         </indexterm> Backing Up OST Configuration Files</title>
635       <para>If the OST device is still accessible, then the Lustre
636       configuration files on the OST should be backed up and saved for
637       future use in order to avoid difficulties when a replacement OST is
638       returned to service. These files rarely change, so they can and
639       should be backed up while the OST is functional and accessible. If
640       the deactivated OST is still available to mount (i.e. has not
641       permanently failed or is unmountable due to severe corruption), an
642       effort should be made to preserve these files. </para>
643       <orderedlist>
644         <listitem>
645           <para>Mount the OST file system.
646             <screen>oss# mkdir -p /mnt/ost
647 oss# mount -t ldiskfs <replaceable>/dev/ost_device</replaceable> /mnt/ost</screen>
648           </para>
649         </listitem>
650         <listitem>
651           <para>Back up the OST configuration files.
652             <screen>oss# tar cvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost last_rcvd \
653            CONFIGS/ O/0/LAST_ID</screen>
654           </para>
655         </listitem>
656         <listitem>
657           <para> Unmount the OST file system. <screen>oss# umount /mnt/ost</screen>
658           </para>
659         </listitem>
660       </orderedlist>
661     </section>
662       <section xml:id="section_restore_ost">
663       <title><indexterm>
664           <primary>maintenance</primary>
665           <secondary>restoring OST config</secondary>
666         </indexterm>
667         <indexterm>
668           <primary>backup</primary>
669           <secondary>restoring OST config</secondary>
670         </indexterm> Restoring OST Configuration Files</title>
671       <para>If the original OST is still available, it is best to follow the
672         OST backup and restore procedure given in either
673         <xref linkend="dbdoclet.backup_device"/>, or
674         <xref linkend="backup_fs_level"/> and
675         <xref linkend="backup_fs_level.restore"/>.</para>
676       <para>To replace an OST that was removed from service due to corruption
677       or hardware failure, the replacement OST needs to be formatted using
678       <literal>mkfs.lustre</literal>, and the Lustre file system configuration
679       should be restored, if available.  Any objects stored on the OST will
680       be permanently lost, and files using the OST should be deleted and/or
681       restored from backup.</para>
682       <para condition="l25">With Lustre 2.5 and later, it is possible to
683         replace an OST to the same index without restoring the configuration
684         files, using the <literal>--replace</literal> option at format time.
685         <screen>oss# mkfs.lustre --ost --reformat --replace --index=<replaceable>old_ost_index</replaceable> \
686         <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
687         The MDS and OSS will negotiate the <literal>LAST_ID</literal> value
688         for the replacement OST.
689       </para>
690       <para>If the OST configuration files were not backed up, due to the
691       OST file system being completely inaccessible, it is still possible to
692       replace the failed OST with a new one at the same OST index. </para>
693       <orderedlist>
694         <listitem>
695          <para>For older versions, format the OST file system without the
696            <literal>--replace</literal> option and restore the saved
697            configuration:
698            <screen>oss# mkfs.lustre --ost --reformat --index=<replaceable>old_ost_index</replaceable> \
699            <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
700          </para>
701         </listitem>
702         <listitem>
703           <para> Mount the OST file system.
704             <screen>oss# mkdir /mnt/ost
705 oss# mount -t ldiskfs <replaceable>/dev/new_ost_dev</replaceable> <replaceable>/mnt/ost</replaceable></screen>
706           </para>
707         </listitem>
708         <listitem>
709           <para>Restore the OST configuration files, if available.
710             <screen>oss# tar xvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost</screen></para>
711         </listitem>
712         <listitem>
713           <para>Recreate the OST configuration files, if unavailable. </para>
714           <para>Follow the procedure in
715             <xref linkend="dbdoclet.repair_ost_lastid"/> to recreate the LAST_ID
716             file for this OST index. The <literal>last_rcvd</literal> file
717             will be recreated when the OST is first mounted using the default
718             parameters, which are normally correct for all file systems. The
719             <literal>CONFIGS/mountdata</literal> file is created by
720             <literal>mkfs.lustre</literal> at format time, but has flags set
721             that request it to register itself with the MGS. It is possible to
722             copy the flags from another working OST (which should be the same):
723             <screen>oss1# debugfs -c -R &quot;dump CONFIGS/mountdata /tmp&quot; <replaceable>/dev/other_osdev</replaceable>
724 oss1# scp /tmp/mountdata oss0:/tmp/mountdata
725 oss0# dd if=/tmp/mountdata of=/mnt/ost/CONFIGS/mountdata bs=4 count=1 seek=5 skip=5 conv=notrunc</screen></para>
726         </listitem>
727         <listitem>
728           <para> Unmount the OST file system.
729             <screen>oss# umount /mnt/ost</screen>
730           </para>
731         </listitem>
732       </orderedlist>
733     </section>
734       <section xml:id="section_ucf_qgt_tl">
735       <title><indexterm>
736           <primary>maintenance</primary>
737           <secondary>reintroducing an OSTs</secondary>
738         </indexterm>Returning a Deactivated OST to Service</title>
739       <para>If the OST was permanently deactivated, it needs to be
740       reactivated in the MGS configuration.
741         <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=1</screen>
742         If the OST was temporarily deactivated, it needs to be reactivated on
743         the MDS and clients.
744         <screen>mds# lctl set_param osp.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1
745 client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1</screen></para>
746     </section>
747     </section>
748     <section xml:id="dbdoclet.50438199_77819">
749       <title><indexterm><primary>maintenance</primary><secondary>aborting recovery</secondary></indexterm>
750       <indexterm><primary>backup</primary><secondary>aborting recovery</secondary></indexterm>
751 Aborting Recovery</title>
752       <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>
753       <note>
754         <para>The recovery process is blocked until all OSTs are available. </para>
755       </note>
756     </section>
757     <section xml:id="dbdoclet.50438199_12607">
758       <title><indexterm><primary>maintenance</primary><secondary>identifying OST host</secondary></indexterm>
759 Determining Which Machine is Serving an OST </title>
760       <para>In the course of administering a Lustre file system, you may need to determine which
761       machine is serving a specific OST. It is not as simple as identifying the machine’s IP
762       address, as IP is only one of several networking protocols that the Lustre software uses and,
763       as such, LNet does not use IP addresses as node identifiers, but NIDs instead. To identify the
764       NID that is serving a specific OST, run one of the following commands on a client (you do not
765       need to be a root user):
766       <screen>client$ lctl get_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>*.ost_conn_uuid</screen>
767       For example:
768       <screen>client$ lctl get_param osc.*-OST0000*.ost_conn_uuid 
769 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen>-
770       OR -
771       <screen>client$ lctl get_param osc.*.ost_conn_uuid 
772 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
773 osc.testfs-OST0001-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
774 osc.testfs-OST0002-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
775 osc.testfs-OST0003-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
776 osc.testfs-OST0004-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen></para>
777     </section>
778     <section xml:id="dbdoclet.50438199_62333">
779       <title><indexterm><primary>maintenance</primary><secondary>changing failover node address</secondary></indexterm>
780 Changing the Address of a Failover Node</title>
781       <para>To change the address of a failover node (e.g, to use node X instead of node Y), run
782       this command on the OSS/OST partition (depending on which option was used to originally
783       identify the NID):
784       <screen>oss# tunefs.lustre --erase-params --servicenode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
785       or
786       <screen>oss# tunefs.lustre --erase-params --failnode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
787       For more information about the <literal>--servicenode</literal> and
788         <literal>--failnode</literal> options, see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
789         linkend="configuringfailover"/>.</para>
790     </section>
791     <section xml:id="dbdoclet.50438199_62545">
792       <title><indexterm><primary>maintenance</primary><secondary>separate a
793         combined MGS/MDT</secondary></indexterm>
794         Separate a combined MGS/MDT</title>
795       <para>These instructions assume the MGS node will be the same as the MDS
796         node. For instructions on how to move MGS to a different node, see
797         <xref linkend="dbdoclet.changingservernid"/>.</para>
798       <para>These instructions are for doing the split without shutting down
799         other servers and clients.</para>
800       <orderedlist>
801         <listitem>
802           <para>Stop the MDS.</para>
803           <para>Unmount the MDT</para>
804               <screen>umount -f <replaceable>/dev/mdt_device</replaceable> </screen>
805         </listitem>
806         <listitem>
807           <para>Create the MGS.</para>
808               <screen>mds# mkfs.lustre --mgs --device-size=<replaceable>size</replaceable> <replaceable>/dev/mgs_device</replaceable></screen>
809         </listitem>
810         <listitem>
811           <para>Copy the configuration data from MDT disk to the new MGS disk.</para>
812               <screen>mds# mount -t ldiskfs -o ro <replaceable>/dev/mdt_device</replaceable> <replaceable>/mdt_mount_point</replaceable></screen>
813               <screen>mds# mount -t ldiskfs -o rw <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable> </screen>
814               <screen>mds# cp -r <replaceable>/mdt_mount_point</replaceable>/CONFIGS/<replaceable>filesystem_name</replaceable>-* <replaceable>/mgs_mount_point</replaceable>/CONFIGS/. </screen>
815               <screen>mds# umount <replaceable>/mgs_mount_point</replaceable></screen>
816               <screen>mds# umount <replaceable>/mdt_mount_point</replaceable></screen>
817           <para>See <xref linkend="dbdoclet.50438199_54623"/> for alternative method.</para>
818         </listitem>
819         <listitem>
820           <para>Start the MGS.</para>
821               <screen>mgs# mount -t lustre <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable></screen>
822           <para>Check to make sure it knows about all your file system</para>
823               <screen>mgs:/root# lctl get_param mgs.MGS.filesystems</screen>
824         </listitem>
825         <listitem>
826           <para>Remove the MGS option from the MDT, and set the new MGS nid.</para>
827               <screen>mds# tunefs.lustre --nomgs --mgsnode=<replaceable>new_mgs_nid</replaceable> <replaceable>/dev/mdt-device</replaceable></screen>
828         </listitem>
829         <listitem>
830           <para>Start the MDT.</para>
831               <screen>mds# mount -t lustre <replaceable>/dev/mdt_device /mdt_mount_point</replaceable></screen>
832           <para>Check to make sure the MGS configuration looks right:</para>
833               <screen>mgs# lctl get_param mgs.MGS.live.<replaceable>filesystem_name</replaceable></screen>
834         </listitem>
835       </orderedlist>
836     </section>
837 </chapter>