<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.lustre.org/index.php?action=history&amp;feed=atom&amp;title=Lustre_OST_MDT_Removal</id>
	<title>Lustre OST MDT Removal - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.lustre.org/index.php?action=history&amp;feed=atom&amp;title=Lustre_OST_MDT_Removal"/>
	<link rel="alternate" type="text/html" href="http://wiki.lustre.org/index.php?title=Lustre_OST_MDT_Removal&amp;action=history"/>
	<updated>2026-08-10T07:01:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>http://wiki.lustre.org/index.php?title=Lustre_OST_MDT_Removal&amp;diff=5572&amp;oldid=prev</id>
		<title>Elliswilson: Created page with &quot;== Lustre OST and MDT Removal ==  This page covers deactivating and removing OSTs and MDTs from a Lustre filesystem. These are &#039;&#039;&#039;high-stakes operations&#039;&#039;&#039; — read the warnings carefully before proceeding.  For adding targets, see Lustre File System Expansion.  === Removing an OST ===  There are three scenarios: migrating data off a working OST, handling a permanently failed OST, and temporary deactivation.  ==== Scenario 1: Migrating Data Off a Working OST ====  Us...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.lustre.org/index.php?title=Lustre_OST_MDT_Removal&amp;diff=5572&amp;oldid=prev"/>
		<updated>2026-07-06T15:33:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Lustre OST and MDT Removal ==  This page covers deactivating and removing OSTs and MDTs from a Lustre filesystem. These are &amp;#039;&amp;#039;&amp;#039;high-stakes operations&amp;#039;&amp;#039;&amp;#039; — read the warnings carefully before proceeding.  For adding targets, see &lt;a href=&quot;/Lustre_File_System_Expansion&quot; title=&quot;Lustre File System Expansion&quot;&gt;Lustre File System Expansion&lt;/a&gt;.  === Removing an OST ===  There are three scenarios: migrating data off a working OST, handling a permanently failed OST, and temporary deactivation.  ==== Scenario 1: Migrating Data Off a Working OST ====  Us...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Lustre OST and MDT Removal ==&lt;br /&gt;
&lt;br /&gt;
This page covers deactivating and removing OSTs and MDTs from a&lt;br /&gt;
Lustre filesystem. These are &amp;#039;&amp;#039;&amp;#039;high-stakes operations&amp;#039;&amp;#039;&amp;#039; — read&lt;br /&gt;
the warnings carefully before proceeding.&lt;br /&gt;
&lt;br /&gt;
For adding targets, see [[Lustre File System Expansion]].&lt;br /&gt;
&lt;br /&gt;
=== Removing an OST ===&lt;br /&gt;
&lt;br /&gt;
There are three scenarios: migrating data off a working OST,&lt;br /&gt;
handling a permanently failed OST, and temporary deactivation.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Migrating Data Off a Working OST ====&lt;br /&gt;
&lt;br /&gt;
Use this when you want to decommission an OST gracefully.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 1: Disable new file creation on the OST.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Run on &amp;#039;&amp;#039;&amp;#039;all MDS nodes&amp;#039;&amp;#039;&amp;#039; (important — if you have DNE, do this&lt;br /&gt;
on every MDS):&lt;br /&gt;
&lt;br /&gt;
 lctl set_param osp.testfs-OST0004-osc-MDT*.max_create_count=0&lt;br /&gt;
&lt;br /&gt;
To make it persistent:&lt;br /&gt;
&lt;br /&gt;
 lctl set_param -P osp.testfs-OST0004-osc-MDT*.max_create_count=0&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 2: Migrate files off the OST.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 # Find and migrate all files on the OST:&lt;br /&gt;
 lfs find --ost testfs-OST0004 /mnt/lustre | lfs_migrate -y&lt;br /&gt;
&lt;br /&gt;
 # For large filesystems, migrate in batches:&lt;br /&gt;
 lfs find --ost testfs-OST0004 -size +1G /mnt/lustre | lfs_migrate -y&lt;br /&gt;
 lfs find --ost testfs-OST0004 /mnt/lustre | lfs_migrate -y&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Warning:&amp;#039;&amp;#039;&amp;#039; Do NOT deactivate the OST on clients during migration.&lt;br /&gt;
Client-side deactivation causes I/O errors and migration will fail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 3: Verify all files are migrated.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 lfs find --ost testfs-OST0004 /mnt/lustre | wc -l&lt;br /&gt;
&lt;br /&gt;
This should return 0. If not, repeat the migration.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 4: Permanently deactivate the OST.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
On the MGS:&lt;br /&gt;
&lt;br /&gt;
 # Lustre 2.16+:&lt;br /&gt;
 lctl del_ost --target testfs-OST0004&lt;br /&gt;
&lt;br /&gt;
 # Older versions:&lt;br /&gt;
 lctl conf_param testfs-OST0004.osc.active=0&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 5: Unmount and (optionally) remove the OST device.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Permanently Failed OST ====&lt;br /&gt;
