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:</para>
168 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-client
169 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-MDT0000
170 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-OST0000
173 <para>To regenerate Lustre file system configuration logs:</para>
176 <para>Stop the file system services in the following order before
177 running the <literal>tunefs.lustre --writeconf</literal> command:
181 <para>Unmount the clients.</para>
184 <para>Unmount the MDT(s).</para>
187 <para>Unmount the OST(s).</para>
190 <para>If the MGS is separate from the MDT it can remain mounted
191 during this process.</para>
196 <para>Make sure the MDT and OST devices are available.</para>
199 <para>Run the <literal>tunefs.lustre --writeconf</literal> command
200 on all target devices.</para>
201 <para>Run writeconf on the MDT(s) first, and then the OST(s).</para>
204 <para>On each MDS, for each MDT run:</para>
205 <screen>mds# tunefs.lustre --writeconf <replaceable>/dev/mdt_device</replaceable></screen>
208 <para> On each OSS, for each OST run:
209 <screen>oss# tunefs.lustre --writeconf <replaceable>/dev/ost_device</replaceable></screen>
215 <para>Restart the file system in the following order:</para>
218 <para>Mount the separate MGT, if it is not already mounted.</para>
221 <para>Mount the MDT(s) in order, starting with MDT0000.</para>
224 <para>Mount the OSTs in order, starting with OST0000.</para>
227 <para>Mount the clients.</para>
232 <para>After the <literal>tunefs.lustre --writeconf</literal> command is
233 run, the configuration logs are re-generated as servers connect to the
236 <section xml:id="lustremaint.changingservernid">
237 <title><indexterm><primary>maintenance</primary><secondary>changing a NID</secondary></indexterm>
238 Changing a Server NID</title>
239 <para>In order to totally rewrite the Lustre configuration, the
240 <literal>tunefs.lustre --writeconf</literal> command is used to
241 rewrite all of the configuration files.</para>
242 <para>If you need to change only the NID of the MDT or OST, the
243 <literal>replace_nids</literal> command can simplify this process.
244 The <literal>replace_nids</literal> command differs from
245 <literal>tunefs.lustre --writeconf</literal> in that it does not
246 erase the entire configuration log, precluding the need the need to
247 execute the <literal>writeconf</literal> command on all servers and
248 re-specify all permanent parameter settings. However, the
249 <literal>writeconf</literal> command can still be used if desired.
251 <para>Change a server NID in these situations:</para>
254 <para>New server hardware is added to the file system, and the MDS or an OSS is being moved to the new machine.</para>
257 <para>New network card is installed in the server.</para>
260 <para>You want to reassign IP addresses.</para>
263 <para>To change a server NID:</para>
266 <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>
267 <para>The <literal>lctl list_nids</literal> command indicates which network(s) are
268 configured to work with the Lustre file system.</para>
271 <para>Shut down the file system in this order:</para>
274 <para>Unmount the clients.</para>
277 <para>Unmount the MDT.</para>
280 <para>Unmount all OSTs.</para>
285 <para>If the MGS and MDS share a partition, start the MGS only:</para>
286 <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
289 <para>Run the <literal>replace_nids</literal> command on the MGS:</para>
290 <screen>lctl replace_nids <replaceable>devicename</replaceable> <replaceable>nid1</replaceable>[,nid2,nid3 ...]</screen>
291 <para>where <replaceable>devicename</replaceable> is the Lustre target name, e.g.
292 <literal>testfs-OST0013</literal></para>
295 <para>If the MGS and MDS share a partition, stop the MGS:</para>
296 <screen>umount <replaceable>mount_point</replaceable></screen>
299 <note><para>The <literal>replace_nids</literal> command also cleans
300 all old, invalidated records out of the configuration log, while
301 preserving all other current settings.</para></note>
302 <note><para>The previous configuration log is backed up on the MGS
303 disk with the suffix <literal>'.bak'</literal>.</para></note>
305 <section xml:id="lustremaint.clear_conf" condition="l2B">
307 <primary>maintenance</primary>
308 <secondary>Clearing a config</secondary>
309 </indexterm> Clearing configuration</title>
311 This command runs on MGS node having the MGS device mounted with
312 <literal>-o nosvc.</literal> It cleans up configuration files
313 stored in the CONFIGS/ directory of any records marked SKIP.
314 If the device name is given, then the specific logs for that
315 filesystem (e.g. testfs-MDT0000) are processed. Otherwise, if a
316 filesystem name is given then all configuration files are cleared.
317 The previous configuration log is backed up on the MGS disk with
318 the suffix 'config.timestamp.bak'. Eg: Lustre-MDT0000-1476454535.bak.
320 <para> To clear a configuration:</para>
323 <para>Shut down the file system in this order:</para>
326 <para>Unmount the clients.</para>
329 <para>Unmount the MDT.</para>
332 <para>Unmount all OSTs.</para>
338 If the MGS and MDS share a partition, start the MGS only
339 using "nosvc" option.
341 <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
344 <para>Run the <literal>clear_conf</literal> command on the MGS:
346 <screen>lctl clear_conf <replaceable>config</replaceable></screen>
348 Example: To clear the configuration for
349 <literal>MDT0000</literal> on a filesystem named
350 <literal>testfs</literal>
352 <screen>mgs# lctl clear_conf testfs-MDT0000</screen>
356 <section xml:id="lustremaint.adding_new_mdt">
358 <primary>maintenance</primary>
359 <secondary>adding an MDT</secondary>
360 </indexterm>Adding a New MDT to a Lustre File System</title>
361 <para>Additional MDTs can be added using the DNE feature to serve one
362 or more remote sub-directories within a filesystem, in order to
363 increase the total number of files that can be created in the
364 filesystem, to increase aggregate metadata performance, or to isolate
365 user or application workloads from other users of the filesystem. It
366 is possible to have multiple remote sub-directories reference the
367 same MDT. However, the root directory will always be located on
368 MDT0000. To add a new MDT into the file system:</para>
371 <para>Discover the maximum MDT index. Each MDT must have unique index.</para>
373 client$ lctl dl | grep mdc
374 36 UP mdc testfs-MDT0000-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
375 37 UP mdc testfs-MDT0001-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
376 38 UP mdc testfs-MDT0002-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
377 39 UP mdc testfs-MDT0003-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
381 <para>Add the new block device as a new MDT at the next available
382 index. In this example, the next available index is 4.</para>
384 mds# mkfs.lustre --reformat --fsname=<replaceable>testfs</replaceable> --mdt --mgsnode=<replaceable>mgsnode</replaceable> --index 4 <replaceable>/dev/mdt4_device</replaceable>
388 <para>Mount the MDTs.</para>
390 mds# mount –t lustre <replaceable>/dev/mdt4_blockdevice</replaceable> /mnt/mdt4
394 <para>In order to start creating new files and directories on the
395 new MDT(s) they need to be attached into the namespace at one or
396 more subdirectories using the <literal>lfs mkdir</literal> command.
397 All files and directories below those created with
398 <literal>lfs mkdir</literal> will also be created on the same MDT
399 unless otherwise specified.
402 client# lfs mkdir -i 3 /mnt/testfs/new_dir_on_mdt3
403 client# lfs mkdir -i 4 /mnt/testfs/new_dir_on_mdt4
404 client# lfs mkdir -c 4 /mnt/testfs/new_directory_striped_across_4_mdts
409 <section xml:id="lustremaint.adding_new_ost">
410 <title><indexterm><primary>maintenance</primary><secondary>adding a OST</secondary></indexterm>
411 Adding a New OST to a Lustre File System</title>
412 <para>A new OST can be added to existing Lustre file system on either
413 an existing OSS node or on a new OSS node. In order to keep client IO
414 load balanced across OSS nodes for maximum aggregate performance, it is
415 not recommended to configure different numbers of OSTs to each OSS node.
419 <para> Add a new OST by using <literal>mkfs.lustre</literal> as when
420 the filesystem was first formatted, see
421 <xref linkend="dbdoclet.format_ost" /> for details. Each new OST
422 must have a unique index number, use <literal>lctl dl</literal> to
423 see a list of all OSTs. For example, to add a new OST at index 12
424 to the <literal>testfs</literal> filesystem run following commands
425 should be run on the OSS:</para>
426 <screen>oss# mkfs.lustre --fsname=testfs --mgsnode=mds16@tcp0 --ost --index=12 /dev/sda
427 oss# mkdir -p /mnt/testfs/ost12
428 oss# mount -t lustre /dev/sda /mnt/testfs/ost12</screen>
431 <para>Balance OST space usage (possibly).</para>
432 <para>The file system can be quite unbalanced when new empty OSTs
433 are added to a relatively full filesystem. New file creations are
434 automatically balanced to favour the new OSTs. If this is a scratch
435 file system or files are pruned at regular intervals, then no further
436 work may be needed to balance the OST space usage as new files being
437 created will preferentially be placed on the less full OST(s). As old
438 files are deleted, they will release space on the old OST(s).</para>
439 <para>Files existing prior to the expansion can optionally be
440 rebalanced using the <literal>lfs_migrate</literal> utility.
441 This redistributes file data over the entire set of OSTs.</para>
442 <para>For example, to rebalance all files within the directory
443 <literal>/mnt/lustre/dir</literal>, enter:</para>
444 <screen>client# lfs_migrate /mnt/lustre/dir</screen>
445 <para>To migrate files within the <literal>/test</literal> file
446 system on <literal>OST0004</literal> that are larger than 4GB in
447 size to other OSTs, enter:</para>
448 <screen>client# lfs find /test --ost test-OST0004 -size +4G | lfs_migrate -y</screen>
449 <para>See <xref linkend="dbdoclet.lfs_migrate"/> for details.</para>
453 <section xml:id="lustremaint.deactivating_mdt_ost">
454 <title><indexterm><primary>maintenance</primary><secondary>restoring an OST</secondary></indexterm>
455 <indexterm><primary>maintenance</primary><secondary>removing an OST</secondary></indexterm>
456 Removing and Restoring MDTs and OSTs</title>
457 <para>OSTs and DNE MDTs can be removed from and restored to a Lustre
458 filesystem. Deactivating an OST means that it is temporarily or
459 permanently marked unavailable. Deactivating an OST on the MDS means
460 it will not try to allocate new objects there or perform OST recovery,
461 while deactivating an OST the client means it will not wait for OST
462 recovery if it cannot contact the OST and will instead return an IO
463 error to the application immediately if files on the OST are accessed.
464 An OST may be permanently deactivated from the file system,
465 depending on the situation and commands used.</para>
466 <note><para>A permanently deactivated MDT or OST still appears in the
467 filesystem configuration until the configuration is regenerated with
468 <literal>writeconf</literal> or it is replaced with a new MDT or OST
469 at the same index and permanently reactivated. A deactivated OST
470 will not be listed by <literal>lfs df</literal>.
472 <para>You may want to temporarily deactivate an OST on the MDS to
473 prevent new files from being written to it in several situations:</para>
476 <para>A hard drive has failed and a RAID resync/rebuild is underway,
477 though the OST can also be marked <emphasis>degraded</emphasis> by
478 the RAID system to avoid allocating new files on the slow OST which
479 can reduce performance, see <xref linkend='dbdoclet.degraded_ost' />
484 <para>OST is nearing its space capacity, though the MDS will already
485 try to avoid allocating new files on overly-full OSTs if possible,
486 see <xref linkend='dbdoclet.balancing_free_space' /> for details.
490 <para>MDT/OST storage or MDS/OSS node has failed, and will not
491 be available for some time (or forever), but there is still a
492 desire to continue using the filesystem before it is repaired.</para>
495 <section xml:id="lustremaint.rmremotedir">
496 <title><indexterm><primary>maintenance</primary><secondary>removing an MDT</secondary></indexterm>Removing an MDT from the File System</title>
497 <para>If the MDT is permanently inaccessible,
498 <literal>lfs rm_entry {directory}</literal> can be used to delete the
499 directory entry for the unavailable MDT. Using <literal>rmdir</literal>
500 would otherwise report an IO error due to the remote MDT being inactive.
501 Please note that if the MDT <emphasis>is</emphasis> available, standard
502 <literal>rm -r</literal> should be used to delete the remote directory.
503 After the remote directory has been removed, the administrator should
504 mark the MDT as permanently inactive with:</para>
505 <screen>lctl conf_param {MDT name}.mdc.active=0</screen>
506 <para>A user can identify which MDT holds a remote sub-directory using
507 the <literal>lfs</literal> utility. For example:</para>
508 <screen>client$ lfs getstripe --mdt-index /mnt/lustre/remote_dir1
510 client$ mkdir /mnt/lustre/local_dir0
511 client$ lfs getstripe --mdt-index /mnt/lustre/local_dir0
514 <para>The <literal>lfs getstripe --mdt-index</literal> command
515 returns the index of the MDT that is serving the given directory.</para>
517 <section xml:id="lustremaint.inactivemdt">
519 <indexterm><primary>maintenance</primary></indexterm>
520 <indexterm><primary>maintenance</primary><secondary>inactive MDTs</secondary></indexterm>Working with Inactive MDTs</title>
521 <para>Files located on or below an inactive MDT are inaccessible until
522 the MDT is activated again. Clients accessing an inactive MDT will receive
525 <section remap="h3" xml:id="lustremaint.remove_ost">
527 <primary>maintenance</primary>
528 <secondary>removing an OST</secondary>
529 </indexterm>Removing an OST from the File System</title>
530 <para>When deactivating an OST, note that the client and MDS each have
531 an OSC device that handles communication with the corresponding OST.
532 To remove an OST from the file system:</para>
535 <para>If the OST is functional, and there are files located on
536 the OST that need to be migrated off of the OST, the file creation
537 for that OST should be temporarily deactivated on the MDS (each MDS
538 if running with multiple MDS nodes in DNE mode).
542 <para condition="l29">With Lustre 2.9 and later, the MDS should be
543 set to only disable file creation on that OST by setting
544 <literal>max_create_count</literal> to zero:
545 <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.max_create_count=0</screen>
546 This ensures that files deleted or migrated off of the OST
547 will have their corresponding OST objects destroyed, and the space
548 will be freed. For example, to disable <literal>OST0000</literal>
549 in the filesystem <literal>testfs</literal>, run:
550 <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.max_create_count=0</screen>
551 on each MDS in the <literal>testfs</literal> filesystem.</para>
554 <para>With older versions of Lustre, to deactivate the OSC on the
556 <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.active=0</screen>
557 This will prevent the MDS from attempting any communication with
558 that OST, including destroying objects located thereon. This is
559 fine if the OST will be removed permanently, if the OST is not
560 stable in operation, or if it is in a read-only state. Otherwise,
561 the free space and objects on the OST will not decrease when
562 files are deleted, and object destruction will be deferred until
563 the MDS reconnects to the OST.</para>
564 <para>For example, to deactivate <literal>OST0000</literal> in
565 the filesystem <literal>testfs</literal>, run:
566 <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.active=0</screen>
567 Deactivating the OST on the <emphasis>MDS</emphasis> does not
568 prevent use of existing objects for read/write by a client.</para>
570 <para>If migrating files from a working OST, do not deactivate
571 the OST on clients. This causes IO errors when accessing files
572 located there, and migrating files on the OST would fail.</para>
575 <para>Do not use <literal>lctl conf_param</literal> to
576 deactivate the OST if it is still working, as this immediately
577 and permanently deactivates it in the file system configuration
578 on both the MDS and all clients.</para>
584 <para>Discover all files that have objects residing on the
585 deactivated OST. Depending on whether the deactivated OST is
586 available or not, the data from that OST may be migrated to
587 other OSTs, or may need to be restored from backup.</para>
590 <para>If the OST is still online and available, find all
591 files with objects on the deactivated OST, and copy them
592 to other OSTs in the file system to: </para>
593 <screen>client# lfs find --ost <replaceable>ost_name</replaceable> <replaceable>/mount/point</replaceable> | lfs_migrate -y</screen>
594 <para>Note that if multiple OSTs are being deactivated at one
595 time, the <literal>lfs find</literal> command can take multiple
596 <literal>--ost</literal> arguments, and will return files that
597 are located on <emphasis>any</emphasis> of the specified OSTs.
601 <para>If the OST is no longer available, delete the files
602 on that OST and restore them from backup:
603 <screen>client# lfs find --ost <replaceable>ost_uuid</replaceable> -print0 <replaceable>/mount/point</replaceable> |
604 tee /tmp/files_to_restore | xargs -0 -n 1 unlink</screen>
605 The list of files that need to be restored from backup is
606 stored in <literal>/tmp/files_to_restore</literal>. Restoring
607 these files is beyond the scope of this document.</para>
612 <para>Deactivate the OST.</para>
616 If there is expected to be a replacement OST in some short
617 time (a few days), the OST can temporarily be deactivated on
619 <screen>client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=0</screen>
620 <note><para>This setting is only temporary and will be reset
621 if the clients are remounted or rebooted. It needs to be run
622 on all clients.</para>
627 <para>If there is not expected to be a replacement for this OST in
628 the near future, permanently deactivate it on all clients and
629 the MDS by running the following command on the MGS:
630 <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=0</screen></para>
631 <note><para>A deactivated OST still appears in the file system
632 configuration, though a replacement OST can be created that
633 re-uses the same OST index with the
634 <literal>mkfs.lustre --replace</literal> option, see
635 <xref linkend="lustremaint.restore_ost"/>.
637 <para>To totally remove the OST from the filesystem configuration,
638 the OST configuration records should be found in the startup
639 logs by running the command
640 "<literal>lctl --device MGS llog_print <replaceable>fsname</replaceable>-client</literal>"
642 "<literal>... <replaceable>$fsname</replaceable>-MDT<replaceable>xxxx</replaceable></literal>"
643 for all the MDTs) to list all <literal>attach</literal>,
644 <literal>setup</literal>, <literal>add_osc</literal>,
645 <literal>add_pool</literal>, and other records related to the
646 removed OST(s). Once the <literal>index</literal> value is
647 known for each configuration record, the command
648 "<literal>lctl --device MGS llog_cancel <replaceable>llog_name</replaceable> -i <replaceable>index</replaceable> </literal>"
649 will drop that record from the configuration log
650 <replaceable>llog_name</replaceable> for each of the
651 <literal><replaceable>fsname</replaceable>-client</literal> and
652 <literal><replaceable>fsname</replaceable>-MDTxxxx</literal>
653 configuration logs so that new mounts will no longer process it.
654 If a whole OSS is being removed, the<literal>add_uuid</literal>
655 records for the OSS should similarly be canceled.
657 mgs# lctl --device MGS llog_print testfs-client | egrep "192.168.10.99@tcp|OST0003"
658 - { index: 135, event: add_uuid, nid: 192.168.10.99@tcp(0x20000c0a80a63), node: 192.168.10.99@tcp }
659 - { index: 136, event: attach, device: testfs-OST0003-osc, type: osc, UUID: testfs-clilov_UUID }
660 - { index: 137, event: setup, device: testfs-OST0003-osc, UUID: testfs-OST0003_UUID, node: 192.168.10.99@tcp }
661 - { index: 138, event: add_osc, device: testfs-clilov, ost: testfs-OST0003_UUID, index: 3, gen: 1 }
662 mgs# lctl --device MGS llog_cancel testfs-client -i 138
663 mgs# lctl --device MGS llog_cancel testfs-client -i 137
664 mgs# lctl --device MGS llog_cancel testfs-client -i 136
672 <section remap="h3" xml:id="lustremaint.ydg_pgt_tl">
674 <primary>maintenance</primary>
675 <secondary>backing up OST config</secondary>
678 <primary>backup</primary>
679 <secondary>OST config</secondary>
680 </indexterm> Backing Up OST Configuration Files</title>
681 <para>If the OST device is still accessible, then the Lustre
682 configuration files on the OST should be backed up and saved for
683 future use in order to avoid difficulties when a replacement OST is
684 returned to service. These files rarely change, so they can and
685 should be backed up while the OST is functional and accessible. If
686 the deactivated OST is still available to mount (i.e. has not
687 permanently failed or is unmountable due to severe corruption), an
688 effort should be made to preserve these files. </para>
691 <para>Mount the OST file system.
692 <screen>oss# mkdir -p /mnt/ost
693 oss# mount -t ldiskfs <replaceable>/dev/ost_device</replaceable> /mnt/ost</screen>
697 <para>Back up the OST configuration files.
698 <screen>oss# tar cvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost last_rcvd \
699 CONFIGS/ O/0/LAST_ID</screen>
703 <para> Unmount the OST file system. <screen>oss# umount /mnt/ost</screen>
708 <section xml:id="lustremaint.restore_ost">
710 <primary>maintenance</primary>
711 <secondary>restoring OST config</secondary>
714 <primary>backup</primary>
715 <secondary>restoring OST config</secondary>
716 </indexterm> Restoring OST Configuration Files</title>
717 <para>If the original OST is still available, it is best to follow the
718 OST backup and restore procedure given in either
719 <xref linkend="dbdoclet.backup_device"/>, or
720 <xref linkend="backup_fs_level"/> and
721 <xref linkend="backup_fs_level.restore"/>.</para>
722 <para>To replace an OST that was removed from service due to corruption
723 or hardware failure, the replacement OST needs to be formatted using
724 <literal>mkfs.lustre</literal>, and the Lustre file system configuration
725 should be restored, if available. Any objects stored on the OST will
726 be permanently lost, and files using the OST should be deleted and/or
727 restored from backup.</para>
728 <para condition="l25">With Lustre 2.5 and later, it is possible to
729 replace an OST to the same index without restoring the configuration
730 files, using the <literal>--replace</literal> option at format time.
731 <screen>oss# mkfs.lustre --ost --reformat --replace --index=<replaceable>old_ost_index</replaceable> \
732 <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
733 The MDS and OSS will negotiate the <literal>LAST_ID</literal> value
734 for the replacement OST.
736 <para>If the OST configuration files were not backed up, due to the
737 OST file system being completely inaccessible, it is still possible to
738 replace the failed OST with a new one at the same OST index. </para>
741 <para>For older versions, format the OST file system without the
742 <literal>--replace</literal> option and restore the saved
744 <screen>oss# mkfs.lustre --ost --reformat --index=<replaceable>old_ost_index</replaceable> \
745 <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
749 <para> Mount the OST file system.
750 <screen>oss# mkdir /mnt/ost
751 oss# mount -t ldiskfs <replaceable>/dev/new_ost_dev</replaceable> <replaceable>/mnt/ost</replaceable></screen>
755 <para>Restore the OST configuration files, if available.
756 <screen>oss# tar xvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost</screen></para>
759 <para>Recreate the OST configuration files, if unavailable. </para>
760 <para>Follow the procedure in
761 <xref linkend="dbdoclet.repair_ost_lastid"/> to recreate the LAST_ID
762 file for this OST index. The <literal>last_rcvd</literal> file
763 will be recreated when the OST is first mounted using the default
764 parameters, which are normally correct for all file systems. The
765 <literal>CONFIGS/mountdata</literal> file is created by
766 <literal>mkfs.lustre</literal> at format time, but has flags set
767 that request it to register itself with the MGS. It is possible to
768 copy the flags from another working OST (which should be the same):
769 <screen>oss1# debugfs -c -R "dump CONFIGS/mountdata /tmp" <replaceable>/dev/other_osdev</replaceable>
770 oss1# scp /tmp/mountdata oss0:/tmp/mountdata
771 oss0# dd if=/tmp/mountdata of=/mnt/ost/CONFIGS/mountdata bs=4 count=1 seek=5 skip=5 conv=notrunc</screen></para>
774 <para> Unmount the OST file system.
775 <screen>oss# umount /mnt/ost</screen>
780 <section xml:id="lustremaint.ucf_qgt_tl">
782 <primary>maintenance</primary>
783 <secondary>reintroducing an OSTs</secondary>
784 </indexterm>Returning a Deactivated OST to Service</title>
785 <para>If the OST was permanently deactivated, it needs to be
786 reactivated in the MGS configuration.
787 <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=1</screen>
788 If the OST was temporarily deactivated, it needs to be reactivated on
790 <screen>mds# lctl set_param osp.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1
791 client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1</screen></para>
794 <section xml:id="lustremaint.abortRecovery">
795 <title><indexterm><primary>maintenance</primary><secondary>aborting recovery</secondary></indexterm>
796 <indexterm><primary>backup</primary><secondary>aborting recovery</secondary></indexterm>
797 Aborting Recovery</title>
798 <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>
800 <para>The recovery process is blocked until all OSTs are available. </para>
803 <section xml:id="lustremaint.determineOST">
804 <title><indexterm><primary>maintenance</primary><secondary>identifying OST host</secondary></indexterm>
805 Determining Which Machine is Serving an OST </title>
806 <para>In the course of administering a Lustre file system, you may need to determine which
807 machine is serving a specific OST. It is not as simple as identifying the machine’s IP
808 address, as IP is only one of several networking protocols that the Lustre software uses and,
809 as such, LNet does not use IP addresses as node identifiers, but NIDs instead. To identify the
810 NID that is serving a specific OST, run one of the following commands on a client (you do not
811 need to be a root user):
812 <screen>client$ lctl get_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>*.ost_conn_uuid</screen>
814 <screen>client$ lctl get_param osc.*-OST0000*.ost_conn_uuid
815 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen>-
817 <screen>client$ lctl get_param osc.*.ost_conn_uuid
818 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
819 osc.testfs-OST0001-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
820 osc.testfs-OST0002-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
821 osc.testfs-OST0003-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
822 osc.testfs-OST0004-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen></para>
824 <section xml:id="lustremaint.ChangeAddrFailoverNode">
825 <title><indexterm><primary>maintenance</primary><secondary>changing failover node address</secondary></indexterm>
826 Changing the Address of a Failover Node</title>
827 <para>To change the address of a failover node (e.g, to use node X instead of node Y), run
828 this command on the OSS/OST partition (depending on which option was used to originally
830 <screen>oss# tunefs.lustre --erase-params --servicenode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
832 <screen>oss# tunefs.lustre --erase-params --failnode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
833 For more information about the <literal>--servicenode</literal> and
834 <literal>--failnode</literal> options, see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
835 linkend="configuringfailover"/>.</para>
837 <section xml:id="lustremaint.seperateCombinedMGSMDT">
838 <title><indexterm><primary>maintenance</primary><secondary>separate a
839 combined MGS/MDT</secondary></indexterm>
840 Separate a combined MGS/MDT</title>
841 <para>These instructions assume the MGS node will be the same as the MDS
842 node. For instructions on how to move MGS to a different node, see
843 <xref linkend="lustremaint.changingservernid"/>.</para>
844 <para>These instructions are for doing the split without shutting down
845 other servers and clients.</para>
848 <para>Stop the MDS.</para>
849 <para>Unmount the MDT</para>
850 <screen>umount -f <replaceable>/dev/mdt_device</replaceable> </screen>
853 <para>Create the MGS.</para>
854 <screen>mds# mkfs.lustre --mgs --device-size=<replaceable>size</replaceable> <replaceable>/dev/mgs_device</replaceable></screen>
857 <para>Copy the configuration data from MDT disk to the new MGS disk.</para>
858 <screen>mds# mount -t ldiskfs -o ro <replaceable>/dev/mdt_device</replaceable> <replaceable>/mdt_mount_point</replaceable></screen>
859 <screen>mds# mount -t ldiskfs -o rw <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable> </screen>
860 <screen>mds# cp -r <replaceable>/mdt_mount_point</replaceable>/CONFIGS/<replaceable>filesystem_name</replaceable>-* <replaceable>/mgs_mount_point</replaceable>/CONFIGS/. </screen>
861 <screen>mds# umount <replaceable>/mgs_mount_point</replaceable></screen>
862 <screen>mds# umount <replaceable>/mdt_mount_point</replaceable></screen>
863 <para>See <xref linkend="lustremaint.regenerateConfigLogs"/> for alternative method.</para>
866 <para>Start the MGS.</para>
867 <screen>mgs# mount -t lustre <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable></screen>
868 <para>Check to make sure it knows about all your file system</para>
869 <screen>mgs:/root# lctl get_param mgs.MGS.filesystems</screen>
872 <para>Remove the MGS option from the MDT, and set the new MGS nid.</para>
873 <screen>mds# tunefs.lustre --nomgs --mgsnode=<replaceable>new_mgs_nid</replaceable> <replaceable>/dev/mdt-device</replaceable></screen>
876 <para>Start the MDT.</para>
877 <screen>mds# mount -t lustre <replaceable>/dev/mdt_device /mdt_mount_point</replaceable></screen>
878 <para>Check to make sure the MGS configuration looks right:</para>
879 <screen>mgs# lctl get_param mgs.MGS.live.<replaceable>filesystem_name</replaceable></screen>
883 <section xml:id="lustremaint.setMDTReadonly" condition="l2D">
884 <title><indexterm><primary>maintenance</primary>
885 <secondary>set an MDT to readonly</secondary></indexterm>
886 Set an MDT to read-only</title>
887 <para>It is sometimes desirable to be able to mark the filesystem
888 read-only directly on the server, rather than remounting the clients and
889 setting the option there. This can be useful if there is a rogue client
890 that is deleting files, or when decommissioning a system to prevent
891 already-mounted clients from modifying it anymore.</para>
892 <para>Set the <literal>mdt.*.readonly</literal> parameter to
893 <literal>1</literal> to immediately set the MDT to read-only. All future
894 MDT access will immediately return a "Read-only file system" error
895 (<literal>EROFS</literal>) until the parameter is set to
896 <literal>0</literal> again.</para>
897 <para>Example of setting the <literal>readonly</literal> parameter to
898 <literal>1</literal>, verifying the current setting, accessing from a
899 client, and setting the parameter back to <literal>0</literal>:</para>
900 <screen>mds# lctl set_param mdt.fs-MDT0000.readonly=1
901 mdt.fs-MDT0000.readonly=1
903 mds# lctl get_param mdt.fs-MDT0000.readonly
904 mdt.fs-MDT0000.readonly=1
906 client$ touch test_file
907 touch: cannot touch ‘test_file’: Read-only file system
909 mds# lctl set_param mdt.fs-MDT0000.readonly=0
910 mdt.fs-MDT0000.readonly=0</screen>
912 <section xml:id="lustremaint.tunefallocate" condition="l2E">
913 <title><indexterm><primary>maintenance</primary>
914 <secondary>Tune fallocate</secondary></indexterm>
915 Tune Fallocate for ldiskfs</title>
916 <para>This section shows how to tune/enable/disable fallocate for
918 <para>The default <literal>mode=0</literal> is the standard
919 "allocate unwritten extents" behavior used by ext4. This is by far the
920 fastest for space allocation, but requires the unwritten extents to be
921 split and/or zeroed when they are overwritten.</para>
922 <para> The OST fallocate <literal>mode=1</literal> can also be set to use
923 "zeroed extents", which may be handled by "WRITE SAME", "TRIM zeroes data",
924 or other low-level functionality in the underlying block device.</para>
925 <para><literal>mode=-1</literal> completely disables fallocate.</para>
926 <para>Example: To completely disable fallocate</para>
927 <screen>lctl set_param osd-ldiskfs.*.fallocate_zero_blocks=-1</screen>
928 <para>Example: To enable fallocate to use 'zeroed extents'</para>
929 <screen>lctl set_param osd-ldiskfs.*.fallocate_zero_blocks=1</screen>
933 vim:expandtab:shiftwidth=2:tabstop=8: