Whamcloud - gitweb
FIX: converted to glossary and removed cruft
[doc/manual.git] / LustreMaintenance.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter version="5.0" xml:lang="en-US" xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink">
3   <info>
4     <title>Lustre Maintenance</title>
5   </info>
6   <para><anchor xml:id="dbdoclet.50438199_pgfId-1298785" xreflabel=""/>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>
7   <itemizedlist><listitem>
8       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298801" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_85142">Working with Inactive OSTs</link></para>
9     </listitem>
10 <listitem>
11       <para> </para>
12     </listitem>
13 <listitem>
14       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298805" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_15240">Finding Nodes in the Lustre File System</link></para>
15     </listitem>
16 <listitem>
17       <para> </para>
18     </listitem>
19 <listitem>
20       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298809" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_26070">Mounting a Server Without Lustre Service</link></para>
21     </listitem>
22 <listitem>
23       <para> </para>
24     </listitem>
25 <listitem>
26       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298821" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_54623">Regenerating Lustre Configuration Logs</link></para>
27     </listitem>
28 <listitem>
29       <para> </para>
30     </listitem>
31 <listitem>
32       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305038" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_31353">Changing a Server NID</link></para>
33     </listitem>
34 <listitem>
35       <para> </para>
36     </listitem>
37 <listitem>
38       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306383" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_22527">Adding a New OST to a Lustre File System</link></para>
39     </listitem>
40 <listitem>
41       <para> </para>
42     </listitem>
43 <listitem>
44       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298825" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_14978">Removing and Restoring OSTs</link></para>
45     </listitem>
46 <listitem>
47       <para> </para>
48     </listitem>
49 <listitem>
50       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298833" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_77819">Aborting Recovery</link></para>
51     </listitem>
52 <listitem>
53       <para> </para>
54     </listitem>
55 <listitem>
56       <para><anchor xml:id="dbdoclet.50438199_pgfId-1303950" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_12607">Determining Which Machine is Serving an OST</link></para>
57     </listitem>
58 <listitem>
59       <para> </para>
60     </listitem>
61 <listitem>
62       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298849" xreflabel=""/><link xl:href="LustreMaintenance.html#50438199_62333">Changing the Address of a Failover Node</link></para>
63     </listitem>
64 <listitem>
65       <para> </para>
66     </listitem>
67 </itemizedlist>
68   <section remap="h2">
69     <title><anchor xml:id="dbdoclet.50438199_pgfId-1298889" xreflabel=""/></title>
70     <section remap="h2">
71       <title>14.1 <anchor xml:id="dbdoclet.50438199_42877" xreflabel=""/><anchor xml:id="dbdoclet.50438199_85142" xreflabel=""/>Working with <anchor xml:id="dbdoclet.50438199_marker-1298888" xreflabel=""/>Inactive OSTs</title>
72       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298890" xreflabel=""/>To mount a client or an MDT with one or more inactive OSTs, run commands similar to this:</para>
73       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298891" xreflabel=""/>client&gt; mount -o exclude=testfs-OST0000 -t lustre uml1:/testfs\ /mnt/testfs
74 <anchor xml:id="dbdoclet.50438199_pgfId-1298892" xreflabel=""/>client&gt; cat /proc/fs/lustre/lov/testfs-clilov-*/target_obd
75 </screen>
76       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298893" xreflabel=""/>To activate an inactive OST on a live client or MDT, use the lctl activate command on the OSC device. For example:</para>
77       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298894" xreflabel=""/>lctl --device 7 activate
78 </screen>
79       <informaltable frame="none">
80         <tgroup cols="1">
81           <colspec colname="c1" colwidth="100*"/>
82           <tbody>
83             <row>
84               <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438199_pgfId-1298895" xreflabel=""/>A colon-separated list can also be specified. For example, exclude=testfs-OST0000:testfs-OST0001.</para></entry>
85             </row>
86           </tbody>
87         </tgroup>
88       </informaltable>
89     </section>
90     <section remap="h2">
91       <title>14.2 <anchor xml:id="dbdoclet.50438199_15240" xreflabel=""/>Finding <anchor xml:id="dbdoclet.50438199_marker-1298897" xreflabel=""/>Nodes in the Lustre File System</title>
92       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298899" xreflabel=""/>There may be situations in which you need to find all nodes in your Lustre file system or get the names of all OSTs.</para>
93       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298900" xreflabel=""/>To get a list of all Lustre nodes, run this command on the MGS:</para>
94       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298901" xreflabel=""/># cat /proc/fs/lustre/mgs/MGS/live/*
95 </screen>
96       <informaltable frame="none">
97         <tgroup cols="1">
98           <colspec colname="c1" colwidth="100*"/>
99           <tbody>
100             <row>
101               <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438199_pgfId-1298902" xreflabel=""/>This command must be run on the MGS.</para></entry>
102             </row>
103           </tbody>
104         </tgroup>
105       </informaltable>
106       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298903" xreflabel=""/>In this example, file system lustre has three nodes, lustre-MDT0000, lustre-OST0000, and lustre-OST0001.</para>
107       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298904" xreflabel=""/>cfs21:/tmp# cat /proc/fs/lustre/mgs/MGS/live/* 
108 <anchor xml:id="dbdoclet.50438199_pgfId-1298905" xreflabel=""/>fsname: lustre 
109 <anchor xml:id="dbdoclet.50438199_pgfId-1298906" xreflabel=""/>flags: 0x0     gen: 26 
110 <anchor xml:id="dbdoclet.50438199_pgfId-1298907" xreflabel=""/>lustre-MDT0000 
111 <anchor xml:id="dbdoclet.50438199_pgfId-1298908" xreflabel=""/>lustre-OST0000 
112 <anchor xml:id="dbdoclet.50438199_pgfId-1298909" xreflabel=""/>lustre-OST0001 
113 </screen>
114       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298910" xreflabel=""/>To get the names of all OSTs, run this command on the MDS:</para>
115       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298911" xreflabel=""/># cat /proc/fs/lustre/lov/&lt;fsname&gt;-mdtlov/target_obd 
116 </screen>
117       <informaltable frame="none">
118         <tgroup cols="1">
119           <colspec colname="c1" colwidth="100*"/>
120           <tbody>
121             <row>
122               <entry><para><emphasis role="bold">Note -</emphasis><anchor xml:id="dbdoclet.50438199_pgfId-1298912" xreflabel=""/>This command must be run on the MDS.</para></entry>
123             </row>
124           </tbody>
125         </tgroup>
126       </informaltable>
127       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298913" xreflabel=""/>In this example, there are two OSTs, lustre-OST0000 and lustre-OST0001, which are both active.</para>
128       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298914" xreflabel=""/>cfs21:/tmp# cat /proc/fs/lustre/lov/lustre-mdtlov/target_obd 
129 <anchor xml:id="dbdoclet.50438199_pgfId-1298915" xreflabel=""/>0: lustre-OST0000_UUID ACTIVE 
130 <anchor xml:id="dbdoclet.50438199_pgfId-1298916" xreflabel=""/>1: lustre-OST0001_UUID ACTIVE 
131 </screen>
132     </section>
133     <section remap="h2">
134       <title>14.3 <anchor xml:id="dbdoclet.50438199_26070" xreflabel=""/>Mounting a Server Without <anchor xml:id="dbdoclet.50438199_marker-1298918" xreflabel=""/>Lustre Service</title>
135       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298920" xreflabel=""/>If you are using a combined MGS/MDT, but you only want to start the MGS and not the MDT, run this command:</para>
136       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298921" xreflabel=""/>mount -t lustre &lt;MDT partition&gt; -o nosvc &lt;mount point&gt;
137 </screen>
138       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298922" xreflabel=""/>The &lt;MDT partition&gt; variable is the combined MGS/MDT.</para>
139       <para><anchor xml:id="dbdoclet.50438199_pgfId-1298923" xreflabel=""/>In this example, the combined MGS/MDT is testfs-MDT0000 and the mount point is mnt/test/mdt.</para>
140       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298924" xreflabel=""/>$ mount -t lustre -L testfs-MDT0000 -o nosvc /mnt/test/mdt
141 </screen>
142     </section>
143     <section remap="h2">
144       <title>14.4 <anchor xml:id="dbdoclet.50438199_54623" xreflabel=""/>Regenerating Lustre <anchor xml:id="dbdoclet.50438199_marker-1305736" xreflabel=""/>Configuration Logs</title>
145       <para><anchor xml:id="dbdoclet.50438199_pgfId-1304951" xreflabel=""/>If the Lustre system’s configuration logs are in a state where the file system cannot be started, use the writeconf command to erase them. After the writeconf command is run and the servers restart, the configuration logs are re-generated and stored on the MGS (as in a new file system).</para>
146       <para><anchor xml:id="dbdoclet.50438199_pgfId-1304970" xreflabel=""/>You should only use the writeconf command if:</para>
147       <itemizedlist><listitem>
148           <para><anchor xml:id="dbdoclet.50438199_pgfId-1304971" xreflabel=""/> The configuration logs are in a state where the file system cannot start</para>
149         </listitem>
150 <listitem>
151           <para> </para>
152         </listitem>
153 <listitem>
154           <para><anchor xml:id="dbdoclet.50438199_pgfId-1304972" xreflabel=""/> A server NID is being changed</para>
155         </listitem>
156 <listitem>
157           <para> </para>
158         </listitem>
159 </itemizedlist>
160       <para><anchor xml:id="dbdoclet.50438199_pgfId-1304973" xreflabel=""/>The writeconf command is destructive to some configuration items (i.e., OST pools information and items set via conf_param), and should be used with caution. To avoid problems:</para>
161       <itemizedlist><listitem>
162           <para><anchor xml:id="dbdoclet.50438199_pgfId-1304974" xreflabel=""/> Shut down the file system before running the writeconf command</para>
163         </listitem>
164 <listitem>
165           <para> </para>
166         </listitem>
167 <listitem>
168           <para><anchor xml:id="dbdoclet.50438199_pgfId-1304975" xreflabel=""/> Run the writeconf command on all servers (MDT first, then OSTs)</para>
169         </listitem>
170 <listitem>
171           <para> </para>
172         </listitem>
173 <listitem>
174           <para><anchor xml:id="dbdoclet.50438199_pgfId-1306391" xreflabel=""/> Start the file system in this order:</para>
175         </listitem>
176 <listitem>
177           <itemizedlist><listitem>
178               <para><anchor xml:id="dbdoclet.50438199_pgfId-1306392" xreflabel=""/> MGS (or the combined MGS/MDT)</para>
179             </listitem>
180 <listitem>
181               <para> </para>
182             </listitem>
183 <listitem>
184               <para><anchor xml:id="dbdoclet.50438199_pgfId-1306393" xreflabel=""/> MDT</para>
185             </listitem>
186 <listitem>
187               <para> </para>
188             </listitem>
189 <listitem>
190               <para><anchor xml:id="dbdoclet.50438199_pgfId-1306394" xreflabel=""/> OSTs</para>
191             </listitem>
192 <listitem>
193               <para> </para>
194             </listitem>
195 <listitem>
196               <para><anchor xml:id="dbdoclet.50438199_pgfId-1304977" xreflabel=""/> Lustre clients</para>
197             </listitem>
198 <listitem>
199               <para> </para>
200             </listitem>
201 </itemizedlist>
202         </listitem>
203 </itemizedlist>
204       <informaltable frame="none">
205         <tgroup cols="2">
206           <colspec colname="c1" colwidth="5*"/>
207           <colspec colname="c2" colwidth="95*"/>
208           
209           
210           <tbody>
211             <row>
212               <entry><para><inlinemediaobject><imageobject role="html">
213                       <imagedata fileref="./shared/caution.gif" scalefit="1"/>
214                     </imageobject>
215 <imageobject role="fo">
216                       <imagedata contentdepth="100%" contentwidth="" depth="" fileref="./shared/caution.gif" scalefit="1" width="100%"/>
217                     </imageobject>
218 </inlinemediaobject></para></entry>
219               <entry><para><emphasis role="bold">Caution -</emphasis><anchor xml:id="dbdoclet.50438199_pgfId-1306408" xreflabel=""/>The OST pools feature enables a group of OSTs to be named for file striping purposes. If you use OST pools, be aware that running the writeconf command erases <emphasis role="bold">all</emphasis> pools information (as well as any other parameters set via lctl conf_param). We recommend that the pools definitions (and conf_param settings) be executed via a script, so they can be reproduced easily after a writeconf is performed.</para></entry>
220             </row>
221           </tbody>
222         </tgroup>
223       </informaltable>
224        <para><anchor xml:id="dbdoclet.50438199_pgfId-1303394" xreflabel=""/>To regenerate Lustre’s system configuration logs:</para>
225       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305772" xreflabel=""/> 1. Shut down the file system in this order.</para>
226       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305773" xreflabel=""/>a. Unmount the clients.</para>
227       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305774" xreflabel=""/>b. Unmount the MDT.</para>
228       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305775" xreflabel=""/>c. Unmount all OSTs.</para>
229       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305776" xreflabel=""/> 2. Make sure the the MDT and OST devices are available.</para>
230       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305777" xreflabel=""/> 3. Run the writeconf command on all servers.</para>
231       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305778" xreflabel=""/>Run writeconf on the MDT first, and then the OSTs.</para>
232       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305779" xreflabel=""/>a. On the MDT, run:</para>
233       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305780" xreflabel=""/>&lt;mdt node&gt;$ tunefs.lustre --writeconf &lt;device&gt;
234 </screen>
235       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305781" xreflabel=""/>b. On each OST, run:</para>
236       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305782" xreflabel=""/>&lt;ost node&gt;$ tunefs.lustre --writeconf &lt;device&gt;
237 </screen>
238       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305783" xreflabel=""/> 4. Restart the file system in this order.</para>
239       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305784" xreflabel=""/>a. Mount the MGS (or the combined MGS/MDT).</para>
240       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305785" xreflabel=""/>b. Mount the MDT.</para>
241       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305787" xreflabel=""/>c. Mount the OSTs.</para>
242       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305811" xreflabel=""/>d. Mount the clients.</para>
243       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305788" xreflabel=""/>After the writeconf command is run, the configuration logs are re-generated as servers restart.</para>
244     </section>
245     <section remap="h2">
246       <title>14.5 <anchor xml:id="dbdoclet.50438199_31353" xreflabel=""/>Changing a <anchor xml:id="dbdoclet.50438199_marker-1305737" xreflabel=""/>Server NID</title>
247       <para><anchor xml:id="dbdoclet.50438199_pgfId-1303485" xreflabel=""/>If you need to change the NID on the MDT or an OST, run the writeconf command to erase Lustre configuration information (including server NIDs), and then re-generate the system configuration using updated server NIDs.</para>
248       <para><anchor xml:id="dbdoclet.50438199_pgfId-1303612" xreflabel=""/>Change a server NID in these situations:</para>
249       <itemizedlist><listitem>
250           <para><anchor xml:id="dbdoclet.50438199_pgfId-1303524" xreflabel=""/> New server hardware is added to the file system, and the MDS or an OSS is being moved to the new machine</para>
251         </listitem>
252 <listitem>
253           <para> </para>
254         </listitem>
255 <listitem>
256           <para><anchor xml:id="dbdoclet.50438199_pgfId-1303542" xreflabel=""/> New network card is installed in the server</para>
257         </listitem>
258 <listitem>
259           <para> </para>
260         </listitem>
261 <listitem>
262           <para><anchor xml:id="dbdoclet.50438199_pgfId-1303548" xreflabel=""/> You want to reassign IP addresses</para>
263         </listitem>
264 <listitem>
265           <para> </para>
266         </listitem>
267 </itemizedlist>
268       <para><anchor xml:id="dbdoclet.50438199_pgfId-1303474" xreflabel=""/><anchor xml:id="dbdoclet.50438199_DDE_LINK1" xreflabel=""/>To change a server NID:</para>
269       <para><anchor xml:id="dbdoclet.50438199_pgfId-1303460" xreflabel=""/> 1. Update the LNET configuration in the /etc/modprobe.conf file so the list of server NIDs (lctl list_nids) is correct.</para>
270       <para><anchor xml:id="dbdoclet.50438199_pgfId-1304468" xreflabel=""/>The lctl list_nids command indicates which network(s) are configured to work with Lustre.</para>
271       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305816" xreflabel=""/> 2. Shut down the file system in this order.</para>
272       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305817" xreflabel=""/>a. Unmount the clients.</para>
273       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305818" xreflabel=""/>b. Unmount the MDT.</para>
274       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305819" xreflabel=""/>c. Unmount all OSTs.</para>
275       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305820" xreflabel=""/> 3. Run the writeconf command on all servers.</para>
276       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305821" xreflabel=""/>Run writeconf on the MDT first, and then the OSTs.</para>
277       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305822" xreflabel=""/>a. On the MDT, run:</para>
278       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305823" xreflabel=""/>&lt;mdt node&gt;$ tunefs.lustre --writeconf &lt;device&gt;
279 </screen>
280       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305824" xreflabel=""/>b. On each OST, run:</para>
281       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305825" xreflabel=""/>&lt;ost node&gt;$ tunefs.lustre --writeconf &lt;device&gt;
282 </screen>
283       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305826" xreflabel=""/>c. If the NID on the MGS was changed, communicate the new MGS location to each server. Run:</para>
284       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305827" xreflabel=""/>tunefs.lustre --erase-param --mgsnode=&lt;new_nid(s)&gt; --writeconf /dev/..
285 </screen>
286       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305828" xreflabel=""/> 4. Restart the file system in this order.</para>
287       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305829" xreflabel=""/>a. Mount the MGS (or the combined MGS/MDT).</para>
288       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305830" xreflabel=""/>b. Mount the MDT.</para>
289       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305831" xreflabel=""/>c. Mount the OSTs.</para>
290       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305832" xreflabel=""/>d. Mount the clients.</para>
291       <para><anchor xml:id="dbdoclet.50438199_pgfId-1305833" xreflabel=""/>After the writeconf command is run, the configuration logs are re-generated as servers restart, and server NIDs in the updated list_nids file are used.</para>
292     </section>
293     <section remap="h2">
294       <title>14.6 <anchor xml:id="dbdoclet.50438199_22527" xreflabel=""/>Adding a New <anchor xml:id="dbdoclet.50438199_marker-1306353" xreflabel=""/>OST to a Lustre File System</title>
295       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306355" xreflabel=""/>To add an OST to existing Lustre file system:</para>
296       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306356" xreflabel=""/> 1. Add a new OST by passing on the following commands, run:</para>
297       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1306357" xreflabel=""/>$ mkfs.lustre --fsname=spfs --ost --mgsnode=mds16@tcp0 /dev/sda
298 <anchor xml:id="dbdoclet.50438199_pgfId-1306358" xreflabel=""/>$ mkdir -p /mnt/test/ost0
299 <anchor xml:id="dbdoclet.50438199_pgfId-1306359" xreflabel=""/>$ mount -t lustre /dev/sda /mnt/test/ost0
300 </screen>
301       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306360" xreflabel=""/> 2. Migrate the data (possibly).</para>
302       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306361" xreflabel=""/>The file system is quite unbalanced when new empty OSTs are added. New file creations are automatically balanced. If this is a scratch file system or files are pruned at a regular interval, then no further work may be needed.</para>
303       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306362" xreflabel=""/>New files being created will preferentially be placed on the empty OST. As old files are deleted, they will release space on the old OST.</para>
304       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306363" xreflabel=""/>Files existing prior to the expansion can optionally be rebalanced with an in-place copy, which can be done with a simple script. The basic method is to copy existing files to a temporary file, then move the temp file over the old one. This should not be attempted with files which are currently being written to by users or applications. This operation redistributes the stripes over the entire set of OSTs.</para>
305       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306364" xreflabel=""/>For example, to rebalance all files within /mnt/lustre/dir, enter:</para>
306       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1306365" xreflabel=""/>lfs_migrate /mnt/lustre/file
307 </screen>
308       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306366" xreflabel=""/>To migrate files within the /test filesystem on OST0004 that are larger than 4GB in size, enter:</para>
309       <screen><anchor xml:id="dbdoclet.50438199_pgfId-1306367" xreflabel=""/>lfs find /test -obd test-OST0004 -size +4G | lfs_migrate -y
310 </screen>
311       <para><anchor xml:id="dbdoclet.50438199_pgfId-1306368" xreflabel=""/>See <link xl:href="UserUtilities_HTML.html#50438206_42260">lfs_migrate</link> for more details.</para>
312     </section>
313     <section remap="h2">
314       <title>14.7 <anchor xml:id="dbdoclet.50438199_14978" xreflabel=""/>Removing<anchor xml:id="dbdoclet.50438199_marker-1298976" xreflabel=""/> and Restoring OSTs</title>
315       <para><anchor xml:id="dbdoclet.50438199_pgfId-1304098" xreflabel=""/>OSTs can be removed from and restored to a Lustre file system. Currently in Lustre, removing an OST really means that the OST is â€˜deactivated’ in the file system, not permanently removed. A removed OST still appears in the file system; do not create a new OST with the same name.</para>
316       <para><anchor xml:id="dbdoclet.50438199_pgfId-1304099" xreflabel=""/>You may want to remove (deactivate) an OST and prevent new files from being written to it in several situations:</para>
317       <itemizedlist><listitem>
318           <para><anchor xml:id="dbdoclet.50438199_pgfId-1304100" xreflabel=""/> Hard drive has failed and a RAID resync/rebuild is underway</para>
319         </listitem>
320 <listitem>
321           <para> </para>
322         </listitem>
323 <listitem>
324           <para><anchor xml:id="dbdoclet.50438199_pgfId-1304101" xreflabel=""/> OST is nearing its space capacity</para>
325         </listitem>
326 <listitem>
327           <para> </para>
328         </listitem>
329 </itemizedlist>
330       <section remap="h3">
331         <title><anchor xml:id="dbdoclet.50438199_pgfId-1298979" xreflabel=""/>14.7.1 Removing an OST from the File System</title>
332         <para><anchor xml:id="dbdoclet.50438199_pgfId-1306722" xreflabel=""/>OSTs can be removed from a Lustre file system. Currently in Lustre, removing an OST actually means that the OST is &apos;deactivated&apos; from the file system, not permanently removed. A removed OST still appears in the device listing; you should not normally create a new OST with the same name.</para>
333         <para><anchor xml:id="dbdoclet.50438199_pgfId-1306724" xreflabel=""/>You may want to deactivate an OST and prevent new files from being written to it in several situations:</para>
334         <itemizedlist><listitem>
335             <para><anchor xml:id="dbdoclet.50438199_pgfId-1306725" xreflabel=""/> OST is nearing its space capacity</para>
336           </listitem>
337 <listitem>
338             <para> </para>
339           </listitem>
340 <listitem>
341             <para><anchor xml:id="dbdoclet.50438199_pgfId-1306726" xreflabel=""/> Hard drive has failed and a RAID resync/rebuild is underway</para>
342           </listitem>
343 <listitem>
344             <para> </para>
345           </listitem>
346 <listitem>
347             <para><anchor xml:id="dbdoclet.50438199_pgfId-1306727" xreflabel=""/> OST storage has failed permanently</para>
348           </listitem>
349 <listitem>
350             <para> </para>
351           </listitem>
352 </itemizedlist>
353         <para><anchor xml:id="dbdoclet.50438199_pgfId-1306729" xreflabel=""/>When removing an OST, remember that the MDT does not communicate directly with OSTs. Rather, each OST has a corresponding OSC which communicates with the MDT. It is necessary to determine the device number of the OSC that corresponds to the OST. Then, you use this device number to deactivate the OSC on the MDT.</para>
354         <para><anchor xml:id="dbdoclet.50438199_pgfId-1298981" xreflabel=""/>To remove an OST from the file system:</para>
355         <para><anchor xml:id="dbdoclet.50438199_pgfId-1298982" xreflabel=""/> 1. For the OST to be removed, determine the device number of the corresponding OSC on the MDT.</para>
356         <para><anchor xml:id="dbdoclet.50438199_pgfId-1298983" xreflabel=""/>a. List all OSCs on the node, along with their device numbers. Run:</para>
357         <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298984" xreflabel=""/>lctldl|grep &quot; osc &quot;
358 </screen>
359         <para><anchor xml:id="dbdoclet.50438199_pgfId-1298985" xreflabel=""/>This is sample lctldl|grep</para>
360       </section>
361     </section>
362   </section>
363 </chapter>