&lt;br /&gt;
If an OST has failed and cannot be recovered:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 1: Identify files with data on the failed OST.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 lfs find --ost testfs-OST0004 -print0 /mnt/lustre &amp;gt; /tmp/affected_files&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 2: Delete or restore affected files.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Files with data on the failed OST will return I/O errors. You must&lt;br /&gt;
delete them or restore from backup:&lt;br /&gt;
&lt;br /&gt;
 # Delete affected files:&lt;br /&gt;
 cat /tmp/affected_files | xargs -0 -n 1 unlink&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 3: Permanently deactivate the OST.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
On the MGS:&lt;br /&gt;
&lt;br /&gt;
 lctl conf_param testfs-OST0004.osc.active=0&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: Temporary OST Deactivation ====&lt;br /&gt;
&lt;br /&gt;
To temporarily take an OST offline for maintenance:&lt;br /&gt;
&lt;br /&gt;
 # On each client (temporary, resets on remount):&lt;br /&gt;
 lctl set_param osc.testfs-OST0004-*.active=0&lt;br /&gt;
&lt;br /&gt;
 # On MDS (prevents new allocations):&lt;br /&gt;
 lctl set_param osp.testfs-OST0004-osc-MDT*.max_create_count=0&lt;br /&gt;
&lt;br /&gt;
To bring it back:&lt;br /&gt;
&lt;br /&gt;
 # On MDS:&lt;br /&gt;
 lctl set_param osp.testfs-OST0004-osc-MDT*.max_create_count=20000&lt;br /&gt;
&lt;br /&gt;
 # On each client:&lt;br /&gt;
 lctl set_param osc.testfs-OST0004-*.active=1&lt;br /&gt;
&lt;br /&gt;
==== Returning a Permanently Deactivated OST to Service ====&lt;br /&gt;
&lt;br /&gt;
 # On MGS:&lt;br /&gt;
 lctl conf_param testfs-OST0004.osc.active=1&lt;br /&gt;
&lt;br /&gt;
=== Removing an MDT ===&lt;br /&gt;
&lt;br /&gt;
Removing an MDT is more complex than removing an OST because it&lt;br /&gt;
contains namespace data (directories, filenames, permissions).&lt;br /&gt;
&lt;br /&gt;
==== If the MDT Is Available ====&lt;br /&gt;
&lt;br /&gt;
You have two options, depending on whether you want to &amp;#039;&amp;#039;&amp;#039;keep&amp;#039;&amp;#039;&amp;#039; or&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;discard&amp;#039;&amp;#039;&amp;#039; the data currently stored under the MDT you are removing.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Option A (recommended): Migrate directories off the MDT, then remove it.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This preserves your data. The directory inodes — and the files within&lt;br /&gt;
them — are moved to another MDT, leaving the target MDT empty so it can&lt;br /&gt;
be safely deactivated. This is the approach documented in the Lustre&lt;br /&gt;
Operations Manual for removing an MDT, and it avoids the data loss that&lt;br /&gt;
&amp;lt;code&amp;gt;rm -r&amp;lt;/code&amp;gt; would cause.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 1: Find the directories whose inodes live on the MDT to be removed&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(for example, MDT index 3):&lt;br /&gt;
&lt;br /&gt;
 # Show which MDT currently holds a given directory:&lt;br /&gt;
 lfs getdirstripe --mdt-index /mnt/lustre/some_directory&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 2: Migrate each such directory to a surviving MDT&amp;#039;&amp;#039;&amp;#039; (for&lt;br /&gt;
example, MDT0000). Migration is recursive by default, moving the&lt;br /&gt;
directory together with all subdirectories and inodes beneath it:&lt;br /&gt;
&lt;br /&gt;
 lfs migrate -m 0 /mnt/lustre/some_directory&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 3: Verify the directory and its files now report the new MDT index.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 lfs getdirstripe --mdt-index /mnt/lustre/some_directory&lt;br /&gt;
 lfs getstripe --mdt-index /mnt/lustre/some_directory/*&lt;br /&gt;
&lt;br /&gt;
Repeat until no directories or inodes remain on the MDT being removed.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Migration caveats&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
* Only the &amp;#039;&amp;#039;&amp;#039;root user&amp;#039;&amp;#039;&amp;#039; can migrate directories.&lt;br /&gt;
* Migration operates on &amp;#039;&amp;#039;&amp;#039;whole directories&amp;#039;&amp;#039;&amp;#039;. Migrating or restriping &amp;#039;&amp;#039;striped&amp;#039;&amp;#039; directories requires Lustre 2.12 or later.&lt;br /&gt;
* Migration &amp;#039;&amp;#039;&amp;#039;cannot be interrupted&amp;#039;&amp;#039;&amp;#039; once started, although the directory and its files remain accessible during the operation.&lt;br /&gt;
* Each migrated file receives a &amp;#039;&amp;#039;&amp;#039;new FID&amp;#039;&amp;#039;&amp;#039; and therefore reports a new inode number to userspace. Tools that identify files by inode number (backup/archive tools, NFS, Samba) may treat migrated files as new. If the filesystem is re-exported over NFS, cached stale file handles can make files temporarily inaccessible; restart the NFS service (and possibly the clients) to clear them.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Data-on-MDT (DoM)&amp;#039;&amp;#039;&amp;#039; files cannot be migrated between MDTs directly. First migrate them to a non-DoM layout, then migrate the inodes.&lt;br /&gt;
* Files that are currently open or have been archived by HSM will fail to migrate; rerun the same command once they are available.&lt;br /&gt;
* The root directory always resides on &amp;#039;&amp;#039;&amp;#039;MDT0000&amp;#039;&amp;#039;&amp;#039;, so MDT0000 itself cannot be emptied and removed by this procedure.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Step 4: Once the MDT is empty, deactivate it on the MGS.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 lctl conf_param testfs-MDT0003.mdc.active=0&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Option B: Delete the data on the MDT.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Use this &amp;#039;&amp;#039;&amp;#039;only&amp;#039;&amp;#039;&amp;#039; if you genuinely want to &amp;#039;&amp;#039;&amp;#039;destroy&amp;#039;&amp;#039;&amp;#039; everything&lt;br /&gt;
stored under that MDT. Unlike migration, &amp;lt;code&amp;gt;rm -r&amp;lt;/code&amp;gt; permanently&lt;br /&gt;
deletes the directories and every file beneath them — it empties the&lt;br /&gt;
MDT by throwing the data away, not by relocating it:&lt;br /&gt;
&lt;br /&gt;
 rm -r /mnt/lustre/directory_on_mdt&lt;br /&gt;
&lt;br /&gt;
Then deactivate the MDT on the MGS:&lt;br /&gt;
&lt;br /&gt;
 lctl conf_param testfs-MDT0003.mdc.active=0&lt;br /&gt;
&lt;br /&gt;
==== If the MDT Is Permanently Inaccessible ====&lt;br /&gt;
&lt;br /&gt;
Standard &amp;lt;code&amp;gt;rmdir&amp;lt;/code&amp;gt; will fail with I/O error for directories&lt;br /&gt;
on an inaccessible MDT. Use &amp;lt;code&amp;gt;lfs rm_entry&amp;lt;/code&amp;gt; instead:&lt;br /&gt;
&lt;br /&gt;
 lfs rm_entry /mnt/lustre/directory_on_failed_mdt&lt;br /&gt;
&lt;br /&gt;
Then mark the MDT as permanently inactive:&lt;br /&gt;
&lt;br /&gt;
 lctl conf_param testfs-MDT0003.mdc.active=0&lt;br /&gt;
&lt;br /&gt;
==== Check Which MDT Manages a Directory ====&lt;br /&gt;
&lt;br /&gt;
 lfs getstripe --mdt-index /mnt/lustre/some_directory&lt;br /&gt;
&lt;br /&gt;
==== Warning ====&lt;br /&gt;
&lt;br /&gt;
All files and directories below an inactive MDT become inaccessible&lt;br /&gt;
until the MDT is reactivated. Clients will receive &amp;lt;code&amp;gt;EIO&amp;lt;/code&amp;gt;&lt;br /&gt;
errors when accessing them.&lt;br /&gt;
&lt;br /&gt;
=== Important Warnings ===&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Do not use &amp;lt;code&amp;gt;lctl conf_param&amp;lt;/code&amp;gt; to deactivate a working OST&amp;#039;&amp;#039;&amp;#039; unless you intend it to be permanent. This immediately and permanently deactivates it on both the MDS and all clients.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Migrate data before deactivating.&amp;#039;&amp;#039;&amp;#039; Once an OST is deactivated on clients, files on it return I/O errors and cannot be migrated.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Free space/object counts&amp;#039;&amp;#039;&amp;#039; on a deactivated OST won&amp;#039;t decrease when files are deleted. Object destruction is deferred until the OST reconnects to the MDS.&lt;br /&gt;
* A permanently deactivated OST still appears in filesystem configuration until &amp;lt;code&amp;gt;writeconf&amp;lt;/code&amp;gt; is run or it is removed with &amp;lt;code&amp;gt;del_ost&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
&lt;br /&gt;
* [[Lustre File System Expansion]] — Adding MDTs and OSTs&lt;br /&gt;
* [[Handling Full OSTs]] — Managing full OSTs&lt;br /&gt;
* [[Lustre Configuration Log Management]] — writeconf, replace_nids&lt;/div&gt;</summary>
		<author><name>Elliswilson</name></author>
	</entry>
</feed>