LFS\_MIGRATE(1) Lustre User Utilities LFS\_MIGRATE(1)

# [NAME](#NAME)

lfs\_migrate - migrate files between Lustre OSTs

# [SYNOPSIS](#SYNOPSIS)

`lfs_migrate` \[**-A** \[**-C** *CAP*] \[**-M** *MIN\_FREE*] \[**-X** *MAX\_FREE ]]* \[**--cp**] \[**--dry-run**|**-n**] \[**--fid**|**-F** \[**--lustre-dir** *LUSTRE\_MOUNT\_POINT*]] \[**--help**|**-h**] \[**--no-rsync**|**--rsync**] \[**--pool**|**-p** *POOL*] \[**--quiet**|**-q**] \[**--restripe**|**-R**] \[**--stripe-count**|**-c** *STRIPE\_COUNT*] \[**--stripe-size**|**-S** *STRIPE\_SIZE ]* \[**--skip**|**-s**] \[**--verbose**|**-v**] \[**--yes**|**-y**] \[**-D**] \[**-0**] \[*FILE*|*FID*|*DIR*]*...*

# [DESCRIPTION](#DESCRIPTION)

**WARNING:** **lfs\_migrate** is scheduled for removal after Lustre 2.20. Please use [**lfs-migrate**(1)](/man/enterprise-packages/lustre/lfs-migrate.1) instead.

**lfs\_migrate** is a tool to assist migration of files between Lustre OSTs, possibly also restriping the files as it goes. It copies each specified file to a new file, verifies the file contents have not changed, and then replaces the original filename with the new file (either atomically via [**lfs-migrate**(1)](/man/enterprise-packages/lustre/lfs-migrate.1) on Lustre 2.5 and later, or [**mv**(1)](/man/enterprise-packages/lustre/mv.1) on older versions of Lustre). This allows balancing space usage between OSTs, moving files off OSTs that are starting to show hardware problems but are still functional, or OSTs that will be removed from the filesystem.

Files to be migrated can be specified as command-line arguments. If a directory is specified on the command-line then all files within that directory are migrated. If no files are specified on the command-line, then a list of files is read from the standard input, making **lfs\_migrate** suitable for use with [**lfs-find**(1)](/man/enterprise-packages/lustre/lfs-find.1) to locate files on specific OSTs and/or matching other file attributes, or any other tools that generate a list of files.

Any options and arguments not explicitly recognized by **lfs\_migrate** are passed through to the underlying **lfs migrate** command, see [**lfs-migrate**(1)](/man/enterprise-packages/lustre/lfs-migrate.1) and [**lfs-setstripe**(1)](/man/enterprise-packages/lustre/lfs-setstripe.1) for a complete list of options.

To maintain backward compatibility, the **-n** option is used by the script to indicate a dry-run (no modifications made), and is not passed to **lfs migrate** as the non-block option. To specify non-block, use the long option **--non-block**.

The current file allocation policies on MDS dictate where the new files are placed, taking into account whether specific OSTs have been disabled on the MDS via [**lctl**(8)](/man/enterprise-packages/lustre/lctl.8) (preventing new files from being allocated there), whether some OSTs are overly full (reducing the number of files placed on those OSTs), or if there is a specific default file striping for the target directory (potentially changing the stripe count, stripe size, OST pool, or OST index of a new file).

# [OPTIONS](#OPTIONS)

[**--cp**](#cp)

Force use of [**cp**(1)](/man/enterprise-packages/lustre/cp.1) to copy files instead of [**rsync**(1)](/man/enterprise-packages/lustre/rsync.1).

[**-n**, **--dry-run**](#n)

Only print the names of files to be migrated.

[**-D**](#D)

Do not use direct I/O to copy file contents.

[**-F**, **--fid**](#F)

FID(s) are provided from command line/stdin instead of file path(s). Option **--lustre-dir**=***LUSTRE\_MOUNT\_POINT*** *may be specified at the same time.*

[**--lustre-dir**=***LUSTRE\_MOUNT\_POINT***](#lustre-dir)

The mount point of Lustre file system on which FID(s) are when **--fid** is specified. If there is only one mounted Lustre file system, this option is not necessary. This option must be specified together with **--fid**.

[**-A**](#A)

Automatically determine the stripe count for the file, using the algorithm count = sqrt(filesize\_in\_GB) + 1. This option may not be specified at the same time as the **-c** or **-R** options.

[**-c**, **--stripe-countSTRIPE\_COUNT**](#c)

Restripe file using the specified *STRIPE\_COUNT*. This option may not be specified at the same time as the **-A** or **-R** options.

[**-C CAP**](#C)

When **-A** is set, limit the migrated file to use on each OST at most 1/*CAP* of the available space of the smallest OST. If this option is not set, a default value of 100 is used, limiting the object size to 1% of available space.

[**-h**, **--help**](#h)

Display usage message.

[**--no-rsync**](#no-rsync)

Do not fall back to using rsync if [**lfs-migrate**(1)](/man/enterprise-packages/lustre/lfs-migrate.1) fails. Cannot be used at the same time as **--rsync**.

[**-M**, **--min-freeMIN\_FREE**](#M)

When **-A** is set, only consider OSTs with free space greater than the *MIN\_FREE* value to be available for migration. The value is specified in KB. If this option is not set, a default of 256MB is used.

[**-p**, **--poolPOOL**](#p)

Migrate files to specified pool.

[**-q**, **--quiet**](#q)

Run quietly (don't print filenames or status).

[**--rsync**](#rsync)

Force rsync to be used instead of [**lfs-migrate**(1)](/man/enterprise-packages/lustre/lfs-migrate.1)**.** May not be used at the same time as **--no-rsync**.

[**-R**, **--restripe**](#R)

Restripe file using default directory striping instead of keeping striping. This option may not be specified at the same time as the **-A**, **-c**, or **-S** options. (these options are passed through to **lfs migrate**, and are therefore not listed here).

[**-s**, **--skip**](#s)

Skip file data comparison after migrate. Default is to compare migrated file against original to verify correctness.

[**-S**, **--stripe-sizeSTRIPE\_SIZE**](#S)

Restripe file using the specified stripe size. This option may not be specified at the same time as the **-R** option.

[**-v**, **--verbose**](#v)

Show verbose debug messages.

[**-X**, **--max-freeMAX\_FREE**](#X)

When **-A** is set, *MAX\_FREE* is the maximum amount of free space that can be considered available for the migration of the file on each OST. The value is specified in KB. This option is useful for testing, by simulating OSTs that are nearly full.

[**-y**, **--yes**](#y)

Answer 'y' to usage warning without prompt (--rsync only, use with caution).

**-0**

Input file names on stdin are separated by a null character.

# [NOTES](#NOTES)

In versions prior to 2.5, **lfs\_migrate** is **not** closely integrated with the MDS, and cannot determine whether a file is currently open and/or in-use by other applications or nodes. That makes it **UNSAFE** for use on files that might be modified by other applications, since the migrated file is only a copy of the current file. This will result in the old file becoming an open-unlinked file, and any modifications to that file will be lost.

# [EXAMPLES](#EXAMPLES)

To rebalance all files within */testfs/jobs/2011*:

```
# lfs_migrate /testfs/jobs/2011
```

To migrate files within the */testfs* filesystem on OST0004 (perhaps because it is much more full than other OSTs), larger than 4GB (because it is more efficient to migrate a few large files than many small ones), and older than two days (to avoid files that are in use) to use auto-restriping for these files, after disabling file creation on testfs-OST0004 (this is needed on all MDS nodes):

```
[   mds]# lctl set_param osp.testfs-OST0004*.max_create_count=0
[client]# lfs find /testfs -obd testfs-OST0004 -size +4G -mtime +2d | lfs_migrate -A
[   mds]# lctl set_param osp.testfs-OST0004*.max_create_count=20000
```

To use automatic restriping, and limit the object size per OST to 5% of current free space:

```
# lfs_migrate -A -C 20 /testfs/jobs/2011
```

# [AVAILABILITY](#AVAILABILITY)

**lfs\_migrate** is part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) filesystem package. Added in release 1.8.4.

# [SEE ALSO](#SEE_ALSO)

[**lfs**(1)](/man/enterprise-packages/lustre/lfs.1), [**lfs-migrate**(1)](/man/enterprise-packages/lustre/lfs-migrate.1)

2025-12-20 Lustre

---

Document: lfs_migrate(1) from lustre 2.17.59-r1 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
