Whamcloud - gitweb
LUDOC-321 style: ensure ID attributes are unique.
[doc/manual.git] / LustreOperations.xml
1 <?xml version='1.0' encoding='UTF-8'?><chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="lustreoperations">
2   <title xml:id="lustreoperations.title">Lustre Operations</title>
3   <para>Once you have the Lustre file system up and running, you can use the procedures in this section to perform these basic Lustre administration tasks:</para>
4   <itemizedlist>
5     <listitem>
6       <para><xref linkend="dbdoclet.50438194_42877"/></para>
7     </listitem>
8     <listitem>
9       <para><xref linkend="dbdoclet.50438194_24122"/></para>
10     </listitem>
11     <listitem>
12       <para><xref linkend="dbdoclet.50438194_84876"/></para>
13     </listitem>
14     <listitem>
15       <para><xref linkend="dbdoclet.50438194_69255"/></para>
16     </listitem>
17     <listitem>
18       <para><xref linkend="dbdoclet.50438194_57420"/></para>
19     </listitem>
20     <listitem>
21       <para><xref linkend="dbdoclet.50438194_54138"/></para>
22     </listitem>
23     <listitem>
24       <para><xref linkend="dbdoclet.50438194_88063"/></para>
25     </listitem>
26     <listitem>
27       <para><xref linkend="dbdoclet.lfsmkdir"/></para>
28     </listitem>
29     <listitem>
30       <para><xref linkend="dbdoclet.50438194_88980"/></para>
31     </listitem>
32     <listitem>
33       <para><xref linkend="dbdoclet.50438194_41817"/></para>
34     </listitem>
35     <listitem>
36       <para><xref linkend="dbdoclet.50438194_70905"/></para>
37     </listitem>
38     <listitem>
39       <para><xref linkend="dbdoclet.50438194_16954"/></para>
40     </listitem>
41     <listitem>
42       <para><xref linkend="dbdoclet.50438194_69998"/></para>
43     </listitem>
44     <listitem>
45       <para><xref linkend="dbdoclet.50438194_30872"/></para>
46     </listitem>
47   </itemizedlist>
48   <section xml:id="dbdoclet.50438194_42877">
49     <title><indexterm><primary>operations</primary></indexterm>
50 <indexterm><primary>operations</primary><secondary>mounting by label</secondary></indexterm>
51 Mounting by Label</title>
52     <para>The file system name is limited to 8 characters. We have encoded the file system and target information in the disk label, so you can mount by label. This allows system administrators to move disks around without worrying about issues such as SCSI disk reordering or getting the <literal>/dev/device</literal> wrong for a shared target. Soon, file system naming will be made as fail-safe as possible. Currently, Linux disk labels are limited to 16 characters. To identify the target within the file system, 8 characters are reserved, leaving 8 characters for the file system name:</para>
53     <screen><replaceable>fsname</replaceable>-MDT0000 or <replaceable>fsname</replaceable>-OST0a19</screen>
54     <para>To mount by label, use this command:</para>
55     <screen>mount -t lustre -L <replaceable>file_system_label</replaceable> <replaceable>/mount_point</replaceable></screen>
56     <para>This is an example of mount-by-label:</para>
57     <screen>mds# mount -t lustre -L testfs-MDT0000 /mnt/mdt</screen>
58     <caution>
59       <para>Mount-by-label should NOT be used in a multi-path environment or when snapshots are being created of the device, since multiple block devices will have the same label.</para>
60     </caution>
61     <para>Although the file system name is internally limited to 8 characters, you can mount the clients at any mount point, so file system users are not subjected to short names. Here is an example:</para>
62     <screen>client# mount -t lustre mds0@tcp0:/short <replaceable>/dev/long_mountpoint_name</replaceable></screen>
63   </section>
64   <section xml:id="dbdoclet.50438194_24122">
65     <title><indexterm><primary>operations</primary><secondary>starting</secondary></indexterm>Starting Lustre</title>
66     <para>On the first start of a Lustre file system, the components must be started in the following order:</para>
67     <orderedlist>
68       <listitem>
69         <para>Mount the MGT.</para>
70                 <note><para>If a combined MGT/MDT is present, Lustre will correctly mount the MGT and MDT automatically.</para></note>
71       </listitem>
72       <listitem>
73         <para>Mount the MDT.</para>
74                 <note><para condition='l24'>Mount all MDTs if multiple MDTs are present.</para></note>
75       </listitem>
76       <listitem>
77         <para>Mount the OST(s).</para>
78       </listitem>
79       <listitem>
80         <para>Mount the client(s).</para>
81       </listitem>
82     </orderedlist>
83   </section>
84   <section xml:id="dbdoclet.50438194_84876">
85     <title><indexterm><primary>operations</primary><secondary>mounting</secondary></indexterm>Mounting a Server</title>
86     <para>Starting a Lustre server is straightforward and only involves the mount command. Lustre servers can be added to <literal>/etc/fstab</literal>:</para>
87     <screen>mount -t lustre</screen>
88     <para>The mount command generates output similar to this:</para>
89     <screen>/dev/sda1 on /mnt/test/mdt type lustre (rw)
90 /dev/sda2 on /mnt/test/ost0 type lustre (rw)
91 192.168.0.21@tcp:/testfs on /mnt/testfs type lustre (rw)</screen>
92     <para>In this example, the MDT, an OST (ost0) and file system (testfs) are mounted.</para>
93     <screen>LABEL=testfs-MDT0000 /mnt/test/mdt lustre defaults,_netdev,noauto 0 0
94 LABEL=testfs-OST0000 /mnt/test/ost0 lustre defaults,_netdev,noauto 0 0</screen>
95     <para>In general, it is wise to specify noauto and let your high-availability (HA) package
96       manage when to mount the device. If you are not using failover, make sure that networking has
97       been started before mounting a Lustre server. If you are running Red Hat Enterprise Linux,
98       SUSE Linux Enterprise Server, Debian operating system (and perhaps others), use the
99         <literal>_netdev</literal> flag to ensure that these disks are mounted after the network is
100       up.</para>
101     <para>We are mounting by disk label here. The label of a device can be read with <literal>e2label</literal>. The label of a newly-formatted Lustre server may end in <literal>FFFF</literal> if the <literal>--index</literal> option is not specified to <literal>mkfs.lustre</literal>, meaning that it has yet to be assigned. The assignment takes place when the server is first started, and the disk label is updated.  It is recommended that the <literal>--index</literal> option always be used, which will also ensure that the label is set at format time.</para>
102     <caution>
103       <para>Do not do this when the client and OSS are on the same node, as memory pressure between the client and OSS can lead to deadlocks.</para>
104     </caution>
105     <caution>
106       <para>Mount-by-label should NOT be used in a multi-path environment.</para>
107     </caution>
108   </section>
109   <section xml:id="dbdoclet.50438194_69255">
110     <title><indexterm><primary>operations</primary><secondary>unmounting</secondary></indexterm>Unmounting a Server</title>
111     <para>To stop a Lustre server, use the <literal>umount <replaceable>/mount</replaceable> <replaceable>point</replaceable></literal> command.</para>
112     <para>For example, to stop <literal>ost0</literal> on mount point <literal>/mnt/test</literal>, run:</para>
113     <screen>$ umount /mnt/test</screen>
114     <para>Gracefully stopping a server with the <literal>umount</literal> command preserves the state of the connected clients. The next time the server is started, it waits for clients to reconnect, and then goes through the recovery procedure.</para>
115     <para>If the force (<literal>-f</literal>) flag is used, then the server evicts all clients and stops WITHOUT recovery. Upon restart, the server does not wait for recovery. Any currently connected clients receive I/O errors until they reconnect.</para>
116     <note>
117       <para>If you are using loopback devices, use the <literal>-d</literal> flag. This flag cleans up loop devices and can always be safely specified.</para>
118     </note>
119   </section>
120   <section xml:id="dbdoclet.50438194_57420">
121     <title><indexterm><primary>operations</primary><secondary>failover</secondary></indexterm>Specifying Failout/Failover Mode for OSTs</title>
122     <para>In a Lustre file system, an OST that has become unreachable because it fails, is taken off
123       the network, or is unmounted can be handled in one of two ways:</para>
124     <itemizedlist>
125       <listitem>
126         <para> In <literal>failout</literal> mode, Lustre clients immediately receive errors (EIOs)
127           after a timeout, instead of waiting for the OST to recover.</para>
128       </listitem>
129       <listitem>
130         <para> In <literal>failover</literal> mode, Lustre clients wait for the OST to
131           recover.</para>
132       </listitem>
133     </itemizedlist>
134     <para>By default, the Lustre file system uses <literal>failover</literal> mode for OSTs. To
135       specify <literal>failout</literal> mode instead, use the
136         <literal>--param=&quot;failover.mode=failout&quot;</literal> option as shown below (entered
137       on one line):</para>
138     <screen>oss# mkfs.lustre --fsname=<replaceable>fsname</replaceable> --mgsnode=<replaceable>mgs_NID</replaceable> --param=failover.mode=failout 
139       --ost --index=<replaceable>ost_index</replaceable> <replaceable>/dev/ost_block_device</replaceable></screen>
140     <para>In the example below, <literal>failout</literal> mode is specified for the OSTs on the MGS
141         <literal>mds0</literal> in the file system <literal>testfs</literal> (entered on one
142       line).</para>
143     <screen>oss# mkfs.lustre --fsname=testfs --mgsnode=mds0 --param=failover.mode=failout 
144       --ost --index=3 /dev/sdb </screen>
145     <caution>
146       <para>Before running this command, unmount all OSTs that will be affected by a change in
147           <literal>failover</literal> / <literal>failout</literal> mode.</para>
148     </caution>
149     <note>
150       <para>After initial file system configuration, use the <literal>tunefs.lustre</literal>
151         utility to change the mode. For example, to set the <literal>failout</literal> mode,
152         run:</para>
153       <para><screen>$ tunefs.lustre --param failover.mode=failout <replaceable>/dev/ost_device</replaceable></screen></para>
154     </note>
155   </section>
156   <section xml:id="dbdoclet.50438194_54138">
157     <title><indexterm><primary>operations</primary><secondary>degraded OST RAID</secondary></indexterm>Handling Degraded OST RAID Arrays</title>
158     <para>Lustre includes functionality that notifies Lustre if an external RAID array has degraded performance (resulting in reduced overall file system performance), either because a disk has failed and not been replaced, or because a disk was replaced and is undergoing a rebuild. To avoid a global performance slowdown due to a degraded OST, the MDS can avoid the OST for new object allocation if it is notified of the degraded state.</para>
159     <para>A parameter for each OST, called <literal>degraded</literal>, specifies whether the OST is running in degraded mode or not.</para>
160     <para>To mark the OST as degraded, use:</para>
161     <screen>lctl set_param obdfilter.{OST_name}.degraded=1</screen>
162     <para>To mark that the OST is back in normal operation, use:</para>
163     <screen>lctl set_param obdfilter.{OST_name}.degraded=0
164 </screen>
165     <para>To determine if OSTs are currently in degraded mode, use:</para>
166     <screen>lctl get_param obdfilter.*.degraded
167 </screen>
168     <para>If the OST is remounted due to a reboot or other condition, the flag resets to <literal>0</literal>.</para>
169     <para>It is recommended that this be implemented by an automated script that monitors the status of individual RAID devices.</para>
170   </section>
171   <section xml:id="dbdoclet.50438194_88063">
172     <title><indexterm><primary>operations</primary><secondary>multiple file systems</secondary></indexterm>Running Multiple Lustre File Systems</title>
173     <para>Lustre supports multiple file systems provided the combination of <literal>NID:fsname</literal> is unique. Each file system must be allocated a unique name during creation with the <literal>--fsname</literal> parameter. Unique names for file systems are enforced if a single MGS is present. If multiple MGSs are present (for example if you have an MGS on every MDS) the administrator is responsible for ensuring file system names are unique. A single MGS and unique file system names provides a single point of administration and allows commands to be issued against the file system even if it is not mounted.</para>
174     <para>Lustre supports multiple file systems on a single MGS. With a single MGS fsnames are guaranteed to be unique. Lustre also allows multiple MGSs to co-exist. For example, multiple MGSs will be necessary if multiple file systems on different Lustre software versions are to be concurrently available. With multiple MGSs additional care must be taken to ensure file system names are unique. Each file system should have a unique fsname among all systems that may interoperate in the future.</para>
175     <para>By default, the <literal>mkfs.lustre</literal> command creates a file system named <literal>lustre</literal>. To specify a different file system name (limited to 8 characters) at format time, use the <literal>--fsname</literal> option:</para>
176     <para><screen>mkfs.lustre --fsname=<replaceable>file_system_name</replaceable></screen></para>
177     <note>
178       <para>The MDT, OSTs and clients in the new file system must use the same file system name
179         (prepended to the device name). For example, for a new file system named
180           <literal>foo</literal>, the MDT and two OSTs would be named
181         <literal>foo-MDT0000</literal>, <literal>foo-OST0000</literal>, and
182           <literal>foo-OST0001</literal>.</para>
183     </note>
184     <para>To mount a client on the file system, run:</para>
185     <screen>client# mount -t lustre <replaceable>mgsnode</replaceable>:<replaceable>/new_fsname</replaceable> <replaceable>/mount_point</replaceable></screen>
186     <para>For example, to mount a client on file system foo at mount point /mnt/foo, run:</para>
187     <screen>client# mount -t lustre mgsnode:/foo /mnt/foo</screen>
188     <note>
189       <para>If a client(s) will be mounted on several file systems, add the following line to <literal>/etc/xattr.conf</literal> file to avoid problems when files are moved between the file systems: <literal>lustre.* skip</literal></para>
190     </note>
191     <note>
192       <para>To ensure that a new MDT is added to an existing MGS create the MDT by specifying: <literal>--mdt --mgsnode=<replaceable>mgs_NID</replaceable></literal>.</para>
193     </note>
194     <para>A Lustre installation with two file systems (<literal>foo</literal> and <literal>bar</literal>) could look like this, where the MGS node is <literal>mgsnode@tcp0</literal> and the mount points are <literal>/mnt/foo</literal> and <literal>/mnt/bar</literal>.</para>
195     <screen>mgsnode# mkfs.lustre --mgs /dev/sda
196 mdtfoonode# mkfs.lustre --fsname=foo --mgsnode=mgsnode@tcp0 --mdt --index=0 /dev/sdb
197 ossfoonode# mkfs.lustre --fsname=foo --mgsnode=mgsnode@tcp0 --ost --index=0 /dev/sda
198 ossfoonode# mkfs.lustre --fsname=foo --mgsnode=mgsnode@tcp0 --ost --index=1 /dev/sdb
199 mdtbarnode# mkfs.lustre --fsname=bar --mgsnode=mgsnode@tcp0 --mdt --index=0 /dev/sda
200 ossbarnode# mkfs.lustre --fsname=bar --mgsnode=mgsnode@tcp0 --ost --index=0 /dev/sdc
201 ossbarnode# mkfs.lustre --fsname=bar --mgsnode=mgsnode@tcp0 --ost --index=1 /dev/sdd</screen>
202     <para>To mount a client on file system foo at mount point <literal>/mnt/foo</literal>, run:</para>
203     <screen>client# mount -t lustre mgsnode@tcp0:/foo /mnt/foo</screen>
204     <para>To mount a client on file system bar at mount point <literal>/mnt/bar</literal>, run:</para>
205     <screen>client# mount -t lustre mgsnode@tcp0:/bar /mnt/bar</screen>
206   </section>
207   <section xml:id="dbdoclet.lfsmkdir" condition='l24'>
208     <title><indexterm><primary>operations</primary><secondary>remote directory</secondary></indexterm>Creating a sub-directory on a given MDT</title>
209         <para>Lustre 2.4 enables individual sub-directories to be serviced by unique MDTs. An administrator can allocate a sub-directory to a given MDT using the command:</para>
210         <screen>client# lfs mkdir â€“i <replaceable>mdt_index</replaceable> <replaceable>/mount_point/remote_dir</replaceable>
211         </screen>
212         <para>This command will allocate the sub-directory <literal>remote_dir</literal> onto the MDT of index <literal>mdtindex</literal>. For more information on adding additional MDTs and <literal>mdtindex</literal> see <xref linkend='dbdoclet.addmdtindex'/>.</para>
213         <warning><para>An administrator can allocate remote sub-directories to separate MDTs. Creating remote sub-directories in parent directories not hosted on MDT0 is not recommended. This is because the failure of the parent MDT will leave the namespace below it inaccessible. For this reason, by default it is only possible to create remote sub-directories off MDT0. To relax this restriction and enable remote sub-directories off any MDT, an administrator must issue the command <literal>lctl set_param mdd.*.enable_remote_dir=1</literal>.</para></warning>
214   </section>
215   <section xml:id="dbdoclet.50438194_88980">
216     <title><indexterm><primary>operations</primary><secondary>parameters</secondary></indexterm>Setting and Retrieving Lustre Parameters</title>
217     <para>Several options are available for setting parameters in Lustre:</para>
218     <itemizedlist>
219       <listitem>
220         <para> When creating a file system, use mkfs.lustre. See <xref linkend="dbdoclet.50438194_17237"/> below.</para>
221       </listitem>
222       <listitem>
223         <para> When a server is stopped, use tunefs.lustre. See <xref linkend="dbdoclet.50438194_55253"/> below.</para>
224       </listitem>
225       <listitem>
226         <para> When the file system is running, use lctl to set or retrieve Lustre parameters. See <xref linkend="dbdoclet.50438194_51490"/> and <xref linkend="dbdoclet.50438194_63247"/> below.</para>
227       </listitem>
228     </itemizedlist>
229     <section xml:id="dbdoclet.50438194_17237">
230       <title>Setting Tunable Parameters with <literal>mkfs.lustre</literal></title>
231       <para>When the file system is first formatted, parameters can simply be added as a <literal>--param</literal> option to the <literal>mkfs.lustre</literal> command. For example:</para>
232       <screen>mds# mkfs.lustre --mdt --param=&quot;sys.timeout=50&quot; /dev/sda</screen>
233       <para>For more details about creating a file system,see <xref linkend="configuringlustre"/>. For more details about <literal>mkfs.lustre</literal>, see <xref linkend="systemconfigurationutilities"/>.</para>
234     </section>
235     <section xml:id="dbdoclet.50438194_55253">
236       <title>Setting Parameters with <literal>tunefs.lustre</literal></title>
237       <para>If a server (OSS or MDS) is stopped, parameters can be added to an existing file system
238         using the <literal>--param</literal> option to the <literal>tunefs.lustre</literal> command.
239         For example:</para>
240       <screen>oss# tunefs.lustre --param=failover.node=192.168.0.13@tcp0 /dev/sda</screen>
241       <para>With <literal>tunefs.lustre</literal>, parameters are <emphasis>additive</emphasis> -- new parameters are specified in addition to old parameters, they do not replace them. To erase all old <literal>tunefs.lustre</literal> parameters and just use newly-specified parameters, run:</para>
242       <screen>mds# tunefs.lustre --erase-params --param=<replaceable>new_parameters</replaceable> </screen>
243       <para>The tunefs.lustre command can be used to set any parameter settable in a /proc/fs/lustre file and that has its own OBD device, so it can be specified as <literal><replaceable>obdname|fsname</replaceable>.<replaceable>obdtype</replaceable>.<replaceable>proc_file_name</replaceable>=<replaceable>value</replaceable></literal>. For example:</para>
244       <screen>mds# tunefs.lustre --param mdt.identity_upcall=NONE /dev/sda1</screen>
245       <para>For more details about <literal>tunefs.lustre</literal>, see <xref linkend="systemconfigurationutilities"/>.</para>
246     </section>
247     <section xml:id="dbdoclet.50438194_51490">
248       <title>Setting Parameters with <literal>lctl</literal></title>
249       <para>When the file system is running, the <literal>lctl</literal> command can be used to set parameters (temporary or permanent) and report current parameter values. Temporary parameters are active as long as the server or client is not shut down. Permanent parameters live through server and client reboots.</para>
250       <note>
251         <para>The lctl list_param command enables users to list all parameters that can be set. See <xref linkend="dbdoclet.50438194_88217"/>.</para>
252       </note>
253       <para>For more details about the <literal>lctl</literal> command, see the examples in the sections below and <xref linkend="systemconfigurationutilities"/>.</para>
254       <section remap="h4">
255         <title>Setting Temporary Parameters</title>
256         <para>Use <literal>lctl set_param</literal> to set temporary parameters on the node where it is run. These parameters map to items in <literal>/proc/{fs,sys}/{lnet,lustre}</literal>. The <literal>lctl set_param</literal> command uses this syntax:</para>
257         <screen>lctl set_param [-n] <replaceable>obdtype</replaceable>.<replaceable>obdname</replaceable>.<replaceable>proc_file_name</replaceable>=<replaceable>value</replaceable></screen>
258         <para>For example:</para>
259         <screen># lctl set_param osc.*.max_dirty_mb=1024
260 osc.myth-OST0000-osc.max_dirty_mb=32
261 osc.myth-OST0001-osc.max_dirty_mb=32
262 osc.myth-OST0002-osc.max_dirty_mb=32
263 osc.myth-OST0003-osc.max_dirty_mb=32
264 osc.myth-OST0004-osc.max_dirty_mb=32</screen>
265       </section>
266       <section xml:id="dbdoclet.50438194_64195">
267         <title>Setting Permanent Parameters</title>
268         <para>Use the <literal>lctl conf_param</literal> command to set permanent parameters. In general, the <literal>lctl conf_param</literal> command can be used to specify any parameter settable in a <literal>/proc/fs/lustre</literal> file, with its own OBD device. The <literal>lctl conf_param</literal> command uses this syntax (same as the <literal>mkfs.lustre</literal> and <literal>tunefs.lustre</literal> commands):</para>
269         <screen><replaceable>obdname|fsname</replaceable>.<replaceable>obdtype</replaceable>.<replaceable>proc_file_name</replaceable>=<replaceable>value</replaceable>) </screen>
270         <para>Here are a few examples of <literal>lctl conf_param</literal> commands:</para>
271         <screen>mgs# lctl conf_param testfs-MDT0000.sys.timeout=40
272 $ lctl conf_param testfs-MDT0000.mdt.identity_upcall=NONE
273 $ lctl conf_param testfs.llite.max_read_ahead_mb=16
274 $ lctl conf_param testfs-MDT0000.lov.stripesize=2M
275 $ lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15
276 $ lctl conf_param testfs-OST0000.ost.client_cache_seconds=15
277 $ lctl conf_param testfs.sys.timeout=40 </screen>
278         <caution>
279           <para>Parameters specified with the <literal>lctl conf_param</literal> command are set permanently in the file system&apos;s configuration file on the MGS.</para>
280         </caution>
281       </section>
282       <section xml:id="dbdoclet.setparamp" condition='l25'>
283         <title>Setting Permanent Parameters with lctl set_param -P</title>
284         <para> Use the <literal>lctl set_param -P</literal> to set parameters permanently. This command must be issued on the MGS. The given parameter is set on every host using <literal>lctl</literal> upcall. Parameters map to items in <literal>/proc/{fs,sys}/{lnet,lustre}</literal>. The <literal>lctl set_param</literal> command uses this syntax:</para>
285         <screen>lctl set_param -P <replaceable>obdtype</replaceable>.<replaceable>obdname</replaceable>.<replaceable>proc_file_name</replaceable>=<replaceable>value</replaceable></screen>
286         <para>For example:</para>
287         <screen># lctl set_param -P osc.*.max_dirty_mb=1024
288 osc.myth-OST0000-osc.max_dirty_mb=32
289 osc.myth-OST0001-osc.max_dirty_mb=32
290 osc.myth-OST0002-osc.max_dirty_mb=32
291 osc.myth-OST0003-osc.max_dirty_mb=32
292 osc.myth-OST0004-osc.max_dirty_mb=32 </screen>
293         <para>Use <literal>-d </literal>  (only with -P) option to delete permanent parameter. Syntax:</para>
294         <screen>lctl set_param -P -d<replaceable>obdtype</replaceable>.<replaceable>obdname</replaceable>.<replaceable>proc_file_name</replaceable></screen>
295         <para>For example:</para>
296         <screen># lctl set_param -P -d osc.*.max_dirty_mb </screen>
297       </section>
298       <section xml:id="dbdoclet.50438194_88217">
299         <title>Listing Parameters</title>
300         <para>To list Lustre or LNET parameters that are available to set, use the <literal>lctl list_param</literal> command. For example:</para>
301         <screen>lctl list_param [-FR] <replaceable>obdtype</replaceable>.<replaceable>obdname</replaceable></screen>
302         <para>The following arguments are available for the <literal>lctl list_param</literal> command.</para>
303         <para><literal>-F</literal> Add &apos;<literal>/</literal>&apos;, &apos;<literal>@</literal>&apos; or &apos;<literal>=</literal>&apos; for directories, symlinks and writeable files, respectively</para>
304         <para><literal>-R</literal> Recursively lists all parameters under the specified path</para>
305         <para>For example:</para>
306         <screen>oss# lctl list_param obdfilter.lustre-OST0000 </screen>
307       </section>
308       <section xml:id="dbdoclet.50438194_63247">
309         <title>Reporting Current Parameter Values</title>
310         <para>To report current Lustre parameter values, use the <literal>lctl get_param</literal> command with this syntax:</para>
311         <screen>lctl get_param [-n] <replaceable>obdtype</replaceable>.<replaceable>obdname</replaceable>.<replaceable>proc_file_name</replaceable></screen>
312         <para>This example reports data on RPC service times.</para>
313         <screen>oss# lctl get_param -n ost.*.ost_io.timeouts
314 service : cur 1 worst 30 (at 1257150393, 85d23h58m54s ago) 1 1 1 1 </screen>
315         <para>This example reports the amount of space this client has reserved for writeback cache with each OST:</para>
316         <screen>client# lctl get_param osc.*.cur_grant_bytes
317 osc.myth-OST0000-osc-ffff8800376bdc00.cur_grant_bytes=2097152
318 osc.myth-OST0001-osc-ffff8800376bdc00.cur_grant_bytes=33890304
319 osc.myth-OST0002-osc-ffff8800376bdc00.cur_grant_bytes=35418112
320 osc.myth-OST0003-osc-ffff8800376bdc00.cur_grant_bytes=2097152
321 osc.myth-OST0004-osc-ffff8800376bdc00.cur_grant_bytes=33808384</screen>
322       </section>
323     </section>
324   </section>
325   <section xml:id="dbdoclet.50438194_41817">
326     <title><indexterm><primary>operations</primary><secondary>failover</secondary></indexterm>Specifying NIDs and Failover</title>
327     <para>If a node has multiple network interfaces, it may have multiple NIDs, which must all be
328       identified so other nodes can choose the NID that is appropriate for their network interfaces.
329       Typically, NIDs are specified in a list delimited by commas (<literal>,</literal>). However,
330       when failover nodes are specified, the NIDs are delimited by a colon (<literal>:</literal>) or
331       by repeating a keyword such as <literal>--mgsnode=</literal> or
332         <literal>--servicenode=</literal>). </para>
333     <para>To display the NIDs of all servers in networks configured to work with the Lustre file
334       system, run (while LNET is running):</para>
335     <screen>lctl list_nids</screen>
336     <para>In the example below,  <literal>mds0</literal> and <literal>mds1</literal> are configured
337       as a combined MGS/MDT failover pair and <literal>oss0</literal> and <literal>oss1</literal>
338       are configured as an OST failover pair. The Ethernet address for <literal>mds0</literal> is
339       192.168.10.1, and for <literal>mds1</literal> is 192.168.10.2. The Ethernet addresses for
340         <literal>oss0</literal> and <literal>oss1</literal>  are 192.168.10.20 and 192.168.10.21
341       respectively.</para>
342     <screen>mds0# mkfs.lustre --fsname=testfs --mdt --mgs \
343         --servicenode=192.168.10.2@tcp0 \
344         -–servicenode=192.168.10.1@tcp0 /dev/sda1
345 mds0# mount -t lustre /dev/sda1 /mnt/test/mdt
346 oss0# mkfs.lustre --fsname=testfs --servicenode=192.168.10.20@tcp0 \
347         --servicenode=192.168.10.21 --ost --index=0 \
348         --mgsnode=192.168.10.1@tcp0 --mgsnode=192.168.10.2@tcp0 \
349         /dev/sdb
350 oss0# mount -t lustre /dev/sdb /mnt/test/ost0
351 client# mount -t lustre 192.168.10.1@tcp0:192.168.10.2@tcp0:/testfs \
352         /mnt/testfs
353 mds0# umount /mnt/mdt
354 mds1# mount -t lustre /dev/sda1 /mnt/test/mdt
355 mds1# cat /proc/fs/lustre/mds/testfs-MDT0000/recovery_status</screen>
356     <para>Where multiple NIDs are specified separated by commas  (for example,
357         <literal>10.67.73.200@tcp,192.168.10.1@tcp</literal>), the two NIDs refer to the same host,
358       and the Lustre software chooses the <emphasis>best</emphasis> one for communication. When a
359       pair of NIDs is separated by a colon (for example,
360         <literal>10.67.73.200@tcp:10.67.73.201@tcp</literal>), the two NIDs refer to two different
361       hosts and are treated as a failover pair (the Lustre software tries the first one, and if that
362       fails, it tries the second one.)</para>
363     <para>Two options to <literal>mkfs.lustre</literal> can be used to specify failover nodes.
364       Introduced in Lustre software release 2.0, the <literal>--servicenode</literal> option is used
365       to specify all service NIDs, including those for primary nodes and failover nodes. When the
366         <literal>--servicenode</literal>option is used, the first service node to load the target
367       device becomes the primary service node, while nodes corresponding to the other specified NIDs
368       become failover locations for the target device. An older option,
369         <literal>--failnode</literal>, specifies just the NIDS of failover nodes. For more
370       information about the <literal>--servicenode</literal> and <literal>--failnode</literal>
371       options, see <xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="configuringfailover"
372       />.</para>
373   </section>
374   <section xml:id="dbdoclet.50438194_70905">
375     <title><indexterm><primary>operations</primary><secondary>erasing a file system</secondary></indexterm>Erasing a File System</title>
376     <para>If you want to erase a file system and permanently delete all the data in the file system,
377       run this command on your targets:</para>
378     <screen>$ &quot;mkfs.lustre --reformat&quot;</screen>
379     <para>If you are using a separate MGS and want to keep other file systems defined on that MGS, then set the <literal>writeconf</literal> flag on the MDT for that file system. The <literal>writeconf</literal> flag causes the configuration logs to be erased; they are regenerated the next time the servers start.</para>
380     <para>To set the <literal>writeconf</literal> flag on the MDT:</para>
381     <orderedlist>
382       <listitem>
383         <para>Unmount all clients/servers using this file system, run:</para>
384         <screen>$ umount /mnt/lustre</screen>
385       </listitem>
386       <listitem>
387         <para>Permanently erase the file system and, presumably, replace it
388         with another file system, run:</para>
389         <screen>$ mkfs.lustre --reformat --fsname spfs --mgs --mdt --index=0 /dev/<emphasis>{mdsdev}</emphasis></screen>
390       </listitem>
391       <listitem>
392         <para>If you have a separate MGS (that you do not want to reformat), then add the <literal>--writeconf</literal> flag to <literal>mkfs.lustre</literal> on the MDT, run:</para>
393         <screen>$ mkfs.lustre --reformat --writeconf --fsname spfs --mgsnode=<replaceable>mgs_nid</replaceable> --mdt --index=0 <replaceable>/dev/mds_device</replaceable></screen>
394       </listitem>
395     </orderedlist>
396     <note>
397       <para>If you have a combined MGS/MDT, reformatting the MDT reformats the MGS as well, causing all configuration information to be lost; you can start building your new file system. Nothing needs to be done with old disks that will not be part of the new file system, just do not mount them.</para>
398     </note>
399   </section>
400   <section xml:id="dbdoclet.50438194_16954">
401     <title><indexterm><primary>operations</primary><secondary>reclaiming space</secondary></indexterm>Reclaiming Reserved Disk Space</title>
402     <para>All current Lustre installations run the ldiskfs file system internally on service nodes.
403       By default, ldiskfs reserves 5% of the disk space to avoid file system fragmentation. In order
404       to reclaim this space, run the following command on your OSS for each OST in the file
405       system:</para>
406     <screen>tune2fs [-m reserved_blocks_percent] /dev/<emphasis>{ostdev}</emphasis></screen>
407     <para>You do not need to shut down Lustre before running this command or restart it afterwards.</para>
408     <warning>
409       <para>Reducing the space reservation can cause severe performance degradation as the OST file
410         system becomes more than 95% full, due to difficulty in locating large areas of contiguous
411         free space. This performance degradation may persist even if the space usage drops below 95%
412         again. It is recommended NOT to reduce the reserved disk space below 5%.</para>
413     </warning>
414   </section>
415   <section xml:id="dbdoclet.50438194_69998">
416     <title><indexterm><primary>operations</primary><secondary>replacing an OST or MDS</secondary></indexterm>Replacing an Existing OST or MDT</title>
417     <para>To copy the contents of an existing OST to a new OST (or an old MDT to a new MDT), follow the process for either OST/MDT backups in
418     <xref linkend='dbdoclet.50438207_71633'/> or
419     <xref linkend='dbdoclet.50438207_21638'/>. For more information on removing a MDT, see <xref linkend='dbdoclet.rmremotedir'/>.</para>
420   </section>
421   <section xml:id="dbdoclet.50438194_30872">
422     <title><indexterm><primary>operations</primary><secondary>identifying OSTs</secondary></indexterm>Identifying To Which Lustre File an OST Object Belongs</title>
423     <para>Use this procedure to identify the file containing a given object on a given OST.</para>
424     <orderedlist>
425       <listitem>
426         <para>On the OST (as root), run <literal>debugfs</literal> to display the file identifier (<literal>FID</literal>) of the file associated with the object.</para>
427         <para>For example, if the object is <literal>34976</literal> on <literal>/dev/lustre/ost_test2</literal>, the debug command is:
428         <screen># debugfs -c -R &quot;stat /O/0/d$((34976 % 32))/34976&quot; /dev/lustre/ost_test2 </screen></para>
429         <para>The command output is:
430         <screen>debugfs 1.42.3.wc3 (15-Aug-2012)
431 /dev/lustre/ost_test2: catastrophic mode - not reading inode or group bitmaps
432 Inode: 352365   Type: regular    Mode:  0666   Flags: 0x80000
433 Generation: 2393149953    Version: 0x0000002a:00005f81
434 User:  1000   Group:  1000   Size: 260096
435 File ACL: 0    Directory ACL: 0
436 Links: 1   Blockcount: 512
437 Fragment:  Address: 0    Number: 0    Size: 0
438 ctime: 0x4a216b48:00000000 -- Sat May 30 13:22:16 2009
439 atime: 0x4a216b48:00000000 -- Sat May 30 13:22:16 2009
440 mtime: 0x4a216b48:00000000 -- Sat May 30 13:22:16 2009
441 crtime: 0x4a216b3c:975870dc -- Sat May 30 13:22:04 2009
442 Size of extra inode fields: 24
443 Extended attributes stored in inode body:
444   fid = &quot;b9 da 24 00 00 00 00 00 6a fa 0d 3f 01 00 00 00 eb 5b 0b 00 00 00 0000 00 00 00 00 00 00 00 00 &quot; (32)
445   fid: objid=34976 seq=0 parent=[0x24dab9:0x3f0dfa6a:0x0] stripe=1
446 EXTENTS:
447 (0-64):4620544-4620607
448 </screen></para>
449       </listitem>
450       <listitem>
451         <para>For Lustre software release 2.x file systems, the parent FID will be of the form
452           [0x200000400:0x122:0x0] and can be resolved directly using the <literal>lfs fid2path
453             [0x200000404:0x122:0x0] /mnt/lustre</literal> command on any Lustre client, and the
454           process is complete.</para>
455       </listitem>
456       <listitem>
457         <para>In this example the parent inode FID is an upgraded 1.x inode
458         (due to the first part of the FID being below 0x200000400), the
459         MDT inode number is <literal>0x24dab9</literal> and generation <literal>0x3f0dfa6a</literal> and the pathname needs to be resolved using
460         <literal>debugfs</literal>.</para>
461       </listitem>
462       <listitem>
463         <para>On the MDS (as root), use <literal>debugfs</literal> to find the file associated with the inode:</para>
464         <screen># debugfs -c -R &quot;ncheck 0x24dab9&quot; /dev/lustre/mdt_test </screen>
465         <para>Here is the command output:</para>
466         <screen>debugfs 1.42.3.wc2 (15-Aug-2012)
467 /dev/lustre/mdt_test: catastrophic mode - not reading inode or group bitmap\
468 s
469 Inode      Pathname
470 2415289    /ROOT/brian-laptop-guest/clients/client11/~dmtmp/PWRPNT/ZD16.BMP</screen>
471       </listitem>
472     </orderedlist>
473     <para>The command lists the inode and pathname associated with the object.</para>
474     <note>
475       <para><literal>Debugfs</literal>&apos; &apos;&apos;ncheck&apos;&apos; is a brute-force search that may take a long time to complete.</para>
476     </note>
477     <note>
478       <para>To find the Lustre file from a disk LBA, follow the steps listed in the document at this URL: <link xl:href="http://smartmontools.sourceforge.net/badblockhowto.html">http://smartmontools.sourceforge.net/badblockhowto.html</link>. Then, follow the steps above to resolve the Lustre filename.</para>
479     </note>
480   </section>
481 </chapter>