Whamcloud - gitweb
ba8589bc26d552175585e701eb463cbf50b8df65
[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" xml:id='lustremaintenance'>
3     <info>
4         <title xml:id='lustremaintenance.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
8     <itemizedlist><listitem>
9             <para><xref linkend="dbdoclet.50438199_85142"/>Working with Inactive OSTs</para>
10         </listitem>
11         <listitem>
12             <para><xref linkend="dbdoclet.50438199_15240"/>Finding Nodes in the Lustre File System</para>
13         </listitem>
14         <listitem>
15             <para><xref linkend="dbdoclet.50438199_26070"/>Mounting a Server Without Lustre Service</para>
16         </listitem>
17         <listitem>
18             <para><xref linkend="dbdoclet.50438199_54623"/>Regenerating Lustre Configuration Logs</para>
19         </listitem>
20         <listitem>
21             <para><xref linkend="dbdoclet.50438199_31353"/>Changing a Server NID</para>
22         </listitem>
23         <listitem>
24             <para><xref linkend="dbdoclet.50438199_22527"/>Adding a New OST to a Lustre File System</para>
25         </listitem>
26         <listitem>
27             <para><xref linkend="dbdoclet.50438199_14978"/>Removing and Restoring OSTs</para>
28         </listitem>
29         <listitem>
30             <para><xref linkend="dbdoclet.50438199_77819"/>Aborting Recovery</para>
31         </listitem>
32         <listitem>
33             <para><xref linkend="dbdoclet.50438199_12607"/>Determining Which Machine is Serving an OST</para>
34         </listitem>
35         <listitem>
36             <para><xref linkend="dbdoclet.50438199_62333"/>Changing the Address of a Failover Node</para>
37         </listitem>
38         <listitem>
39             <para> </para>
40         </listitem>
41     </itemizedlist>
42     <section xml:id="dbdoclet.50438199_42877">
43         <title>14.1 <anchor xml:id="dbdoclet.50438199_85142" xreflabel=""/>Working with <anchor xml:id="dbdoclet.50438199_marker-1298888" xreflabel=""/>Inactive OSTs</title>
44         <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>
45         <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298891" xreflabel=""/>client&gt; mount -o exclude=testfs-OST0000 -t lustre uml1:/testfs\ /mnt/testfs
46             <anchor xml:id="dbdoclet.50438199_pgfId-1298892" xreflabel=""/>client&gt; cat /proc/fs/lustre/lov/testfs-clilov-*/target_obd
47         </screen>
48         <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>
49         <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298894" xreflabel=""/>lctl --device 7 activate
50         </screen>
51
52
53         <note>
54             <para>
55                 A colon-separated list can also be specified. For example, exclude=testfs-OST0000:testfs-OST0001.</para>
56         </note>
57
58         <section xml:id="dbdoclet.50438199_15240">
59             <title>14.2 Finding <anchor xml:id="dbdoclet.50438199_marker-1298897" xreflabel=""/>Nodes in the Lustre File System</title>
60             <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>
61             <para><anchor xml:id="dbdoclet.50438199_pgfId-1298900" xreflabel=""/>To get a list of all Lustre nodes, run this command on the MGS:</para>
62             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298901" xreflabel=""/># cat /proc/fs/lustre/mgs/MGS/live/*
63             </screen>
64             <note>
65                 <para>
66                     This command must be rund on the MGS.
67                 </para>
68             </note>
69
70             <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>
71             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298904" xreflabel=""/>cfs21:/tmp# cat /proc/fs/lustre/mgs/MGS/live/* 
72                 <anchor xml:id="dbdoclet.50438199_pgfId-1298905" xreflabel=""/>fsname: lustre 
73                 <anchor xml:id="dbdoclet.50438199_pgfId-1298906" xreflabel=""/>flags: 0x0     gen: 26 
74                 <anchor xml:id="dbdoclet.50438199_pgfId-1298907" xreflabel=""/>lustre-MDT0000 
75                 <anchor xml:id="dbdoclet.50438199_pgfId-1298908" xreflabel=""/>lustre-OST0000 
76                 <anchor xml:id="dbdoclet.50438199_pgfId-1298909" xreflabel=""/>lustre-OST0001 
77             </screen>
78             <para><anchor xml:id="dbdoclet.50438199_pgfId-1298910" xreflabel=""/>To get the names of all OSTs, run this command on the MDS:</para>
79             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298911" xreflabel=""/># cat /proc/fs/lustre/lov/&lt;fsname&gt;-mdtlov/target_obd 
80             </screen>
81             <note>
82                 <para>
83                     This command must be rund on the MDS.
84                 </para>
85             </note>
86
87             <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>
88             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298914" xreflabel=""/>cfs21:/tmp# cat /proc/fs/lustre/lov/lustre-mdtlov/target_obd 
89                 <anchor xml:id="dbdoclet.50438199_pgfId-1298915" xreflabel=""/>0: lustre-OST0000_UUID ACTIVE 
90                 <anchor xml:id="dbdoclet.50438199_pgfId-1298916" xreflabel=""/>1: lustre-OST0001_UUID ACTIVE 
91             </screen>
92         </section>
93         <section xml:id="dbdoclet.50438199_26070">
94             <title>14.3 Mounting a Server Without <anchor xml:id="dbdoclet.50438199_marker-1298918" xreflabel=""/>Lustre Service</title>
95             <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>
96             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298921" xreflabel=""/>mount -t lustre &lt;MDT partition&gt; -o nosvc &lt;mount point&gt;
97             </screen>
98             <para><anchor xml:id="dbdoclet.50438199_pgfId-1298922" xreflabel=""/>The &lt;MDT partition&gt; variable is the combined MGS/MDT.</para>
99             <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>
100             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298924" xreflabel=""/>$ mount -t lustre -L testfs-MDT0000 -o nosvc /mnt/test/mdt
101             </screen>
102         </section>
103         <section xml:id="dbdoclet.50438199_54623">
104             <title>14.4 Regenerating Lustre <anchor xml:id="dbdoclet.50438199_marker-1305736" xreflabel=""/>Configuration Logs</title>
105             <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>
106             <para><anchor xml:id="dbdoclet.50438199_pgfId-1304970" xreflabel=""/>You should only use the writeconf command if:</para>
107             <itemizedlist><listitem>
108                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1304971" xreflabel=""/> The configuration logs are in a state where the file system cannot start</para>
109                 </listitem>
110                 <listitem>
111                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1304972" xreflabel=""/> A server NID is being changed</para>
112                 </listitem>
113             </itemizedlist>
114             <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>
115             <itemizedlist><listitem>
116                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1304974" xreflabel=""/> Shut down the file system before running the writeconf command</para>
117                 </listitem>
118                 <listitem>
119                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1304975" xreflabel=""/> Run the writeconf command on all servers (MDT first, then OSTs)</para>
120                 </listitem>
121                 <listitem>
122                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1306391" xreflabel=""/> Start the file system in this order:</para>
123                 </listitem>
124                 <listitem>
125                     <orderedlist><listitem>
126                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1306392" xreflabel=""/> MGS (or the combined MGS/MDT)</para>
127                         </listitem>
128                         <listitem>
129                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1306393" xreflabel=""/> MDT</para>
130                         </listitem>
131                         <listitem>
132                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1306394" xreflabel=""/> OSTs</para>
133                         </listitem>
134                         <listitem>
135                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1304977" xreflabel=""/> Lustre clients</para>
136                         </listitem>
137                     </orderedlist>
138                 </listitem>
139             </itemizedlist>
140
141             <caution>
142                 <para>
143                     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>
144             </caution>
145
146             <para><anchor xml:id="dbdoclet.50438199_pgfId-1303394" xreflabel=""/>To regenerate Lustre's system configuration logs:</para>
147             <orderedlist><listitem>
148                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305772" xreflabel=""/>Shut down the file system in this order.</para>
149                     <orderedlist><listitem>
150                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305773" xreflabel=""/>Unmount the clients.</para>
151                             </listitem><listitem>
152                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305774" xreflabel=""/>Unmount the MDT.</para>
153                             </listitem><listitem>
154                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305775" xreflabel=""/>Unmount all OSTs.</para>
155                     </listitem></orderedlist>
156                     </listitem><listitem>
157                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305776" xreflabel=""/>Make sure the the MDT and OST devices are available.</para>
158                     </listitem><listitem>
159                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305777" xreflabel=""/>Run the writeconf command on all servers.</para>
160                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305778" xreflabel=""/>Run writeconf on the MDT first, and then the OSTs.</para>
161                     <orderedlist><listitem>
162                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305779" xreflabel=""/>On the MDT, run:</para>
163                             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305780" xreflabel=""/>&lt;mdt node&gt;$ tunefs.lustre --writeconf &lt;device&gt;
164                             </screen>
165                             </listitem><listitem>
166                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305781" xreflabel=""/>On each OST, run:</para>
167                             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305782" xreflabel=""/>&lt;ost node&gt;$ tunefs.lustre --writeconf &lt;device&gt;
168                             </screen>
169                     </listitem></orderedlist>
170                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305783" xreflabel=""/>Restart the file system in this order.</para>
171                     <orderedlist><listitem>
172                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305784" xreflabel=""/>Mount the MGS (or the combined MGS/MDT).</para>
173                             </listitem><listitem>
174                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305785" xreflabel=""/>Mount the MDT.</para>
175                             </listitem><listitem>
176                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305787" xreflabel=""/>Mount the OSTs.</para>
177                             </listitem><listitem>
178                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305811" xreflabel=""/>Mount the clients.</para>
179                     </listitem></orderedlist>
180                     <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>
181             </listitem></orderedlist>
182         </section>
183         <section xml:id="dbdoclet.50438199_31353">
184             <title>14.5 Changing a <anchor xml:id="dbdoclet.50438199_marker-1305737" xreflabel=""/>Server NID</title>
185             <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>
186             <para><anchor xml:id="dbdoclet.50438199_pgfId-1303612" xreflabel=""/>Change a server NID in these situations:</para>
187             <itemizedlist><listitem>
188                     <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>
189                 </listitem>
190                 <listitem>
191                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1303542" xreflabel=""/> New network card is installed in the server</para>
192                 </listitem>
193                 <listitem>
194                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1303548" xreflabel=""/> You want to reassign IP addresses</para>
195                 </listitem>
196             </itemizedlist>
197             <para><anchor xml:id="dbdoclet.50438199_pgfId-1303474" xreflabel=""/><anchor xml:id="dbdoclet.50438199_DDE_LINK1" xreflabel=""/>To change a server NID:</para>
198             <orderedlist><listitem>
199                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1303460" xreflabel=""/>Update the LNET configuration in the /etc/modprobe.conf file so the list of server NIDs (lctl list_nids) is correct.</para>
200                     <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>
201                     </listitem><listitem>
202                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305816" xreflabel=""/>Shut down the file system in this order.</para>
203                     <orderedlist><listitem>
204                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305817" xreflabel=""/>Unmount the clients.</para>
205                             </listitem><listitem>
206                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305818" xreflabel=""/>Unmount the MDT.</para>
207                             </listitem><listitem>
208                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305819" xreflabel=""/>Unmount all OSTs.</para>
209                     </listitem></orderedlist>
210                     </listitem><listitem>
211                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305820" xreflabel=""/>Run the writeconf command on all servers.</para>
212                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305821" xreflabel=""/>Run writeconf on the MDT first, and then the OSTs.</para>
213                     <orderedlist><listitem>
214                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305822" xreflabel=""/>On the MDT, run:</para>
215                             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305823" xreflabel=""/>&lt;mdt node&gt;$ tunefs.lustre --writeconf &lt;device&gt;
216                             </screen>
217                             </listitem><listitem>
218                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305824" xreflabel=""/>On each OST, run:</para>
219                             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305825" xreflabel=""/>&lt;ost node&gt;$ tunefs.lustre --writeconf &lt;device&gt;
220                             </screen>
221                             </listitem><listitem>
222                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305826" xreflabel=""/>If the NID on the MGS was changed, communicate the new MGS location to each server. Run:</para>
223                             <screen><anchor xml:id="dbdoclet.50438199_pgfId-1305827" xreflabel=""/>tunefs.lustre --erase-param --mgsnode=&lt;new_nid(s)&gt; --writeconf /dev/..
224                             </screen>
225                     </listitem></orderedlist>
226                     </listitem><listitem>
227                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1305828" xreflabel=""/>Restart the file system in this order.</para>
228                     <orderedlist><listitem>
229                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305829" xreflabel=""/>Mount the MGS (or the combined MGS/MDT).</para>
230                             </listitem><listitem>
231                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305830" xreflabel=""/>Mount the MDT.</para>
232                             </listitem><listitem>
233                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305831" xreflabel=""/>Mount the OSTs.</para>
234                             </listitem><listitem>
235                             <para><anchor xml:id="dbdoclet.50438199_pgfId-1305832" xreflabel=""/>Mount the clients.</para>
236                     </listitem></orderedlist>
237             </listitem></orderedlist>
238             <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>
239         </section>
240         <section xml:id="dbdoclet.50438199_22527">
241             <title>14.6 Adding a New <anchor xml:id="dbdoclet.50438199_marker-1306353" xreflabel=""/>OST to a Lustre File System</title>
242             <para><anchor xml:id="dbdoclet.50438199_pgfId-1306355" xreflabel=""/>To add an OST to existing Lustre file system:</para>
243             <orderedlist><listitem>
244                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1306356" xreflabel=""/> 1. Add a new OST by passing on the following commands, run:</para>
245                     <screen><anchor xml:id="dbdoclet.50438199_pgfId-1306357" xreflabel=""/>$ mkfs.lustre --fsname=spfs --ost --mgsnode=mds16@tcp0 /dev/sda
246                         <anchor xml:id="dbdoclet.50438199_pgfId-1306358" xreflabel=""/>$ mkdir -p /mnt/test/ost0
247                         <anchor xml:id="dbdoclet.50438199_pgfId-1306359" xreflabel=""/>$ mount -t lustre /dev/sda /mnt/test/ost0
248                     </screen>
249                     </listitem><listitem>
250                     <para><anchor xml:id="dbdoclet.50438199_pgfId-1306360" xreflabel=""/> 2. Migrate the data (possibly).</para>
251             </listitem></orderedlist>
252 <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>
253 <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>
254 <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>
255 <para><anchor xml:id="dbdoclet.50438199_pgfId-1306364" xreflabel=""/>For example, to rebalance all files within /mnt/lustre/dir, enter:</para>
256 <screen><anchor xml:id="dbdoclet.50438199_pgfId-1306365" xreflabel=""/>lfs_migrate /mnt/lustre/file
257 </screen>
258 <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>
259 <screen><anchor xml:id="dbdoclet.50438199_pgfId-1306367" xreflabel=""/>lfs find /test -obd test-OST0004 -size +4G | lfs_migrate -y
260 </screen>
261 <para><anchor xml:id="dbdoclet.50438199_pgfId-1306368" xreflabel=""/>See <xref linkend='userutilities'/> (lfs_migrate) for more details.</para>
262 </section>
263 <section xml:id="dbdoclet.50438199_14978">
264 <title>14.7 Removing and Restoring OSTs</title>
265 <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>
266 <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>
267 <itemizedlist><listitem>
268 <para><anchor xml:id="dbdoclet.50438199_pgfId-1304100" xreflabel=""/> Hard drive has failed and a RAID resync/rebuild is underway</para>
269 </listitem>
270 <listitem>
271 <para><anchor xml:id="dbdoclet.50438199_pgfId-1304101" xreflabel=""/> OST is nearing its space capacity</para>
272 </listitem>
273 </itemizedlist>
274 <section remap="h3">
275 <title><anchor xml:id="dbdoclet.50438199_pgfId-1298979" xreflabel=""/>14.7.1 Removing an OST from the File System</title>
276 <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>
277 <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>
278 <itemizedlist><listitem>
279 <para><anchor xml:id="dbdoclet.50438199_pgfId-1306725" xreflabel=""/> OST is nearing its space capacity</para>
280 </listitem>
281 <listitem>
282 <para><anchor xml:id="dbdoclet.50438199_pgfId-1306726" xreflabel=""/> Hard drive has failed and a RAID resync/rebuild is underway</para>
283 </listitem>
284 <listitem>
285 <para><anchor xml:id="dbdoclet.50438199_pgfId-1306727" xreflabel=""/> OST storage has failed permanently</para>
286 </listitem>
287 </itemizedlist>
288 <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>
289 <para><anchor xml:id="dbdoclet.50438199_pgfId-1298981" xreflabel=""/>To remove an OST from the file system:</para>
290
291 <orderedlist><listitem>
292 <para><anchor xml:id="dbdoclet.50438199_pgfId-1298982" xreflabel=""/>For the OST to be removed, determine the device number of the corresponding OSC on the MDT.</para>
293 <orderedlist><listitem>
294 <para> List all OSCs on the node, along with their device numbers. Run:</para>
295 <screen><anchor xml:id="dbdoclet.50438199_pgfId-1298984" xreflabel=""/>lctldl|grep &quot; osc &quot;
296 </screen>
297 <para><anchor xml:id="dbdoclet.50438199_pgfId-1298985" xreflabel=""/>This is sample lctldl|grep</para>
298 <screen>
299 11 UP osc lustre-OST-0000-osc-cac94211 4ea5b30f-6a8e-55a0-7519-2f20318ebdb4 5
300 12 UP osc lustre-OST-0001-osc-cac94211 4ea5b30f-6a8e-55a0-7519-2f20318ebdb4 5
301 13 IN osc lustre-OST-0000-osc lustre-MDT0000-mdtlov_UUID 5
302 14 UP osc lustre-OST-0001-osc lustre-MDT0000-mdtlov_UUID 5
303 </screen>
304 </listitem><listitem>
305 <para>Determine the device number of the OSC that corresponds to the OST to be removed.</para>
306 </listitem></orderedlist>
307 </listitem><listitem>
308
309 <para>Temporarily deactivate the OSC on the MDT. On the MDT, run: </para>
310
311 <screen>
312 $ mdt> lctl --device &gt;devno&lt; deactivate
313 </screen>
314 <para>
315 For example, based on the command output in Step 1, to deactivate device 13 (the MDT’s OSC for OST-0000), the command would be: 
316 </para>
317
318 <screen>
319 $ mdt> lctl --device 13 deactivate
320 </screen>
321
322 <para>
323 This marks the OST as inactive on the MDS, so no new objects are assigned to the OST. This does not prevent use of existing objects for reads or writes. 
324 </para>
325
326 <note><para>Do not deactivate the OST on the clients. Do so causes errors (EIOs), and the copy out to fail. </para></note>
327
328 <caution><para>Do not use lctl conf_param to deactivate the OST. It permanently sets a parameter in the file system configuration.</para></caution>
329
330 </listitem><listitem>
331 <para>
332 Discover all files that have objects residing on the deactivated OST.
333 </para>
334
335 <para>
336 Depending on whether the deactivated OST is available or not, the data from that OST may be migrated to other OSTs, or may need to be restored from backup.
337 </para>
338
339 <orderedlist><listitem>
340 <para>
341 If the OST is still online and available, find all files with objects on the deactivated OST, and copy them to other OSTs in the file system to:
342 </para>
343
344 <screen>
345 [client]# lfs find --obd &lt;OST UUID&gt; &lt;mount_point&gt; | lfs_migrate -y
346 </screen>
347
348 </listitem><listitem>
349 If the OST is no longer available, delete the files on that OST and restore them from backup:
350
351 <screen>
352 [client]# lfs find --obd &lt;OST UUID&gt; -print0 &lt;mount_point&gt; | \
353 tee /tmp/files_to_restore | xargs -0 -n 1 unlink
354 </screen>
355
356 The list of files that need to be restored from backup is stored in /tmp/files_to_restore. Restoring these files is beyond the scope of this document.
357
358 </listitem></orderedlist>
359 </listitem><listitem>
360 4. Deactivate the OST.
361
362 <orderedlist><listitem>
363 a. To temporarily disable the deactivated OST, enter:
364
365 <screen>
366 [client]# lctl set_param osc.&lt;fsname&gt;-&lt;OST name&gt;-*.active=0
367 </screen>
368
369 If there is expected to be a replacement OST in some short time (a few days), the OST can temporarily be deactivated on the clients:
370 Note - This setting is only temporary and will be reset if the clients or MDS are rebooted. It needs to be run on all clients.
371
372 </listitem><listitem>
373 b. To permanently disable the deactivated OST, enter:
374
375 <screen>
376 [mgs]# lctl conf_param {OST name}.osc.active=0
377 </screen>
378 </listitem></orderedlist>
379
380 If there is not expected to be a replacement for this OST in the near future, permanently deactivate the OST on all clients and the MDS:
381 Note - A removed OST still appears in the file system; do not create a new OST with the same name.
382 14.7.2 Backing Up OST Configuration Files
383
384 If the OST device is still accessible, then the Lustre configuration files on the OST should be backed up and saved for future use in order to avoid difficulties when a replacement OST is returned to service. These files rarely change, so they can and should be backed up while the OST is functional and accessible. If the deactivated OST is still available to mount (i.e. has not permanently failed or is unmountable due to severe corruption), an effort should be made to preserve these files.
385
386 <orderedlist><listitem>
387 1. Mount the OST filesystem.
388
389 <screen>
390 [oss]# mkdir -p /mnt/ost
391 [oss]# mount -t ldiskfs {ostdev} /mnt/ost
392 </screen>
393
394 </listitem><listitem>
395 2. Back up the OST configuration files.
396
397 <screen>
398 [oss]# tar cvf {ostname}.tar -C /mnt/ost last_rcvd \
399 CONFIGS/ O/0/LAST_ID
400 </screen>
401
402 </listitem><listitem>
403 3. Unmount the OST filesystem.
404
405 <screen>
406 [oss]# umount /mnt/ost
407 </screen>
408 </listitem></orderedlist>
409
410 14.7.3 Restoring OST Configuration Files
411
412 If the original OST is still available, it is best to follow the OST backup and restore procedure given in either Backing Up and Restoring an MDS or OST (Device Level), or Making a File-Level Backup of an OST File System and Restoring a File-Level Backup.
413
414 To replace an OST that was removed from service due to corruption or hardware failure, the file system needs to be formatted for Lustre, and the Lustre configuration should be restored, if available.
415
416 If the OST configuration files were not backed up, due to the OST file system being completely inaccessible, it is still possible to replace the failed OST with a new one at the same OST index.
417
418 <orderedlist><listitem>
419 1. Format the OST file system.
420
421 <screen>
422 [oss]# mkfs.lustre --ost --index {OST index} {other options} \
423 {newdev}
424 </screen>
425
426 </listitem><listitem>
427 2. Mount the OST filesystem.
428
429 <screen>
430 [oss]# mkdir /mnt/ost
431 [oss]# mount -t ldiskfs {newdev} /mnt/ost
432 </screen>
433
434 </listitem><listitem>
435 3. Restore the OST configuration files, if available.
436
437 <screen>
438 [oss]# tar xvf {ostname}.tar -C /mnt/ost
439 </screen>
440
441 </listitem><listitem>
442 4. Recreate the OST configuration files, if unavailable.
443
444 Follow the procedure in Fixing a Bad LAST_ID on an OST to recreate the LAST_ID file for this OST index. The last_rcvd file will be recreated when the OST is first mounted using the default parameters, which are normally correct for all file systems.
445
446 The CONFIGS/mountdata file is created by mkfs.lustre at format time, but has flags set that request it to register itself with the MGS. It is possible to copy these flags from another working OST (which should be the same):
447
448 <screen>
449 [oss2]# debugfs -c -R "dump CONFIGS/mountdata /tmp/ldd" \
450 {other_osdev}
451 [oss2]# scp /tmp/ldd oss:/tmp/ldd
452 [oss]# dd if=/tmp/ldd of=/mnt/ost/CONFIGS/mountdata bs=4 count=1 \
453 seek=5 skip=5
454 </screen>
455
456 </listitem><listitem>
457 5. Unmount the OST filesystem.
458
459 <screen>
460 [oss]# umount /mnt/ost
461 </screen>
462 </listitem></orderedlist>
463
464 14.7.4 Returning a Deactivated OST to Service
465
466 If the OST was permanently deactivated, it needs to be reactivated in the MGS configuration.
467
468 <screen>
469 [mgs]# lctl conf_param {OST name}.osc.active=1
470 </screen>
471
472 If the OST was temporarily deactivated, it needs to be reactivated on the MDS and clients.
473
474 <screen>
475 [mds]# lctl --device &lt;devno&gt; activate
476 [client]# lctl set_param osc.&lt;fsname&gt;-&lt;OST name&gt;-*.active=0
477 </screen>
478
479 14.8 Aborting Recovery
480
481 You can abort recovery with either the lctl utility or by mounting the target with the abort_recov option (mount -o abort_recov). When starting a target, run:
482
483 <screen>
484 $ mount -t lustre -L &lt;MDT name&gt; -o abort_recov &lt;mount_point&gt;
485 </screen>
486
487 Note - The recovery process is blocked until all OSTs are available.
488 14.9 Determining Which Machine is Serving an OST
489
490 In the course of administering a Lustre file system, you may need to determine which machine is serving a specific OST. It is not as simple as identifying the machine’s IP address, as IP is only one of several networking protocols that Lustre uses and, as such, LNET does not use IP addresses as node identifiers, but NIDs instead.
491
492 To identify the NID that is serving a specific OST, run one of the following commands on a client (you do not need to be a root user):
493
494 <screen>
495 client$ lctl get_param osc.${fsname}-${OSTname}*.ost_conn_uuid
496 </screen>
497
498 For example:
499
500 <screen>
501 client$ lctl get_param osc.*-OST0000*.ost_conn_uuid 
502 osc.lustre-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
503 </screen>
504
505 - OR -
506
507 <screen>
508 client$ lctl get_param osc.*.ost_conn_uuid 
509 osc.lustre-OST0000-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
510 osc.lustre-OST0001-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
511 osc.lustre-OST0002-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
512 osc.lustre-OST0003-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
513 osc.lustre-OST0004-osc-f1579000.ost_conn_uuid=192.168.20.1@tcp
514 </screen>
515
516 14.10 Changing the Address of a Failover Node
517
518 To change the address of a failover node (e.g, to use node X instead of node Y), run this command on the OSS/OST partition:
519
520 <screen>
521 tunefs.lustre --erase-params --failnode=&lt;NID&gt; &lt;device&gt; 
522 </screen>
523
524 </listitem></orderedlist>
525
526
527
528                     </section>
529                 </section>
530             </section>
531         </chapter>