1 <?xml version='1.0' encoding='UTF-8'?>
2 <chapter xmlns="http://docbook.org/ns/docbook"
3 xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US"
4 xml:id="lustremaintenance">
5 <title xml:id="lustremaintenance.title">Lustre Maintenance</title>
6 <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>
9 <para><xref linkend="lustremaint.inactiveOST"/></para>
12 <para><xref linkend="lustremaint.findingNodes"/></para>
15 <para><xref linkend="lustremaint.mountingServerWithoutLustre"/></para>
18 <para><xref linkend="lustremaint.regenerateConfigLogs"/></para>
21 <para><xref linkend="lustremaint.changingservernid"/></para>
24 <para><xref linkend="lustremaint.clear_conf"/></para>
27 <para><xref linkend="lustremaint.adding_new_mdt"/></para>
30 <para><xref linkend="lustremaint.adding_new_ost"/></para>
33 <para><xref linkend="lustremaint.deactivating_mdt_ost"/></para>
36 <para><xref linkend="lustremaint.rmremotedir"/></para>
39 <para><xref linkend="lustremaint.inactivemdt"/></para>
42 <para><xref linkend="lustremaint.remove_ost"/></para>
45 <para><xref linkend="lustremaint.ydg_pgt_tl"/></para>
48 <para><xref linkend="lustremaint.restore_ost"/></para>
51 <para><xref linkend="lustremaint.ucf_qgt_tl"/></para>
54 <para><xref linkend="lustremaint.abortRecovery"/></para>
57 <para><xref linkend="lustremaint.determineOST"/></para>
60 <para><xref linkend="lustremaint.ChangeAddrFailoverNode"/></para>
63 <para><xref linkend="lustremaint.seperateCombinedMGSMDT"/></para>
66 <para><xref linkend="lustremaint.setMDTReadonly"/></para>
69 <para><xref linkend="lustremaint.tunefallocate"/></para>
72 <section xml:id="lustremaint.inactiveOST">
74 <indexterm><primary>maintenance</primary></indexterm>
75 <indexterm><primary>maintenance</primary><secondary>inactive OSTs</secondary></indexterm>
76 Working with Inactive OSTs</title>
77 <para>To mount a client or an MDT with one or more inactive OSTs, run commands similar to this:</para>
78 <screen>client# mount -o exclude=testfs-OST0000 -t lustre \
79 uml1:/testfs /mnt/testfs
80 client# lctl get_param lov.testfs-clilov-*.target_obd</screen>
81 <para>To activate an inactive OST on a live client or MDT, use the
82 <literal>lctl activate</literal> command on the OSC device. For example:</para>
83 <screen>lctl --device 7 activate</screen>
85 <para>A colon-separated list can also be specified. For example,
86 <literal>exclude=testfs-OST0000:testfs-OST0001</literal>.</para>
89 <section xml:id="lustremaint.findingNodes">
90 <title><indexterm><primary>maintenance</primary><secondary>finding nodes</secondary></indexterm>
91 Finding Nodes in the Lustre File System</title>
92 <para>There may be situations in which you need to find all nodes in
93 your Lustre file system or get the names of all OSTs.</para>
94 <para>To get a list of all Lustre nodes, run this command on the MGS:</para>
95 <screen># lctl get_param mgs.MGS.live.*</screen>
97 <para>This command must be run on the MGS.</para>
99 <para>In this example, file system <literal>testfs</literal> has three
100 nodes, <literal>testfs-MDT0000</literal>,
101 <literal>testfs-OST0000</literal>, and
102 <literal>testfs-OST0001</literal>.</para>
103 <screen>mgs:/root# lctl get_param mgs.MGS.live.*
108 testfs-OST0001 </screen>
109 <para>To get the names of all OSTs, run this command on the MDS:</para>
110 <screen>mds:/root# lctl get_param lov.*-mdtlov.target_obd </screen>
112 <para>This command must be run on the MDS.</para>
114 <para>In this example, there are two OSTs, testfs-OST0000 and
115 testfs-OST0001, which are both active.</para>
116 <screen>mgs:/root# lctl get_param lov.testfs-mdtlov.target_obd
117 0: testfs-OST0000_UUID ACTIVE
118 1: testfs-OST0001_UUID ACTIVE </screen>
120 <section xml:id="lustremaint.mountingServerWithoutLustre">
121 <title><indexterm><primary>maintenance</primary><secondary>mounting a server</secondary></indexterm>
122 Mounting a Server Without Lustre Service</title>
123 <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>
124 <screen>mount -t lustre <replaceable>/dev/mdt_partition</replaceable> -o nosvc <replaceable>/mount_point</replaceable></screen>
125 <para>The <literal><replaceable>mdt_partition</replaceable></literal> variable is the combined MGS/MDT block device.</para>
126 <para>In this example, the combined MGS/MDT is <literal>testfs-MDT0000</literal> and the mount point is <literal>/mnt/test/mdt</literal>.</para>
127 <screen>$ mount -t lustre -L testfs-MDT0000 -o nosvc /mnt/test/mdt</screen>
129 <section xml:id="lustremaint.regenerateConfigLogs">
130 <title><indexterm><primary>maintenance</primary><secondary>regenerating config logs</secondary></indexterm>
131 Regenerating Lustre Configuration Logs</title>
132 <para>If the Lustre file system configuration logs are in a state where
133 the file system cannot be started, use the
134 <literal>tunefs.lustre --writeconf</literal> command to regenerate them.
135 After the <literal>writeconf</literal> command is run and the servers
136 restart, the configuration logs are re-generated and stored on the MGS
137 (as with a new file system).</para>
138 <para>You should only use the <literal>writeconf</literal> command if:</para>
141 <para>The configuration logs are in a state where the file system cannot start</para>
144 <para>A server NID is being changed</para>
147 <para>The <literal>writeconf</literal> command is destructive to some
148 configuration items (e.g. OST pools information and tunables set via
149 <literal>conf_param</literal>), and should be used with caution.</para>
151 <para>The OST pools feature enables a group of OSTs to be named for
152 file striping purposes. If you use OST pools, be aware that running
153 the <literal>writeconf</literal> command erases
154 <emphasis role="bold">all</emphasis> pools information (as well as
155 any other parameters set via <literal>lctl conf_param</literal>).
156 We recommend that the pools definitions (and
157 <literal>conf_param</literal> settings) be executed via a script,
158 so they can be regenerated easily after <literal>writeconf</literal>
159 is performed. However, tunables saved with <literal>lctl set_param
160 -P</literal> are <emphasis>not</emphasis> erased in this case.</para>
163 <para>If the MGS still holds any configuration logs, it may be
164 possible to dump these logs to save any parameters stored with
165 <literal>lctl conf_param</literal> by dumping the config logs on
166 the MGS and saving the output (once for each MDT and OST device):
169 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-client
170 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-MDT0000
171 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-OST0000
174 <para>To regenerate Lustre file system configuration logs:</para>
177 <para>Stop the file system services in the following order before
178 running the <literal>tunefs.lustre --writeconf</literal> command:
182 <para>Unmount the clients.</para>
185 <para>Unmount the MDT(s).</para>
188 <para>Unmount the OST(s).</para>
191 <para>If the MGS is separate from the MDT it can remain mounted
192 during this process.</para>
197 <para>Make sure the MDT and OST devices are available.</para>
200 <para>Run the <literal>tunefs.lustre --writeconf</literal> command
201 on all target devices.</para>
202 <para>Run writeconf on the MDT(s) first, and then the OST(s).</para>
205 <para>On each MDS, for each MDT run:</para>
206 <screen>mds# tunefs.lustre --writeconf <replaceable>/dev/mdt_device</replaceable></screen>
209 <para> On each OSS, for each OST run:
210 <screen>oss# tunefs.lustre --writeconf <replaceable>/dev/ost_device</replaceable></screen>
216 <para>Restart the file system in the following order:</para>
219 <para>Mount the separate MGT, if it is not already mounted.</para>
222 <para>Mount the MDT(s) in order, starting with MDT0000.</para>
225 <para>Mount the OSTs in order, starting with OST0000.</para>
228 <para>Mount the clients.</para>
233 <para>After the <literal>tunefs.lustre --writeconf</literal> command is
234 run, the configuration logs are re-generated as servers connect to the
237 <section xml:id="lustremaint.changingservernid">
238 <title><indexterm><primary>maintenance</primary><secondary>changing a NID</secondary></indexterm>
239 Changing a Server NID</title>
240 <para>In order to totally rewrite the Lustre configuration, the
241 <literal>tunefs.lustre --writeconf</literal> command is used to
242 rewrite all of the configuration files.</para>
243 <para>If you need to change only the NID of the MDT or OST, the
244 <literal>replace_nids</literal> command can simplify this process.
245 The <literal>replace_nids</literal> command differs from
246 <literal>tunefs.lustre --writeconf</literal> in that it does not
247 erase the entire configuration log, precluding the need the need to
248 execute the <literal>writeconf</literal> command on all servers and
249 re-specify all permanent parameter settings. However, the
250 <literal>writeconf</literal> command can still be used if desired.
252 <para>Change a server NID in these situations:</para>
255 <para>New server hardware is added to the file system, and the MDS or an OSS is being moved to the new machine.</para>
258 <para>New network card is installed in the server.</para>
261 <para>You want to reassign IP addresses.</para>
264 <para>To change a server NID:</para>
267 <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>
268 <para>The <literal>lctl list_nids</literal> command indicates which network(s) are
269 configured to work with the Lustre file system.</para>
272 <para>Shut down the file system in this order:</para>
275 <para>Unmount the clients.</para>
278 <para>Unmount the MDT.</para>
281 <para>Unmount all OSTs.</para>
286 <para>If the MGS and MDS share a partition, start the MGS only:</para>
287 <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
290 <para>Run the <literal>replace_nids</literal> command on the MGS:</para>
291 <screen>lctl replace_nids <replaceable>devicename</replaceable> <replaceable>nid1</replaceable>[,nid2,nid3 ...]</screen>
292 <para>where <replaceable>devicename</replaceable> is the Lustre target name, e.g.
293 <literal>testfs-OST0013</literal></para>
296 <para>If the MGS and MDS share a partition, stop the MGS:</para>
297 <screen>umount <replaceable>mount_point</replaceable></screen>
300 <note><para>The <literal>replace_nids</literal> command also cleans
301 all old, invalidated records out of the configuration log, while
302 preserving all other current settings.</para></note>
303 <note><para>The previous configuration log is backed up on the MGS
304 disk with the suffix <literal>'.bak'</literal>.</para></note>
306 <section xml:id="lustremaint.clear_conf" condition="l2B">
308 <primary>maintenance</primary>
309 <secondary>Clearing a config</secondary>
310 </indexterm> Clearing configuration</title>
312 This command runs on MGS node having the MGS device mounted with
313 <literal>-o nosvc.</literal> It cleans up configuration files
314 stored in the CONFIGS/ directory of any records marked SKIP.
315 If the device name is given, then the specific logs for that
316 filesystem (e.g. testfs-MDT0000) are processed. Otherwise, if a
317 filesystem name is given then all configuration files are cleared.
318 The previous configuration log is backed up on the MGS disk with
319 the suffix 'config.timestamp.bak'. Eg: Lustre-MDT0000-1476454535.bak.
321 <para> To clear a configuration:</para>
324 <para>Shut down the file system in this order:</para>
327 <para>Unmount the clients.</para>
330 <para>Unmount the MDT.</para>
333 <para>Unmount all OSTs.</para>
339 If the MGS and MDS share a partition, start the MGS only
340 using "nosvc" option.
342 <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
345 <para>Run the <literal>clear_conf</literal> command on the MGS:
347 <screen>lctl clear_conf <replaceable>config</replaceable></screen>
349 Example: To clear the configuration for
350 <literal>MDT0000</literal> on a filesystem named
351 <literal>testfs</literal>
353 <screen>mgs# lctl clear_conf testfs-MDT0000</screen>
357 <section xml:id="lustremaint.adding_new_mdt">
359 <primary>maintenance</primary>
360 <secondary>adding an MDT</secondary>
361 </indexterm>Adding a New MDT to a Lustre File System</title>
362 <para>Additional MDTs can be added using the DNE feature to serve one
363 or more remote sub-directories within a filesystem, in order to
364 increase the total number of files that can be created in the
365 filesystem, to increase aggregate metadata performance, or to isolate
366 user or application workloads from other users of the filesystem. It
367 is possible to have multiple remote sub-directories reference the
368 same MDT. However, the root directory will always be located on
369 MDT0000. To add a new MDT into the file system:</para>
372 <para>Discover the maximum MDT index. Each MDT must have unique index.</para>
374 client$ lctl dl | grep mdc
375 36 UP mdc testfs-MDT0000-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
376 37 UP mdc testfs-MDT0001-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
377 38 UP mdc testfs-MDT0002-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
378 39 UP mdc testfs-MDT0003-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
382 <para>Add the new block device as a new MDT at the next available
383 index. In this example, the next available index is 4.</para>
385 mds# mkfs.lustre --reformat --fsname=<replaceable>testfs</replaceable> --mdt --mgsnode=<replaceable>mgsnode</replaceable> --index 4 <replaceable>/dev/mdt4_device</replaceable>
389 <para>Mount the MDTs.</para>
391 mds# mount –t lustre <replaceable>/dev/mdt4_blockdevice</replaceable> /mnt/mdt4
395 <para>In order to start creating new files and directories on the
396 new MDT(s) they need to be attached into the namespace at one or
397 more subdirectories using the <literal>lfs mkdir</literal> command.
398 All files and directories below those created with
399 <literal>lfs mkdir</literal> will also be created on the same MDT
400 unless otherwise specified.
403 client# lfs mkdir -i 3 /mnt/testfs/new_dir_on_mdt3
404 client# lfs mkdir -i 4 /mnt/testfs/new_dir_on_mdt4
405 client# lfs mkdir -c 4 /mnt/testfs/project/new_large_dir_striped_over_4_mdts
410 <section xml:id="lustremaint.adding_new_ost">
411 <title><indexterm><primary>maintenance</primary><secondary>adding a OST</secondary></indexterm>
412 Adding a New OST to a Lustre File System</title>
413 <para>A new OST can be added to existing Lustre file system on either
414 an existing OSS node or on a new OSS node. In order to keep client IO
415 load balanced across OSS nodes for maximum aggregate performance, it is
416 not recommended to configure different numbers of OSTs to each OSS node.
420 <para> Add a new OST by using <literal>mkfs.lustre</literal> as when
421 the filesystem was first formatted, see
422 <xref linkend="format_ost" /> for details. Each new OST
423 must have a unique index number, use <literal>lctl dl</literal> to
424 see a list of all OSTs. For example, to add a new OST at index 12
425 to the <literal>testfs</literal> filesystem run following commands
426 should be run on the OSS:</para>
427 <screen>oss# mkfs.lustre --fsname=testfs --mgsnode=mds16@tcp0 --ost --index=12 /dev/sda
428 oss# mkdir -p /mnt/testfs/ost12
429 oss# mount -t lustre /dev/sda /mnt/testfs/ost12</screen>
432 <para>Balance OST space usage (possibly).</para>
433 <para>The file system can be quite unbalanced when new empty OSTs
434 are added to a relatively full filesystem. New file creations are
435 automatically balanced to favour the new OSTs. If this is a scratch
436 file system or files are pruned at regular intervals, then no further
437 work may be needed to balance the OST space usage as new files being
438 created will preferentially be placed on the less full OST(s). As old
439 files are deleted, they will release space on the old OST(s).</para>
440 <para>Files existing prior to the expansion can optionally be
441 rebalanced using the <literal>lfs_migrate</literal> utility.
442 This redistributes file data over the entire set of OSTs.</para>
443 <para>For example, to rebalance all files within the directory
444 <literal>/mnt/lustre/dir</literal>, enter:</para>
445 <screen>client# lfs_migrate /mnt/lustre/dir</screen>
446 <para>To migrate files within the <literal>/test</literal> file
447 system on <literal>OST0004</literal> that are larger than 4GB in
448 size to other OSTs, enter:</para>
449 <screen>client# lfs find /test --ost test-OST0004 -size +4G | lfs_migrate -y</screen>
450 <para>See <xref linkend="lfs_migrate"/> for details.</para>
454 <section xml:id="lustremaint.deactivating_mdt_ost">
455 <title><indexterm><primary>maintenance</primary><secondary>restoring an OST</secondary></indexterm>
456 <indexterm><primary>maintenance</primary><secondary>removing an OST</secondary></indexterm>
457 Removing and Restoring MDTs and OSTs</title>
458 <para>OSTs and DNE MDTs can be removed from and restored to a Lustre
459 filesystem. Deactivating an OST means that it is temporarily or
460 permanently marked unavailable. Deactivating an OST on the MDS means
461 it will not try to allocate new objects there or perform OST recovery,
462 while deactivating an OST the client means it will not wait for OST
463 recovery if it cannot contact the OST and will instead return an IO
464 error to the application immediately if files on the OST are accessed.
465 An OST may be permanently deactivated from the file system,
466 depending on the situation and commands used.</para>
467 <note><para>A permanently deactivated MDT or OST still appears in the
468 filesystem configuration until the configuration is regenerated with
469 <literal>writeconf</literal> or it is replaced with a new MDT or OST
470 at the same index and permanently reactivated. A deactivated OST
471 will not be listed by <literal>lfs df</literal>.
473 <para>You may want to temporarily deactivate an OST on the MDS to
474 prevent new files from being written to it in several situations:</para>
477 <para>A hard drive has failed and a RAID resync/rebuild is underway,
478 though the OST can also be marked <emphasis>degraded</emphasis> by
479 the RAID system to avoid allocating new files on the slow OST which
480 can reduce performance, see <xref linkend='degraded_ost' />
485 <para>OST is nearing its space capacity, though the MDS will already
486 try to avoid allocating new files on overly-full OSTs if possible,
487 see <xref linkend='balancing_free_space' /> for details.
491 <para>MDT/OST storage or MDS/OSS node has failed, and will not
492 be available for some time (or forever), but there is still a
493 desire to continue using the filesystem before it is repaired.</para>
496 <section xml:id="lustremaint.rmremotedir">
497 <title><indexterm><primary>maintenance</primary><secondary>removing an MDT</secondary></indexterm>Removing an MDT from the File System</title>
498 <para>If the MDT is permanently inaccessible,
499 <literal>lfs rm_entry {directory}</literal> can be used to delete the
500 directory entry for the unavailable MDT. Using <literal>rmdir</literal>
501 would otherwise report an IO error due to the remote MDT being inactive.
502 Please note that if the MDT <emphasis>is</emphasis> available, standard
503 <literal>rm -r</literal> should be used to delete the remote directory.
504 After the remote directory has been removed, the administrator should
505 mark the MDT as permanently inactive with:</para>
506 <screen>lctl conf_param {MDT name}.mdc.active=0</screen>
507 <para>A user can identify which MDT holds a remote sub-directory using
508 the <literal>lfs</literal> utility. For example:</para>
509 <screen>client$ lfs getstripe --mdt-index /mnt/lustre/remote_dir1
511 client$ mkdir /mnt/lustre/local_dir0
512 client$ lfs getstripe --mdt-index /mnt/lustre/local_dir0
515 <para>The <literal>lfs getstripe --mdt-index</literal> command
516 returns the index of the MDT that is serving the given directory.</para>
518 <section xml:id="lustremaint.inactivemdt">
520 <indexterm><primary>maintenance</primary></indexterm>
521 <indexterm><primary>maintenance</primary><secondary>inactive MDTs</secondary></indexterm>Working with Inactive MDTs</title>
522 <para>Files located on or below an inactive MDT are inaccessible until
523 the MDT is activated again. Clients accessing an inactive MDT will receive
526 <section remap="h3" xml:id="lustremaint.remove_ost">
528 <primary>maintenance</primary>
529 <secondary>removing an OST</secondary>
530 </indexterm>Removing an OST from the File System</title>
531 <para>When deactivating an OST, note that the client and MDS each have
532 an OSC device that handles communication with the corresponding OST.
533 To remove an OST from the file system:</para>
536 <para>If the OST is functional, and there are files located on
537 the OST that need to be migrated off of the OST, the file creation
538 for that OST should be temporarily deactivated on the MDS (each MDS
539 if running with multiple MDS nodes in DNE mode).
543 <para condition="l29">With Lustre 2.9 and later, the MDS should be
544 set to only disable file creation on that OST by setting
545 <literal>max_create_count</literal> to zero:
546 <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.max_create_count=0</screen>
547 This ensures that files deleted or migrated off of the OST
548 will have their corresponding OST objects destroyed, and the space
549 will be freed. For example, to disable <literal>OST0000</literal>
550 in the filesystem <literal>testfs</literal>, run:
551 <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.max_create_count=0</screen>
552 on each MDS in the <literal>testfs</literal> filesystem.</para>
555 <para>With older versions of Lustre, to deactivate the OSC on the
557 <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.active=0</screen>
558 This will prevent the MDS from attempting any communication with
559 that OST, including destroying objects located thereon. This is
560 fine if the OST will be removed permanently, if the OST is not
561 stable in operation, or if it is in a read-only state. Otherwise,
562 the free space and objects on the OST will not decrease when
563 files are deleted, and object destruction will be deferred until
564 the MDS reconnects to the OST.</para>
565 <para>For example, to deactivate <literal>OST0000</literal> in
566 the filesystem <literal>testfs</literal>, run:
567 <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.active=0</screen>
568 Deactivating the OST on the <emphasis>MDS</emphasis> does not
569 prevent use of existing objects for read/write by a client.</para>
571 <para>If migrating files from a working OST, do not deactivate
572 the OST on clients. This causes IO errors when accessing files
573 located there, and migrating files on the OST would fail.</para>
576 <para>Do not use <literal>lctl set_param -P</literal> or
577 <literal>lctl conf_param</literal> to
578 deactivate the OST if it is still working, as this immediately
579 and permanently deactivates it in the file system configuration
580 on both the MDS and all clients.</para>
586 <para>Discover all files that have objects residing on the
587 deactivated OST. Depending on whether the deactivated OST is
588 available or not, the data from that OST may be migrated to
589 other OSTs, or may need to be restored from backup.</para>
592 <para>If the OST is still online and available, find all
593 files with objects on the deactivated OST, and copy them
594 to other OSTs in the file system to: </para>
595 <screen>client# lfs find --ost <replaceable>ost_name</replaceable> <replaceable>/mount/point</replaceable> | lfs_migrate -y</screen>
596 <para>Note that if multiple OSTs are being deactivated at one
597 time, the <literal>lfs find</literal> command can take multiple
598 <literal>--ost</literal> arguments, and will return files that
599 are located on <emphasis>any</emphasis> of the specified OSTs.
603 <para>If the OST is no longer available, delete the files
604 on that OST and restore them from backup:
605 <screen>client# lfs find --ost <replaceable>ost_uuid</replaceable> -print0 <replaceable>/mount/point</replaceable> |
606 tee /tmp/files_to_restore | xargs -0 -n 1 unlink</screen>
607 The list of files that need to be restored from backup is
608 stored in <literal>/tmp/files_to_restore</literal>. Restoring
609 these files is beyond the scope of this document.</para>
614 <para>Deactivate the OST.</para>
618 If there is expected to be a replacement OST in some short
619 time (a few days), the OST can temporarily be deactivated on
621 <screen>client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=0</screen>
622 <note><para>This setting is only temporary and will be reset
623 if the clients are remounted or rebooted. It needs to be run
624 on all clients.</para>
629 <para>If there is not expected to be a replacement for this OST in
630 the near future, permanently deactivate it on all clients and
631 the MDS by running the following command on the MGS:
632 <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=0</screen></para>
633 <note><para>A deactivated OST still appears in the file system
634 configuration, though a replacement OST can be created that
635 re-uses the same OST index with the
636 <literal>mkfs.lustre --replace</literal> option, see
637 <xref linkend="lustremaint.restore_ost"/>.
639 <para condition="l2G">
640 In Lustre 2.16 and later, it is possible to run the command
641 "<literal>lctl del_ost --target <replaceable>fsname</replaceable>-OST<replaceable>xxxx</replaceable></literal>"
642 on the MGS to totally remove an OST from the MGS configuration
643 logs. This will cancel the configuration logs for that OST in
644 the client and MDT configuration logs for the named filesystem.
645 This permanently removes the configuration records for that OST
646 from the filesystem, so that it will not be visible on later
647 client and MDT mounts, and should only be run after earlier
648 steps to migrate files off the OST.
650 <para>If the <literal>del_ost</literal> command is not available,
651 the OST configuration records should be found in the startup
652 logs by running the command
653 "<literal>lctl --device MGS llog_print <replaceable>fsname</replaceable>-client</literal>"
655 "<literal>... <replaceable>$fsname</replaceable>-MDT<replaceable>xxxx</replaceable></literal>"
656 for all the MDTs) to list all <literal>attach</literal>,
657 <literal>setup</literal>, <literal>add_osc</literal>,
658 <literal>add_pool</literal>, and other records related to the
659 removed OST(s). Once the <literal>index</literal> value is
660 known for each configuration record, the command
661 "<literal>lctl --device MGS llog_cancel <replaceable>llog_name</replaceable> -i <replaceable>index</replaceable> </literal>"
662 will drop that record from the configuration log
663 <replaceable>llog_name</replaceable>. This is needed for each
664 of <literal><replaceable>fsname</replaceable>-client</literal>
665 and <literal><replaceable>fsname</replaceable>-MDTxxxx</literal>
666 configuration logs so that new mounts will no longer process it.
667 If a whole OSS is being removed, the<literal>add_uuid</literal>
668 records for the OSS should similarly be canceled.
670 mgs# lctl --device MGS llog_print testfs-client | egrep "192.168.10.99@tcp|OST0003"
671 - { index: 135, event: add_uuid, nid: 192.168.10.99@tcp(0x20000c0a80a63), node: 192.168.10.99@tcp }
672 - { index: 136, event: attach, device: testfs-OST0003-osc, type: osc, UUID: testfs-clilov_UUID }
673 - { index: 137, event: setup, device: testfs-OST0003-osc, UUID: testfs-OST0003_UUID, node: 192.168.10.99@tcp }
674 - { index: 138, event: add_osc, device: testfs-clilov, ost: testfs-OST0003_UUID, index: 3, gen: 1 }
675 mgs# lctl --device MGS llog_cancel testfs-client -i 138
676 mgs# lctl --device MGS llog_cancel testfs-client -i 137
677 mgs# lctl --device MGS llog_cancel testfs-client -i 136
685 <section remap="h3" xml:id="lustremaint.ydg_pgt_tl">
687 <primary>maintenance</primary>
688 <secondary>backing up OST config</secondary>
691 <primary>backup</primary>
692 <secondary>OST config</secondary>
693 </indexterm> Backing Up OST Configuration Files</title>
694 <para>If the OST device is still accessible, then the Lustre
695 configuration files on the OST should be backed up and saved for
696 future use in order to avoid difficulties when a replacement OST is
697 returned to service. These files rarely change, so they can and
698 should be backed up while the OST is functional and accessible. If
699 the deactivated OST is still available to mount (i.e. has not
700 permanently failed or is unmountable due to severe corruption), an
701 effort should be made to preserve these files. </para>
704 <para>Mount the OST file system.
705 <screen>oss# mkdir -p /mnt/ost
706 oss# mount -t ldiskfs <replaceable>/dev/ost_device</replaceable> /mnt/ost</screen>
710 <para>Back up the OST configuration files.
711 <screen>oss# tar cvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost last_rcvd \
712 CONFIGS/ O/0/LAST_ID</screen>
716 <para> Unmount the OST file system. <screen>oss# umount /mnt/ost</screen>
721 <section xml:id="lustremaint.restore_ost">
723 <primary>maintenance</primary>
724 <secondary>restoring OST config</secondary>
727 <primary>backup</primary>
728 <secondary>restoring OST config</secondary>
729 </indexterm> Restoring OST Configuration Files</title>
730 <para>If the original OST is still available, it is best to follow the
731 OST backup and restore procedure given in either
732 <xref linkend="backup_device"/>, or
733 <xref linkend="backup_fs_level"/> and
734 <xref linkend="backup_fs_level.restore"/>.</para>
735 <para>To replace an OST that was removed from service due to corruption
736 or hardware failure, the replacement OST needs to be formatted using
737 <literal>mkfs.lustre</literal>, and the Lustre file system configuration
738 should be restored, if available. Any objects stored on the OST will
739 be permanently lost, and files using the OST should be deleted and/or
740 restored from backup.</para>
741 <para condition="l25">With Lustre 2.5 and later, it is possible to
742 replace an OST to the same index without restoring the configuration
743 files, using the <literal>--replace</literal> option at format time.
744 <screen>oss# mkfs.lustre --ost --reformat --replace --index=<replaceable>old_ost_index</replaceable> \
745 <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
746 The MDS and OSS will negotiate the <literal>LAST_ID</literal> value
747 for the replacement OST.
749 <para>If the OST configuration files were not backed up, due to the
750 OST file system being completely inaccessible, it is still possible to
751 replace the failed OST with a new one at the same OST index. </para>
754 <para>For older versions, format the OST file system without the
755 <literal>--replace</literal> option and restore the saved
757 <screen>oss# mkfs.lustre --ost --reformat --index=<replaceable>old_ost_index</replaceable> \
758 <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
762 <para> Mount the OST file system.
763 <screen>oss# mkdir /mnt/ost
764 oss# mount -t ldiskfs <replaceable>/dev/new_ost_dev</replaceable> <replaceable>/mnt/ost</replaceable></screen>
768 <para>Restore the OST configuration files, if available.
769 <screen>oss# tar xvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost</screen></para>
772 <para>Recreate the OST configuration files, if unavailable. </para>
773 <para>Follow the procedure in
774 <xref linkend="repair_ost_lastid"/> to recreate the LAST_ID
775 file for this OST index. The <literal>last_rcvd</literal> file
776 will be recreated when the OST is first mounted using the default
777 parameters, which are normally correct for all file systems. The
778 <literal>CONFIGS/mountdata</literal> file is created by
779 <literal>mkfs.lustre</literal> at format time, but has flags set
780 that request it to register itself with the MGS. It is possible to
781 copy the flags from another working OST (which should be the same):
782 <screen>oss1# debugfs -c -R "dump CONFIGS/mountdata /tmp" <replaceable>/dev/other_osdev</replaceable>
783 oss1# scp /tmp/mountdata oss0:/tmp/mountdata
784 oss0# dd if=/tmp/mountdata of=/mnt/ost/CONFIGS/mountdata bs=4 count=1 seek=5 skip=5 conv=notrunc</screen></para>
787 <para> Unmount the OST file system.
788 <screen>oss# umount /mnt/ost</screen>
793 <section xml:id="lustremaint.ucf_qgt_tl">
795 <primary>maintenance</primary>
796 <secondary>reintroducing an OSTs</secondary>
797 </indexterm>Returning a Deactivated OST to Service</title>
798 <para>If the OST was permanently deactivated, it needs to be
799 reactivated in the MGS configuration.
800 <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=1</screen>
801 If the OST was temporarily deactivated, it needs to be reactivated on
803 <screen>mds# lctl set_param osp.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1
804 client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1</screen></para>
807 <section xml:id="lustremaint.abortRecovery">
808 <title><indexterm><primary>maintenance</primary><secondary>aborting recovery</secondary></indexterm>
809 <indexterm><primary>backup</primary><secondary>aborting recovery</secondary></indexterm>
810 Aborting Recovery</title>
811 <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>
813 <para>The recovery process is blocked until all OSTs are available. </para>
816 <section xml:id="lustremaint.determineOST">
817 <title><indexterm><primary>maintenance</primary><secondary>identifying OST host</secondary></indexterm>
818 Determining Which Machine is Serving an OST </title>
819 <para>In the course of administering a Lustre file system, you may need to determine which
820 machine is serving a specific OST. It is not as simple as identifying the machine’s IP
821 address, as IP is only one of several networking protocols that the Lustre software uses and,
822 as such, LNet does not use IP addresses as node identifiers, but NIDs instead. To identify the
823 NID that is serving a specific OST, run one of the following commands on a client (you do not
824 need to be a root user):
825 <screen>client$ lctl get_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>*.ost_conn_uuid</screen>
827 <screen>client$ lctl get_param osc.*-OST0000*.ost_conn_uuid
828 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen>-
830 <screen>client$ lctl get_param osc.*.ost_conn_uuid
831 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
832 osc.testfs-OST0001-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
833 osc.testfs-OST0002-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
834 osc.testfs-OST0003-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
835 osc.testfs-OST0004-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen></para>
837 <section xml:id="lustremaint.ChangeAddrFailoverNode">
838 <title><indexterm><primary>maintenance</primary><secondary>changing failover node address</secondary></indexterm>
839 Changing the Address of a Failover Node</title>
840 <para>To change the address of a failover node (e.g, to use node X instead of node Y), run
841 this command on the OSS/OST partition (depending on which option was used to originally
843 <screen>oss# tunefs.lustre --erase-params --servicenode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
845 <screen>oss# tunefs.lustre --erase-params --failnode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
846 For more information about the <literal>--servicenode</literal> and
847 <literal>--failnode</literal> options, see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
848 linkend="configuringfailover"/>.</para>
850 <section xml:id="lustremaint.seperateCombinedMGSMDT">
851 <title><indexterm><primary>maintenance</primary><secondary>separate a
852 combined MGS/MDT</secondary></indexterm>
853 Separate a combined MGS/MDT</title>
854 <para>These instructions assume the MGS node will be the same as the MDS
855 node. For instructions on how to move MGS to a different node, see
856 <xref linkend="lustremaint.changingservernid"/>.</para>
857 <para>These instructions are for doing the split without shutting down
858 other servers and clients.</para>
861 <para>Stop the MDS.</para>
862 <para>Unmount the MDT</para>
863 <screen>umount -f <replaceable>/dev/mdt_device</replaceable> </screen>
866 <para>Create the MGS.</para>
867 <screen>mds# mkfs.lustre --mgs --device-size=<replaceable>size</replaceable> <replaceable>/dev/mgs_device</replaceable></screen>
870 <para>Copy the configuration data from MDT disk to the new MGS disk.</para>
871 <screen>mds# mount -t ldiskfs -o ro <replaceable>/dev/mdt_device</replaceable> <replaceable>/mdt_mount_point</replaceable></screen>
872 <screen>mds# mount -t ldiskfs -o rw <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable> </screen>
873 <screen>mds# cp -r <replaceable>/mdt_mount_point</replaceable>/CONFIGS/<replaceable>filesystem_name</replaceable>-* <replaceable>/mgs_mount_point</replaceable>/CONFIGS/. </screen>
874 <screen>mds# umount <replaceable>/mgs_mount_point</replaceable></screen>
875 <screen>mds# umount <replaceable>/mdt_mount_point</replaceable></screen>
876 <para>See <xref linkend="lustremaint.regenerateConfigLogs"/> for alternative method.</para>
879 <para>Start the MGS.</para>
880 <screen>mgs# mount -t lustre <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable></screen>
881 <para>Check to make sure it knows about all your file system</para>
882 <screen>mgs:/root# lctl get_param mgs.MGS.filesystems</screen>
885 <para>Remove the MGS option from the MDT, and set the new MGS nid.</para>
886 <screen>mds# tunefs.lustre --nomgs --mgsnode=<replaceable>new_mgs_nid</replaceable> <replaceable>/dev/mdt-device</replaceable></screen>
889 <para>Start the MDT.</para>
890 <screen>mds# mount -t lustre <replaceable>/dev/mdt_device /mdt_mount_point</replaceable></screen>
891 <para>Check to make sure the MGS configuration looks right:</para>
892 <screen>mgs# lctl get_param mgs.MGS.live.<replaceable>filesystem_name</replaceable></screen>
896 <section xml:id="lustremaint.setMDTReadonly" condition="l2D">
897 <title><indexterm><primary>maintenance</primary>
898 <secondary>set an MDT to readonly</secondary></indexterm>
899 Set an MDT to read-only</title>
900 <para>It is sometimes desirable to be able to mark the filesystem
901 read-only directly on the server, rather than remounting the clients and
902 setting the option there. This can be useful if there is a rogue client
903 that is deleting files, or when decommissioning a system to prevent
904 already-mounted clients from modifying it anymore.</para>
905 <para>Set the <literal>mdt.*.readonly</literal> parameter to
906 <literal>1</literal> to immediately set the MDT to read-only. All future
907 MDT access will immediately return a "Read-only file system" error
908 (<literal>EROFS</literal>) until the parameter is set to
909 <literal>0</literal> again.</para>
910 <para>Example of setting the <literal>readonly</literal> parameter to
911 <literal>1</literal>, verifying the current setting, accessing from a
912 client, and setting the parameter back to <literal>0</literal>:</para>
913 <screen>mds# lctl set_param mdt.fs-MDT0000.readonly=1
914 mdt.fs-MDT0000.readonly=1
916 mds# lctl get_param mdt.fs-MDT0000.readonly
917 mdt.fs-MDT0000.readonly=1
919 client$ touch test_file
920 touch: cannot touch ‘test_file’: Read-only file system
922 mds# lctl set_param mdt.fs-MDT0000.readonly=0
923 mdt.fs-MDT0000.readonly=0</screen>
925 <section xml:id="lustremaint.tunefallocate" condition="l2E">
926 <title><indexterm><primary>maintenance</primary>
927 <secondary>Tune fallocate</secondary></indexterm>
928 Tune Fallocate for ldiskfs</title>
929 <para>This section shows how to tune/enable/disable fallocate for
931 <para>The default <literal>mode=0</literal> is the standard
932 "allocate unwritten extents" behavior used by ext4. This is by far the
933 fastest for space allocation, but requires the unwritten extents to be
934 split and/or zeroed when they are overwritten.</para>
935 <para> The OST fallocate <literal>mode=1</literal> can also be set to use
936 "zeroed extents", which may be handled by "WRITE SAME", "TRIM zeroes data",
937 or other low-level functionality in the underlying block device.</para>
938 <para><literal>mode=-1</literal> completely disables fallocate.</para>
939 <para>Example: To completely disable fallocate</para>
940 <screen>lctl set_param osd-ldiskfs.*.fallocate_zero_blocks=-1</screen>
941 <para>Example: To enable fallocate to use 'zeroed extents'</para>
942 <screen>lctl set_param osd-ldiskfs.*.fallocate_zero_blocks=1</screen>
946 vim:expandtab:shiftwidth=2:tabstop=8: