LFS_MIGRATE(1)
π LFS_MIGRATE π
hi bestie π«Ά welcome to LFS_MIGRATE(1), one of the Lustre User Utilities. (yes it's a man page, yes the manual name is baked in at the top, don't worry, we already hugged it hello.)
πΈ NAME πΈ
lfs_migrate β migrate files between Lustre OSTs
β¨ 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 π¦
π¨ WARNING:lfs_migrateis scheduled for removal after Lustre 2.20. Please uselfs-migrate(1)instead. no cap, it's getting sunset, so start moving your habits over π
okay so lfs_migrate is the lil helper that assists migration of files between Lustre OSTs, and it can also restripe the files while it's at it. the whole vibe is: 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 β and it does that either atomically via lfs-migrate(1) on Lustre 2.5 and later, or with mv(1) on older versions of Lustre. that's the glow-up π
and why would you even do this? three iconic reasons, bestie:
- balancing space usage between OSTs,
- moving files off OSTs that are starting to show hardware problems but are still functional,
- or moving off OSTs that will be removed from the filesystem.
Files to be migrated can be specified as command-line arguments. if you point it at a directory on the command-line, then all files within that directory are migrated. and if you specify no files on the command-line at all? then a list of files is read from the standard input β which makes lfs_migrate perfect for use with lfs-find(1) to locate files on specific OSTs and/or matching other file attributes, or honestly with any other tool that generates a list of files. chef's kiss π§
Any options and arguments not explicitly recognized by lfs_migrate are passed through to the underlying lfs migrate command β so peep lfs-migrate(1) and lfs-setstripe(1) for a complete list of options.
here's a subtle lore drop for backward compatibility: the -n option is used by the script to mean dry-run (no modifications made), and is not passed to lfs migrate as the non-block option. so if you actually want non-block, you have to use the long option --non-block. yes really. write it down π
final lore: the current file allocation policies on MDS dictate where the new files are placed. and that takes into account:
- whether specific OSTs have been disabled on the MDS via
lctl(8)(which prevents new files from being allocated there), - whether some OSTs are overly full (which reduces the number of files placed on those OSTs),
- or whether there's a specific default file striping for the target directory β which can potentially change the stripe count, stripe size, OST pool, or OST index of a new file.
so it's giving main character MDS energy, and you're just along for the ride π
π₯ OPTIONS π₯
one bullet per option, every single one, no skips, periodt β¨
--cpβ Force use ofcp(1)to copy files instead ofrsync(1).-n,--dry-runβ Only print the names of files to be migrated. (nothing actually moves, it's just window shopping ποΈ)-Dβ Do not use direct I/O to copy file contents.-F,--fidβ FID(s) are provided from command line/stdin instead of file path(s). Option--lustre-dir=LUSTRE_MOUNT_POINTmay be specified at the same time.--lustre-dir=LUSTRE_MOUNT_POINTβ The mount point of Lustre file system on which FID(s) are when--fidis specified. If there is only one mounted Lustre file system, this option is not necessary. This option must be specified together with--fid(they're a package deal, don't separate them π).-Aβ Automatically determine the stripe count for the file, using the algorithmcount = sqrt(filesize_in_GB) + 1. This option may not be specified at the same time as the-cor-Roptions.-c,--stripe-countSTRIPE_COUNTβ Restripe file using the specifiedSTRIPE_COUNT. This option may not be specified at the same time as the-Aor-Roptions.-C CAPβ When-Ais set, limit the migrated file to use on each OST at most1/CAPof the available space of the smallest OST. If this option is not set, a default value of100is used, limiting the object size to 1% of available space.-h,--helpβ Display usage message.--no-rsyncβ Do not fall back to using rsync iflfs-migrate(1)fails. Cannot be used at the same time as--rsync.-M,--min-freeMIN_FREEβ When-Ais set, only consider OSTs with free space greater than theMIN_FREEvalue 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β Migrate files to specifiedPOOL.-q,--quietβ Run quietly (don't print filenames or status). shhh π€«--rsyncβ Force rsync to be used instead oflfs-migrate(1). May not be used at the same time as--no-rsync.-R,--restripeβ 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-Soptions. (these options are passed through to lfs migrate, and are therefore not listed here).-s,--skipβ Skip file data comparison after migrate. Default is to compare migrated file against original to verify correctness. (skipping the vibe check, bold of you π)-S,--stripe-sizeSTRIPE_SIZEβ Restripe file using the specified stripe size. This option may not be specified at the same time as the-Roption.-v,--verboseβ Show verbose debug messages.-X,--max-freeMAX_FREEβ When-Ais set,MAX_FREEis 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β Answer'y'to usage warning without prompt (--rsynconly, use with caution). β οΈ caution, bestie, this one skips the "u sure?" moment.-0β Input file names on stdin are separated by a null character.
π 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.
like. genuinely lost. gone. not coming back. so don't do it on files that are being actively written, fr fr π
π 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 β
lfs_migrate is part of the lustre(7) filesystem package. Added in release 1.8.4. it's been around, it's a legacy icon π
π SEE ALSO π
and that's the whole page, bestie π go forth and migrate responsibly. Lustre Β· 2025-12-20 Β· LFS_MIGRATE(1) π¦ mwah π
π¦ where this page comes from
- ubuntu stonking: lustre-client-utils 2.17.58+dfsg-0ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms