1 .TH LFS-MIGRATE 1 2021-11-08 "Lustre" "Lustre Utilities"
3 lfs migrate \- migrate files or directories between MDTs or OSTs.
7 .RI [ SETSTRIPE_OPTIONS " ... ]"
10 .B lfs migrate -m \fISTART_MDT_INDEX
15 Migrate OST objects between OSTs for the specified
17 or recursively migrate
19 and all inodes/directories therein between MDTs.
20 .SH OST MIGRATE OPTIONS
24 command can be used for moving files from one (or more) OSTs to other
25 OSTs (e.g. for space balancing between OSTs, or to evacuate an OST for
26 hardware reasons), to change the stripe count or other layout parameters
27 of a file (e.g. to increase the bandwidth of a file by striping it over
28 multiple OSTs), or to move the file between different classes of storage
29 (e.g. SSD vs. HDD OSTs, or local vs. remote OSTs in different pools).
31 In OST object migration mode, the command supports the same
35 to specify the layout of the target file. The migrate command differs from
39 will copy the data from the existing file(s) using the new layout parameters
40 to the new OST(s). In contrast,
42 is used for creating new (empty) files with the specified layout.
43 For OST object migration, there additional options available:
46 Block access to the file by other applications during data migration
47 (default). This prevents other processes from accessing the file during
48 migration, which prevents data data writes to the old file objects from
49 being lost. This should be used if an OST needs to be completely emptied
50 prior to its removal, to ensure all requested files are migrated off the
57 Abort migration if concurrent file access is detected. This can be
58 used with OST space balancing migration to avoid interfering with file
59 access by applications if there is not a requirement to migrate any
60 particular file to the new layout.
67 read and write operations when migrating a file. The
69 option avoids data copy from kernel buffers into userspace, which can
70 impose CPU and memory overhead on the copy operation, but makes read and
71 write operations synchronous. Using the
73 option uses buffered read/write operations, which may improve migration
74 speed at the cost of more CPU and memory overhead.
77 Print each filename as it is migrated.
83 script which is used to provide extra functionality when migrating file
84 data between OSTs and has a separate man page. See
87 .SH MDT MIGRATE OPTIONS
89 .BR -m , --mdt-index=\fIMDT_INDEX [, \fIMDT_INDEX ,...]
92 .B and all subdirectories and inodes
93 will be migrated to the MDT with the specified
95 This is useful if new MDTs have been added to a filesystem and existing user or
96 project directories should be migrated off old MDTs to balance the space usage
97 and future metadata workload. If
99 is -1, the MDT index will be balanced by free space and inodes among
100 available MDTs. If multiple
102 values are specified in a comma-seperated list, then all
103 subdirectories will be
105 across all of the specified MDT indices as if an equivalent
109 .BR -c , --mdt-count=\fICOUNT\fR
110 All directories and subdirectories in the tree will be striped across
114 as the primary MDT for the directory. If
119 directory stripes will be chosen from MDTs proportional to the amount
120 of free inodes and space on each MDT. If multiple
122 values are specified in a comma-separated list, then the number of specified
127 .BR -H , --mdt-hash=\fIHASH_TYPE\fR
130 for the new directory layout.
134 Sum of ASCII characters modulo number of MDTs. This
135 provides weak hashing of the filename, and is suitable
136 for only testing or when the input is known to have
137 perfectly uniform distribution (e.g. sequential numbers).
139 .B fnv_1a_64 (type 2)
140 Fowler-Noll-Vo (FNV-1a) hash algorithm. This provides
141 reasonably uniform, but not cryptographically strong,
142 hashing of the filename. (default)
145 CRUSH hash algorithm. This is a consistent hash
146 algorithm, so minimum sub files need to relocate
147 during directory restripe.
152 Only the root user can migrate directories. Files that have been archived by
153 HSM or are currently opened will fail to migrate, user can run the same migrate
154 command again to finish migration when files are ready. Both inode and
155 directory entry will be migrated. During migration directory and sub files can
156 be accessed like normal ones, but the migration itself cannot be interrupted.
159 It is not currently possible to migrate files with an
161 component (Data-on-MDT, DoM). If it is necessary to migrate such files off
162 a particular MDT, they must first be migrated to have a non-DoM file layout
163 and then the inodes migrated separately. See
165 for details on how to migrate DoM files between MDTs.
168 Each migrated file or directory will have a new FID, and hence a new inode
169 number. As a consequence, files archived by Lustre HSM that depend on
170 the FID as the identifier in the HSM archive cannot currently be migrated.
171 Having a new inode number may also cause backup tools to consider the
172 migrated file(s) to be a new, and cause them to be backed up again.
176 .B $ lfs migrate -c 2 /mnt/lustre/file1
177 This migrates the data in
179 into a new layout with 2 stripes.
181 .B $ lfs migrate -E 256M -c 1 -E 16G -c 4 -E eof -c 40 /mnt/lustre/file2
183 This migrates the data in
185 into a three component composite layout (number of stripes depends on
188 .B # lfs migrate -m 0,2 testremote
190 Recursively move the subdirectories and inodes contained in directory
192 from its current MDT to MDT0000 and MDT0002. The
194 directory and all of its subdirectories will be striped across both MDTs.
196 .B # lfs setstripe -E 256M -c 1 -E 16G -c 4 -E eof -c 40 topdir
197 Set a default PFL layout (without any DoM component) on the directory
200 .B # lfs find dir -type f -L mdt -0 | xargs -0 lfs migrate --copy topdir
201 then find and migrate all regular files that have an
203 component to copy the default layout from the specified
206 .B # lfs migrate -m 2 topdir
208 and finally migrate the directory
210 and all files and subdirectories in that tree to MDT0002. This allows
211 migrating files with DoM components off an MDT.
213 The lfs command is part of the Lustre filesystem.
216 .BR lfs-setstripe (1),
217 .BR lfs-setdirstripe (1),
218 .BR lfs-getdirstripe (1),