Whamcloud - gitweb
LU-6051 utils: allow lfs_migrate to handle hard links
[fs/lustre-release.git] / lustre / doc / lfs_migrate.1
1 .TH lfs_migrate 1 "Jun 16, 2017" Lustre "utilities"
2 .SH NAME
3 .B lfs_migrate
4 \- simple tool to migrate files between Lustre OSTs
5 .SH SYNOPSIS
6 .B lfs_migrate
7 .RB [ -c <stripe_count> ]
8 .RB [ -h ]
9 .RB [ -n ]
10 .RB [ -q ]
11 .RB [ -R ]
12 .RB [ -s ]
13 .RB [ -S <stripe_size> ]
14 .RB [ -y ]
15 .RB [ -0 ]
16 .RI [ file | "directory ..." ]
17 .br
18 .SH DESCRIPTION
19 .B lfs_migrate
20 is a simple tool to assist migration of files between Lustre OSTs.  It
21 is simply copying each specified file to a new file, verifying the file
22 contents have not changed, and then renaming the new file back to the
23 original filename.  This allows balancing space usage between OSTs, moving
24 files off OSTs that are starting to show hardware problems (though are still
25 functional), or OSTs that will be removed from the filesystem.
26 .PP
27 Because
28 .B lfs_migrate
29 is
30 .B not
31 yet closely integrated with the MDS, it cannot determine whether a file
32 is currently open and/or in-use by other applications or nodes.  That makes
33 it
34 .B
35 UNSAFE
36 for use on files that might be modified by other applications, since the
37 migrated file is only a copy of the current file, and this will result in
38 the old file becoming an open-unlinked file and any modifications to that
39 file will be lost.
40 .PP
41 Files to be migrated can be specified as command-line arguments.  If a
42 directory is specified on the command-line then all files within that
43 directory are migrated.  If no files are specified on the command-line,
44 then a list of files is read from the standard input, making
45 .B lfs_migrate
46 suitable for use with
47 .BR lfs (1) " find"
48 to locate files on specific OSTs and/or matching other file attributes.
49 .PP
50 The current file allocation policies on MDS dictate where the new files
51 are placed, taking into account whether specific OSTs have been disabled
52 on the MDS via
53 .BR lctl (8)
54 (preventing new files from being allocated there), whether
55 some OSTs are overly full (reducing the number of files placed on those
56 OSTs), or if there is a specific default file striping for the target
57 directory (potentially changing the stripe count, stripe size, OST pool,
58 or OST index of a new file).
59 .SH OPTIONS
60 .TP
61 .B \\-c <stripe_count>
62 Restripe file using the specified stripe count. This option may not be
63 specified at the same time as the -R option.
64 .TP
65 .B \\-h
66 Display help information.
67 .TP
68 .B \\-n
69 Only print the names of files to be migrated.
70 .TP
71 .B \\-q
72 Run quietly (don't print filenames or status).
73 .TP
74 .B \\-R
75 Restripe file using default directory striping instead of keeping striping.
76 This option may not be specified at the same time as the -c or -S options.
77 .TP
78 .B \\-s
79 Skip file data comparison after migrate.  Default is to compare migrated file
80 against original to verify correctness.
81 .TP
82 .B \\-S <stripe_size>
83 Restripe file using the specified stripe size. This option may not be
84 specified at the same time as the -R option.
85 .TP
86 .B \\-y
87 Answer 'y' to usage warning without prompting (for scripts, use with caution).
88 .TP
89 .B \\-0
90 Input file names on stdin are separated by a null character.
91 .SH EXAMPLES
92 To rebalance all files within
93 .I /testfs/jobs/2011
94 (which are known not to be modified by in-use programs):
95 .IP
96 lfs_migrate /testfs/jobs/2011
97 .PP
98 To migrate files within the
99 .I /testfs
100 filesystem on OST0004 (perhaps because it is much more full than other OSTs),
101 larger than 4GB (because it is more efficient to just migrate large files),
102 and older than two days (to avoid files that are in use, though this is NOT
103 a guarantee the files are not being modified, that is workload specific):
104 .IP
105 lfs find /testfs -obd test-OST0004 -size +4G -mtime +2d |
106     lfs_migrate -y
107 .SH KNOWN BUGS
108 Eventually, this functionality will be integrated into
109 .BR lfs (1)
110 itself and will integrate with the MDS layout locking to make it safe
111 in the presence of opened files and ongoing file IO.
112 .SH AVAILABILITY
113 .B lfs_migrate
114 is part of the 
115 .BR Lustre (7) 
116 filesystem package.  Added in the 1.8.4 release.
117 .SH SEE ALSO
118 .BR lfs (1)