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 <section xml:id="lustremaint.inactiveOST">
71 <indexterm><primary>maintenance</primary></indexterm>
72 <indexterm><primary>maintenance</primary><secondary>inactive OSTs</secondary></indexterm>
73 Working with Inactive OSTs</title>
74 <para>To mount a client or an MDT with one or more inactive OSTs, run commands similar to this:</para>
75 <screen>client# mount -o exclude=testfs-OST0000 -t lustre \
76 uml1:/testfs /mnt/testfs
77 client# lctl get_param lov.testfs-clilov-*.target_obd</screen>
78 <para>To activate an inactive OST on a live client or MDT, use the
79 <literal>lctl activate</literal> command on the OSC device. For example:</para>
80 <screen>lctl --device 7 activate</screen>
82 <para>A colon-separated list can also be specified. For example,
83 <literal>exclude=testfs-OST0000:testfs-OST0001</literal>.</para>
86 <section xml:id="lustremaint.findingNodes">
87 <title><indexterm><primary>maintenance</primary><secondary>finding nodes</secondary></indexterm>
88 Finding Nodes in the Lustre File System</title>
89 <para>There may be situations in which you need to find all nodes in
90 your Lustre file system or get the names of all OSTs.</para>
91 <para>To get a list of all Lustre nodes, run this command on the MGS:</para>
92 <screen># lctl get_param mgs.MGS.live.*</screen>
94 <para>This command must be run on the MGS.</para>
96 <para>In this example, file system <literal>testfs</literal> has three
97 nodes, <literal>testfs-MDT0000</literal>,
98 <literal>testfs-OST0000</literal>, and
99 <literal>testfs-OST0001</literal>.</para>
100 <screen>mgs:/root# lctl get_param mgs.MGS.live.*
105 testfs-OST0001 </screen>
106 <para>To get the names of all OSTs, run this command on the MDS:</para>
107 <screen>mds:/root# lctl get_param lov.*-mdtlov.target_obd </screen>
109 <para>This command must be run on the MDS.</para>
111 <para>In this example, there are two OSTs, testfs-OST0000 and
112 testfs-OST0001, which are both active.</para>
113 <screen>mgs:/root# lctl get_param lov.testfs-mdtlov.target_obd
114 0: testfs-OST0000_UUID ACTIVE
115 1: testfs-OST0001_UUID ACTIVE </screen>
117 <section xml:id="lustremaint.mountingServerWithoutLustre">
118 <title><indexterm><primary>maintenance</primary><secondary>mounting a server</secondary></indexterm>
119 Mounting a Server Without Lustre Service</title>
120 <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>
121 <screen>mount -t lustre <replaceable>/dev/mdt_partition</replaceable> -o nosvc <replaceable>/mount_point</replaceable></screen>
122 <para>The <literal><replaceable>mdt_partition</replaceable></literal> variable is the combined MGS/MDT block device.</para>
123 <para>In this example, the combined MGS/MDT is <literal>testfs-MDT0000</literal> and the mount point is <literal>/mnt/test/mdt</literal>.</para>
124 <screen>$ mount -t lustre -L testfs-MDT0000 -o nosvc /mnt/test/mdt</screen>
126 <section xml:id="lustremaint.regenerateConfigLogs">
127 <title><indexterm><primary>maintenance</primary><secondary>regenerating config logs</secondary></indexterm>
128 Regenerating Lustre Configuration Logs</title>
129 <para>If the Lustre file system configuration logs are in a state where
130 the file system cannot be started, use the
131 <literal>tunefs.lustre --writeconf</literal> command to regenerate them.
132 After the <literal>writeconf</literal> command is run and the servers
133 restart, the configuration logs are re-generated and stored on the MGS
134 (as with a new file system).</para>
135 <para>You should only use the <literal>writeconf</literal> command if:</para>
138 <para>The configuration logs are in a state where the file system cannot start</para>
141 <para>A server NID is being changed</para>
144 <para>The <literal>writeconf</literal> command is destructive to some
145 configuration items (e.g. OST pools information and tunables set via
146 <literal>conf_param</literal>), and should be used with caution.</para>
148 <para>The OST pools feature enables a group of OSTs to be named for
149 file striping purposes. If you use OST pools, be aware that running
150 the <literal>writeconf</literal> command erases
151 <emphasis role="bold">all</emphasis> pools information (as well as
152 any other parameters set via <literal>lctl conf_param</literal>).
153 We recommend that the pools definitions (and
154 <literal>conf_param</literal> settings) be executed via a script,
155 so they can be regenerated easily after <literal>writeconf</literal>
156 is performed. However, tunables saved with <literal>lctl set_param
157 -P</literal> are <emphasis>not</emphasis> erased in this case.</para>
160 <para>If the MGS still holds any configuration logs, it may be
161 possible to dump these logs to save any parameters stored with
162 <literal>lctl conf_param</literal> by dumping the config logs on
163 the MGS and saving the output:</para>
165 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-client
166 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-MDT0000
167 mgs# lctl --device MGS llog_print <replaceable>fsname</replaceable>-OST0000
170 <para>To regenerate Lustre file system configuration logs:</para>
173 <para>Stop the file system services in the following order before
174 running the <literal>tunefs.lustre --writeconf</literal> command:
178 <para>Unmount the clients.</para>
181 <para>Unmount the MDT(s).</para>
184 <para>Unmount the OST(s).</para>
187 <para>If the MGS is separate from the MDT it can remain mounted
188 during this process.</para>
193 <para>Make sure the MDT and OST devices are available.</para>
196 <para>Run the <literal>tunefs.lustre --writeconf</literal> command
197 on all target devices.</para>
198 <para>Run writeconf on the MDT(s) first, and then the OST(s).</para>
201 <para>On each MDS, for each MDT run:</para>
202 <screen>mds# tunefs.lustre --writeconf <replaceable>/dev/mdt_device</replaceable></screen>
205 <para> On each OSS, for each OST run:
206 <screen>oss# tunefs.lustre --writeconf <replaceable>/dev/ost_device</replaceable></screen>
212 <para>Restart the file system in the following order:</para>
215 <para>Mount the separate MGT, if it is not already mounted.</para>
218 <para>Mount the MDT(s) in order, starting with MDT0000.</para>
221 <para>Mount the OSTs in order, starting with OST0000.</para>
224 <para>Mount the clients.</para>
229 <para>After the <literal>tunefs.lustre --writeconf</literal> command is
230 run, the configuration logs are re-generated as servers connect to the
233 <section xml:id="lustremaint.changingservernid">
234 <title><indexterm><primary>maintenance</primary><secondary>changing a NID</secondary></indexterm>
235 Changing a Server NID</title>
236 <para>In order to totally rewrite the Lustre configuration, the
237 <literal>tunefs.lustre --writeconf</literal> command is used to
238 rewrite all of the configuration files.</para>
239 <para>If you need to change only the NID of the MDT or OST, the
240 <literal>replace_nids</literal> command can simplify this process.
241 The <literal>replace_nids</literal> command differs from
242 <literal>tunefs.lustre --writeconf</literal> in that it does not
243 erase the entire configuration log, precluding the need the need to
244 execute the <literal>writeconf</literal> command on all servers and
245 re-specify all permanent parameter settings. However, the
246 <literal>writeconf</literal> command can still be used if desired.
248 <para>Change a server NID in these situations:</para>
251 <para>New server hardware is added to the file system, and the MDS or an OSS is being moved to the new machine.</para>
254 <para>New network card is installed in the server.</para>
257 <para>You want to reassign IP addresses.</para>
260 <para>To change a server NID:</para>
263 <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>
264 <para>The <literal>lctl list_nids</literal> command indicates which network(s) are
265 configured to work with the Lustre file system.</para>
268 <para>Shut down the file system in this order:</para>
271 <para>Unmount the clients.</para>
274 <para>Unmount the MDT.</para>
277 <para>Unmount all OSTs.</para>
282 <para>If the MGS and MDS share a partition, start the MGS only:</para>
283 <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
286 <para>Run the <literal>replace_nids</literal> command on the MGS:</para>
287 <screen>lctl replace_nids <replaceable>devicename</replaceable> <replaceable>nid1</replaceable>[,nid2,nid3 ...]</screen>
288 <para>where <replaceable>devicename</replaceable> is the Lustre target name, e.g.
289 <literal>testfs-OST0013</literal></para>
292 <para>If the MGS and MDS share a partition, stop the MGS:</para>
293 <screen>umount <replaceable>mount_point</replaceable></screen>
296 <note><para>The <literal>replace_nids</literal> command also cleans
297 all old, invalidated records out of the configuration log, while
298 preserving all other current settings.</para></note>
299 <note><para>The previous configuration log is backed up on the MGS
300 disk with the suffix <literal>'.bak'</literal>.</para></note>
302 <section xml:id="lustremaint.clear_conf" condition="l2B">
304 <primary>maintenance</primary>
305 <secondary>Clearing a config</secondary>
306 </indexterm> Clearing configuration</title>
308 This command runs on MGS node having the MGS device mounted with
309 <literal>-o nosvc.</literal> It cleans up configuration files
310 stored in the CONFIGS/ directory of any records marked SKIP.
311 If the device name is given, then the specific logs for that
312 filesystem (e.g. testfs-MDT0000) are processed. Otherwise, if a
313 filesystem name is given then all configuration files are cleared.
314 The previous configuration log is backed up on the MGS disk with
315 the suffix 'config.timestamp.bak'. Eg: Lustre-MDT0000-1476454535.bak.
317 <para> To clear a configuration:</para>
320 <para>Shut down the file system in this order:</para>
323 <para>Unmount the clients.</para>
326 <para>Unmount the MDT.</para>
329 <para>Unmount all OSTs.</para>
335 If the MGS and MDS share a partition, start the MGS only
336 using "nosvc" option.
338 <screen>mount -t lustre <replaceable>MDT partition</replaceable> -o nosvc <replaceable>mount_point</replaceable></screen>
341 <para>Run the <literal>clear_conf</literal> command on the MGS:
343 <screen>lctl clear_conf <replaceable>config</replaceable></screen>
345 Example: To clear the configuration for
346 <literal>MDT0000</literal> on a filesystem named
347 <literal>testfs</literal>
349 <screen>mgs# lctl clear_conf testfs-MDT0000</screen>
353 <section xml:id="lustremaint.adding_new_mdt">
355 <primary>maintenance</primary>
356 <secondary>adding an MDT</secondary>
357 </indexterm>Adding a New MDT to a Lustre File System</title>
358 <para>Additional MDTs can be added using the DNE feature to serve one
359 or more remote sub-directories within a filesystem, in order to
360 increase the total number of files that can be created in the
361 filesystem, to increase aggregate metadata performance, or to isolate
362 user or application workloads from other users of the filesystem. It
363 is possible to have multiple remote sub-directories reference the
364 same MDT. However, the root directory will always be located on
365 MDT0000. To add a new MDT into the file system:</para>
368 <para>Discover the maximum MDT index. Each MDT must have unique index.</para>
370 client$ lctl dl | grep mdc
371 36 UP mdc testfs-MDT0000-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
372 37 UP mdc testfs-MDT0001-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
373 38 UP mdc testfs-MDT0002-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
374 39 UP mdc testfs-MDT0003-mdc-ffff88004edf3c00 4c8be054-144f-9359-b063-8477566eb84e 5
378 <para>Add the new block device as a new MDT at the next available
379 index. In this example, the next available index is 4.</para>
381 mds# mkfs.lustre --reformat --fsname=<replaceable>testfs</replaceable> --mdt --mgsnode=<replaceable>mgsnode</replaceable> --index 4 <replaceable>/dev/mdt4_device</replaceable>
385 <para>Mount the MDTs.</para>
387 mds# mount –t lustre <replaceable>/dev/mdt4_blockdevice</replaceable> /mnt/mdt4
391 <para>In order to start creating new files and directories on the
392 new MDT(s) they need to be attached into the namespace at one or
393 more subdirectories using the <literal>lfs mkdir</literal> command.
394 All files and directories below those created with
395 <literal>lfs mkdir</literal> will also be created on the same MDT
396 unless otherwise specified.
399 client# lfs mkdir -i 3 /mnt/testfs/new_dir_on_mdt3
400 client# lfs mkdir -i 4 /mnt/testfs/new_dir_on_mdt4
401 client# lfs mkdir -c 4 /mnt/testfs/new_directory_striped_across_4_mdts
406 <section xml:id="lustremaint.adding_new_ost">
407 <title><indexterm><primary>maintenance</primary><secondary>adding a OST</secondary></indexterm>
408 Adding a New OST to a Lustre File System</title>
409 <para>A new OST can be added to existing Lustre file system on either
410 an existing OSS node or on a new OSS node. In order to keep client IO
411 load balanced across OSS nodes for maximum aggregate performance, it is
412 not recommended to configure different numbers of OSTs to each OSS node.
416 <para> Add a new OST by using <literal>mkfs.lustre</literal> as when
417 the filesystem was first formatted, see
418 <xref linkend="dbdoclet.format_ost" /> for details. Each new OST
419 must have a unique index number, use <literal>lctl dl</literal> to
420 see a list of all OSTs. For example, to add a new OST at index 12
421 to the <literal>testfs</literal> filesystem run following commands
422 should be run on the OSS:</para>
423 <screen>oss# mkfs.lustre --fsname=testfs --mgsnode=mds16@tcp0 --ost --index=12 /dev/sda
424 oss# mkdir -p /mnt/testfs/ost12
425 oss# mount -t lustre /dev/sda /mnt/testfs/ost12</screen>
428 <para>Balance OST space usage (possibly).</para>
429 <para>The file system can be quite unbalanced when new empty OSTs
430 are added to a relatively full filesystem. New file creations are
431 automatically balanced to favour the new OSTs. If this is a scratch
432 file system or files are pruned at regular intervals, then no further
433 work may be needed to balance the OST space usage as new files being
434 created will preferentially be placed on the less full OST(s). As old
435 files are deleted, they will release space on the old OST(s).</para>
436 <para>Files existing prior to the expansion can optionally be
437 rebalanced using the <literal>lfs_migrate</literal> utility.
438 This redistributes file data over the entire set of OSTs.</para>
439 <para>For example, to rebalance all files within the directory
440 <literal>/mnt/lustre/dir</literal>, enter:</para>
441 <screen>client# lfs_migrate /mnt/lustre/dir</screen>
442 <para>To migrate files within the <literal>/test</literal> file
443 system on <literal>OST0004</literal> that are larger than 4GB in
444 size to other OSTs, enter:</para>
445 <screen>client# lfs find /test --ost test-OST0004 -size +4G | lfs_migrate -y</screen>
446 <para>See <xref linkend="dbdoclet.lfs_migrate"/> for details.</para>
450 <section xml:id="lustremaint.deactivating_mdt_ost">
451 <title><indexterm><primary>maintenance</primary><secondary>restoring an OST</secondary></indexterm>
452 <indexterm><primary>maintenance</primary><secondary>removing an OST</secondary></indexterm>
453 Removing and Restoring MDTs and OSTs</title>
454 <para>OSTs and DNE MDTs can be removed from and restored to a Lustre
455 filesystem. Deactivating an OST means that it is temporarily or
456 permanently marked unavailable. Deactivating an OST on the MDS means
457 it will not try to allocate new objects there or perform OST recovery,
458 while deactivating an OST the client means it will not wait for OST
459 recovery if it cannot contact the OST and will instead return an IO
460 error to the application immediately if files on the OST are accessed.
461 An OST may be permanently deactivated from the file system,
462 depending on the situation and commands used.</para>
463 <note><para>A permanently deactivated MDT or OST still appears in the
464 filesystem configuration until the configuration is regenerated with
465 <literal>writeconf</literal> or it is replaced with a new MDT or OST
466 at the same index and permanently reactivated. A deactivated OST
467 will not be listed by <literal>lfs df</literal>.
469 <para>You may want to temporarily deactivate an OST on the MDS to
470 prevent new files from being written to it in several situations:</para>
473 <para>A hard drive has failed and a RAID resync/rebuild is underway,
474 though the OST can also be marked <emphasis>degraded</emphasis> by
475 the RAID system to avoid allocating new files on the slow OST which
476 can reduce performance, see <xref linkend='dbdoclet.degraded_ost' />
481 <para>OST is nearing its space capacity, though the MDS will already
482 try to avoid allocating new files on overly-full OSTs if possible,
483 see <xref linkend='dbdoclet.balancing_free_space' /> for details.
487 <para>MDT/OST storage or MDS/OSS node has failed, and will not
488 be available for some time (or forever), but there is still a
489 desire to continue using the filesystem before it is repaired.</para>
492 <section xml:id="lustremaint.rmremotedir">
493 <title><indexterm><primary>maintenance</primary><secondary>removing an MDT</secondary></indexterm>Removing an MDT from the File System</title>
494 <para>If the MDT is permanently inaccessible,
495 <literal>lfs rm_entry {directory}</literal> can be used to delete the
496 directory entry for the unavailable MDT. Using <literal>rmdir</literal>
497 would otherwise report an IO error due to the remote MDT being inactive.
498 Please note that if the MDT <emphasis>is</emphasis> available, standard
499 <literal>rm -r</literal> should be used to delete the remote directory.
500 After the remote directory has been removed, the administrator should
501 mark the MDT as permanently inactive with:</para>
502 <screen>lctl conf_param {MDT name}.mdc.active=0</screen>
503 <para>A user can identify which MDT holds a remote sub-directory using
504 the <literal>lfs</literal> utility. For example:</para>
505 <screen>client$ lfs getstripe --mdt-index /mnt/lustre/remote_dir1
507 client$ mkdir /mnt/lustre/local_dir0
508 client$ lfs getstripe --mdt-index /mnt/lustre/local_dir0
511 <para>The <literal>lfs getstripe --mdt-index</literal> command
512 returns the index of the MDT that is serving the given directory.</para>
514 <section xml:id="lustremaint.inactivemdt">
516 <indexterm><primary>maintenance</primary></indexterm>
517 <indexterm><primary>maintenance</primary><secondary>inactive MDTs</secondary></indexterm>Working with Inactive MDTs</title>
518 <para>Files located on or below an inactive MDT are inaccessible until
519 the MDT is activated again. Clients accessing an inactive MDT will receive
522 <section remap="h3" xml:id="lustremaint.remove_ost">
524 <primary>maintenance</primary>
525 <secondary>removing an OST</secondary>
526 </indexterm>Removing an OST from the File System</title>
527 <para>When deactivating an OST, note that the client and MDS each have
528 an OSC device that handles communication with the corresponding OST.
529 To remove an OST from the file system:</para>
532 <para>If the OST is functional, and there are files located on
533 the OST that need to be migrated off of the OST, the file creation
534 for that OST should be temporarily deactivated on the MDS (each MDS
535 if running with multiple MDS nodes in DNE mode).
539 <para condition="l29">With Lustre 2.9 and later, the MDS should be
540 set to only disable file creation on that OST by setting
541 <literal>max_create_count</literal> to zero:
542 <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.max_create_count=0</screen>
543 This ensures that files deleted or migrated off of the OST
544 will have their corresponding OST objects destroyed, and the space
545 will be freed. For example, to disable <literal>OST0000</literal>
546 in the filesystem <literal>testfs</literal>, run:
547 <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.max_create_count=0</screen>
548 on each MDS in the <literal>testfs</literal> filesystem.</para>
551 <para>With older versions of Lustre, to deactivate the OSC on the
553 <screen>mds# lctl set_param osp.<replaceable>osc_name</replaceable>.active=0</screen>
554 This will prevent the MDS from attempting any communication with
555 that OST, including destroying objects located thereon. This is
556 fine if the OST will be removed permanently, if the OST is not
557 stable in operation, or if it is in a read-only state. Otherwise,
558 the free space and objects on the OST will not decrease when
559 files are deleted, and object destruction will be deferred until
560 the MDS reconnects to the OST.</para>
561 <para>For example, to deactivate <literal>OST0000</literal> in
562 the filesystem <literal>testfs</literal>, run:
563 <screen>mds# lctl set_param osp.testfs-OST0000-osc-MDT*.active=0</screen>
564 Deactivating the OST on the <emphasis>MDS</emphasis> does not
565 prevent use of existing objects for read/write by a client.</para>
567 <para>If migrating files from a working OST, do not deactivate
568 the OST on clients. This causes IO errors when accessing files
569 located there, and migrating files on the OST would fail.</para>
572 <para>Do not use <literal>lctl conf_param</literal> to
573 deactivate the OST if it is still working, as this immediately
574 and permanently deactivates it in the file system configuration
575 on both the MDS and all clients.</para>
581 <para>Discover all files that have objects residing on the
582 deactivated OST. Depending on whether the deactivated OST is
583 available or not, the data from that OST may be migrated to
584 other OSTs, or may need to be restored from backup.</para>
587 <para>If the OST is still online and available, find all
588 files with objects on the deactivated OST, and copy them
589 to other OSTs in the file system to: </para>
590 <screen>client# lfs find --ost <replaceable>ost_name</replaceable> <replaceable>/mount/point</replaceable> | lfs_migrate -y</screen>
591 <para>Note that if multiple OSTs are being deactivated at one
592 time, the <literal>lfs find</literal> command can take multiple
593 <literal>--ost</literal> arguments, and will return files that
594 are located on <emphasis>any</emphasis> of the specified OSTs.
598 <para>If the OST is no longer available, delete the files
599 on that OST and restore them from backup:
600 <screen>client# lfs find --ost <replaceable>ost_uuid</replaceable> -print0 <replaceable>/mount/point</replaceable> |
601 tee /tmp/files_to_restore | xargs -0 -n 1 unlink</screen>
602 The list of files that need to be restored from backup is
603 stored in <literal>/tmp/files_to_restore</literal>. Restoring
604 these files is beyond the scope of this document.</para>
609 <para>Deactivate the OST.</para>
613 If there is expected to be a replacement OST in some short
614 time (a few days), the OST can temporarily be deactivated on
616 <screen>client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=0</screen>
617 <note><para>This setting is only temporary and will be reset
618 if the clients are remounted or rebooted. It needs to be run
619 on all clients.</para>
624 <para>If there is not expected to be a replacement for this OST in
625 the near future, permanently deactivate it on all clients and
626 the MDS by running the following command on the MGS:
627 <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=0</screen></para>
628 <note><para>A deactivated OST still appears in the file system
629 configuration, though a replacement OST can be created using the
630 <literal>mkfs.lustre --replace</literal> option, see
631 <xref linkend="lustremaint.restore_ost"/>.
638 <section remap="h3" xml:id="lustremaint.ydg_pgt_tl">
640 <primary>maintenance</primary>
641 <secondary>backing up OST config</secondary>
644 <primary>backup</primary>
645 <secondary>OST config</secondary>
646 </indexterm> Backing Up OST Configuration Files</title>
647 <para>If the OST device is still accessible, then the Lustre
648 configuration files on the OST should be backed up and saved for
649 future use in order to avoid difficulties when a replacement OST is
650 returned to service. These files rarely change, so they can and
651 should be backed up while the OST is functional and accessible. If
652 the deactivated OST is still available to mount (i.e. has not
653 permanently failed or is unmountable due to severe corruption), an
654 effort should be made to preserve these files. </para>
657 <para>Mount the OST file system.
658 <screen>oss# mkdir -p /mnt/ost
659 oss# mount -t ldiskfs <replaceable>/dev/ost_device</replaceable> /mnt/ost</screen>
663 <para>Back up the OST configuration files.
664 <screen>oss# tar cvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost last_rcvd \
665 CONFIGS/ O/0/LAST_ID</screen>
669 <para> Unmount the OST file system. <screen>oss# umount /mnt/ost</screen>
674 <section xml:id="lustremaint.restore_ost">
676 <primary>maintenance</primary>
677 <secondary>restoring OST config</secondary>
680 <primary>backup</primary>
681 <secondary>restoring OST config</secondary>
682 </indexterm> Restoring OST Configuration Files</title>
683 <para>If the original OST is still available, it is best to follow the
684 OST backup and restore procedure given in either
685 <xref linkend="dbdoclet.backup_device"/>, or
686 <xref linkend="backup_fs_level"/> and
687 <xref linkend="backup_fs_level.restore"/>.</para>
688 <para>To replace an OST that was removed from service due to corruption
689 or hardware failure, the replacement OST needs to be formatted using
690 <literal>mkfs.lustre</literal>, and the Lustre file system configuration
691 should be restored, if available. Any objects stored on the OST will
692 be permanently lost, and files using the OST should be deleted and/or
693 restored from backup.</para>
694 <para condition="l25">With Lustre 2.5 and later, it is possible to
695 replace an OST to the same index without restoring the configuration
696 files, using the <literal>--replace</literal> option at format time.
697 <screen>oss# mkfs.lustre --ost --reformat --replace --index=<replaceable>old_ost_index</replaceable> \
698 <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
699 The MDS and OSS will negotiate the <literal>LAST_ID</literal> value
700 for the replacement OST.
702 <para>If the OST configuration files were not backed up, due to the
703 OST file system being completely inaccessible, it is still possible to
704 replace the failed OST with a new one at the same OST index. </para>
707 <para>For older versions, format the OST file system without the
708 <literal>--replace</literal> option and restore the saved
710 <screen>oss# mkfs.lustre --ost --reformat --index=<replaceable>old_ost_index</replaceable> \
711 <replaceable>other_options</replaceable> <replaceable>/dev/new_ost_dev</replaceable></screen>
715 <para> Mount the OST file system.
716 <screen>oss# mkdir /mnt/ost
717 oss# mount -t ldiskfs <replaceable>/dev/new_ost_dev</replaceable> <replaceable>/mnt/ost</replaceable></screen>
721 <para>Restore the OST configuration files, if available.
722 <screen>oss# tar xvf <replaceable>ost_name</replaceable>.tar -C /mnt/ost</screen></para>
725 <para>Recreate the OST configuration files, if unavailable. </para>
726 <para>Follow the procedure in
727 <xref linkend="dbdoclet.repair_ost_lastid"/> to recreate the LAST_ID
728 file for this OST index. The <literal>last_rcvd</literal> file
729 will be recreated when the OST is first mounted using the default
730 parameters, which are normally correct for all file systems. The
731 <literal>CONFIGS/mountdata</literal> file is created by
732 <literal>mkfs.lustre</literal> at format time, but has flags set
733 that request it to register itself with the MGS. It is possible to
734 copy the flags from another working OST (which should be the same):
735 <screen>oss1# debugfs -c -R "dump CONFIGS/mountdata /tmp" <replaceable>/dev/other_osdev</replaceable>
736 oss1# scp /tmp/mountdata oss0:/tmp/mountdata
737 oss0# dd if=/tmp/mountdata of=/mnt/ost/CONFIGS/mountdata bs=4 count=1 seek=5 skip=5 conv=notrunc</screen></para>
740 <para> Unmount the OST file system.
741 <screen>oss# umount /mnt/ost</screen>
746 <section xml:id="lustremaint.ucf_qgt_tl">
748 <primary>maintenance</primary>
749 <secondary>reintroducing an OSTs</secondary>
750 </indexterm>Returning a Deactivated OST to Service</title>
751 <para>If the OST was permanently deactivated, it needs to be
752 reactivated in the MGS configuration.
753 <screen>mgs# lctl conf_param <replaceable>ost_name</replaceable>.osc.active=1</screen>
754 If the OST was temporarily deactivated, it needs to be reactivated on
756 <screen>mds# lctl set_param osp.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1
757 client# lctl set_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>-*.active=1</screen></para>
760 <section xml:id="lustremaint.abortRecovery">
761 <title><indexterm><primary>maintenance</primary><secondary>aborting recovery</secondary></indexterm>
762 <indexterm><primary>backup</primary><secondary>aborting recovery</secondary></indexterm>
763 Aborting Recovery</title>
764 <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>
766 <para>The recovery process is blocked until all OSTs are available. </para>
769 <section xml:id="lustremaint.determineOST">
770 <title><indexterm><primary>maintenance</primary><secondary>identifying OST host</secondary></indexterm>
771 Determining Which Machine is Serving an OST </title>
772 <para>In the course of administering a Lustre file system, you may need to determine which
773 machine is serving a specific OST. It is not as simple as identifying the machine’s IP
774 address, as IP is only one of several networking protocols that the Lustre software uses and,
775 as such, LNet does not use IP addresses as node identifiers, but NIDs instead. To identify the
776 NID that is serving a specific OST, run one of the following commands on a client (you do not
777 need to be a root user):
778 <screen>client$ lctl get_param osc.<replaceable>fsname</replaceable>-OST<replaceable>number</replaceable>*.ost_conn_uuid</screen>
780 <screen>client$ lctl get_param osc.*-OST0000*.ost_conn_uuid
781 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen>-
783 <screen>client$ lctl get_param osc.*.ost_conn_uuid
784 osc.testfs-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
785 osc.testfs-OST0001-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
786 osc.testfs-OST0002-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
787 osc.testfs-OST0003-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
788 osc.testfs-OST0004-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp</screen></para>
790 <section xml:id="lustremaint.ChangeAddrFailoverNode">
791 <title><indexterm><primary>maintenance</primary><secondary>changing failover node address</secondary></indexterm>
792 Changing the Address of a Failover Node</title>
793 <para>To change the address of a failover node (e.g, to use node X instead of node Y), run
794 this command on the OSS/OST partition (depending on which option was used to originally
796 <screen>oss# tunefs.lustre --erase-params --servicenode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
798 <screen>oss# tunefs.lustre --erase-params --failnode=<replaceable>NID</replaceable> <replaceable>/dev/ost_device</replaceable></screen>
799 For more information about the <literal>--servicenode</literal> and
800 <literal>--failnode</literal> options, see <xref xmlns:xlink="http://www.w3.org/1999/xlink"
801 linkend="configuringfailover"/>.</para>
803 <section xml:id="lustremaint.seperateCombinedMGSMDT">
804 <title><indexterm><primary>maintenance</primary><secondary>separate a
805 combined MGS/MDT</secondary></indexterm>
806 Separate a combined MGS/MDT</title>
807 <para>These instructions assume the MGS node will be the same as the MDS
808 node. For instructions on how to move MGS to a different node, see
809 <xref linkend="lustremaint.changingservernid"/>.</para>
810 <para>These instructions are for doing the split without shutting down
811 other servers and clients.</para>
814 <para>Stop the MDS.</para>
815 <para>Unmount the MDT</para>
816 <screen>umount -f <replaceable>/dev/mdt_device</replaceable> </screen>
819 <para>Create the MGS.</para>
820 <screen>mds# mkfs.lustre --mgs --device-size=<replaceable>size</replaceable> <replaceable>/dev/mgs_device</replaceable></screen>
823 <para>Copy the configuration data from MDT disk to the new MGS disk.</para>
824 <screen>mds# mount -t ldiskfs -o ro <replaceable>/dev/mdt_device</replaceable> <replaceable>/mdt_mount_point</replaceable></screen>
825 <screen>mds# mount -t ldiskfs -o rw <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable> </screen>
826 <screen>mds# cp -r <replaceable>/mdt_mount_point</replaceable>/CONFIGS/<replaceable>filesystem_name</replaceable>-* <replaceable>/mgs_mount_point</replaceable>/CONFIGS/. </screen>
827 <screen>mds# umount <replaceable>/mgs_mount_point</replaceable></screen>
828 <screen>mds# umount <replaceable>/mdt_mount_point</replaceable></screen>
829 <para>See <xref linkend="lustremaint.regenerateConfigLogs"/> for alternative method.</para>
832 <para>Start the MGS.</para>
833 <screen>mgs# mount -t lustre <replaceable>/dev/mgs_device</replaceable> <replaceable>/mgs_mount_point</replaceable></screen>
834 <para>Check to make sure it knows about all your file system</para>
835 <screen>mgs:/root# lctl get_param mgs.MGS.filesystems</screen>
838 <para>Remove the MGS option from the MDT, and set the new MGS nid.</para>
839 <screen>mds# tunefs.lustre --nomgs --mgsnode=<replaceable>new_mgs_nid</replaceable> <replaceable>/dev/mdt-device</replaceable></screen>
842 <para>Start the MDT.</para>
843 <screen>mds# mount -t lustre <replaceable>/dev/mdt_device /mdt_mount_point</replaceable></screen>
844 <para>Check to make sure the MGS configuration looks right:</para>
845 <screen>mgs# lctl get_param mgs.MGS.live.<replaceable>filesystem_name</replaceable></screen>
849 <section xml:id="lustremaint.setMDTReadonly" condition="l2D">
850 <title><indexterm><primary>maintenance</primary>
851 <secondary>set an MDT to readonly</secondary></indexterm>
852 Set an MDT to read-only</title>
853 <para>It is sometimes desirable to be able to mark the filesystem
854 read-only directly on the server, rather than remounting the clients and
855 setting the option there. This can be useful if there is a rogue client
856 that is deleting files, or when decommissioning a system to prevent
857 already-mounted clients from modifying it anymore.</para>
858 <para>Set the <literal>mdt.*.readonly</literal> parameter to
859 <literal>1</literal> to immediately set the MDT to read-only. All future
860 MDT access will immediately return a "Read-only file system" error
861 (<literal>EROFS</literal>) until the parameter is set to
862 <literal>0</literal> again.</para>
863 <para>Example of setting the <literal>readonly</literal> parameter to
864 <literal>1</literal>, verifying the current setting, accessing from a
865 client, and setting the parameter back to <literal>0</literal>:</para>
866 <screen>mds# lctl set_param mdt.fs-MDT0000.readonly=1
867 mdt.fs-MDT0000.readonly=1
869 mds# lctl get_param mdt.fs-MDT0000.readonly
870 mdt.fs-MDT0000.readonly=1
872 client$ touch test_file
873 touch: cannot touch ‘test_file’: Read-only file system
875 mds# lctl set_param mdt.fs-MDT0000.readonly=0
876 mdt.fs-MDT0000.readonly=0</screen>
879 <!--vim:expandtab:shiftwidth=2:tabstop=8:-->