Whamcloud - gitweb
LU-6051 lfs: Update lfs_migrate man page for in-use files
[fs/lustre-release.git] / lustre / doc / lfs_migrate.1
1 .TH lfs_migrate 1 "Dec 19, 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 [ --dry-run ]
8 .RB [ -h ]
9 .RB [ --no-rsync | --rsync ]
10 .RB [ -q ]
11 .RB [ -R ]
12 .RB [ -s ]
13 .RB [ -v ]
14 .RB [ -y ]
15 .RB [ -0 ]
16 .RI [ FILE | DIR ]...
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 Files to be migrated can be specified as command-line arguments.  If a
28 directory is specified on the command-line then all files within that
29 directory are migrated.  If no files are specified on the command-line,
30 then a list of files is read from the standard input, making
31 .B lfs_migrate
32 suitable for use with
33 .BR lfs (1) " find"
34 to locate files on specific OSTs and/or matching other file attributes.
35 .PP
36 Any options and arguments not explicitly recognized by the script are passed
37 through to the
38 .B lfs migrate
39 command, see
40 .BR lfs-migrate (1).
41 To maintain backward compatibility, the \fI-n \fRoption is used by the script
42 for a dry-run, and is not passed to
43 .B lfs migrate
44 as the non-block option.  To specify non-block, use the long option
45 .IR --non-block .
46 .PP
47 The current file allocation policies on MDS dictate where the new files
48 are placed, taking into account whether specific OSTs have been disabled
49 on the MDS via
50 .BR lctl (8)
51 (preventing new files from being allocated there), whether
52 some OSTs are overly full (reducing the number of files placed on those
53 OSTs), or if there is a specific default file striping for the target
54 directory (potentially changing the stripe count, stripe size, OST pool,
55 or OST index of a new file).
56 .SH OPTIONS
57 .TP
58 .B \\--dry-run
59 Only print the names of files to be migrated.
60 .TP
61 .B \\-h
62 Display help information.
63 .TP
64 .B \\--no-rsync
65 Do not fall back to using rsync if
66 .BR lfs (1) " migrate" " fails."
67 Cannot be used at the same time as \fI--rsync\fR.
68 .TP
69 .B \\-q
70 Run quietly (don't print filenames or status).
71 .TP
72 .B \\--rsync
73 Force rsync to be used instead of
74 .BR lfs (1) " migrate" .
75 May not be used at the same time as \fI--no-rsync\fR.
76 .TP
77 .B \\-R
78 Restripe file using default directory striping instead of keeping striping.
79 This option may not be specified at the same time as the -c or -S options
80 (these options are passed through to
81 .BR "lfs migrate" ,
82 and are therefore not listed here).
83 .TP
84 .B \\-s
85 Skip file data comparison after migrate.  Default is to compare migrated file
86 against original to verify correctness.
87 .TP
88 .B \\-v
89 Show verbose debug messages.
90 .TP
91 .B \\-y
92 Answer 'y' to usage warning without prompting (for scripts, use with caution).
93 .TP
94 .B \\-0
95 Input file names on stdin are separated by a null character.
96 .SH EXAMPLES
97 To rebalance all files within
98 .I /testfs/jobs/2011
99 (which are known not to be modified by in-use programs):
100 .IP
101 lfs_migrate /testfs/jobs/2011
102 .PP
103 To migrate files within the
104 .I /testfs
105 filesystem on OST0004 (perhaps because it is much more full than other OSTs),
106 larger than 4GB (because it is more efficient to just migrate large files),
107 and older than two days (to avoid files that are in use, though this is NOT
108 a guarantee the files are not being modified, that is workload specific):
109 .IP
110 lfs find /testfs -obd test-OST0004 -size +4G -mtime +2d |
111     lfs_migrate -y
112 .SH NOTES
113 In versions prior to 2.5,
114 .B lfs_migrate
115 is
116 .B not
117 closely integrated with the MDS, and cannot determine whether a file
118 is currently open and/or in-use by other applications or nodes.  That makes
119 it
120 .B
121 UNSAFE
122 for use on files that might be modified by other applications, since the
123 migrated file is only a copy of the current file. This will result in the
124 old file becoming an open-unlinked file, and any modifications to that file
125 will be lost.
126 .SH KNOWN BUGS
127 Eventually, this functionality will be integrated into
128 .BR lfs (1)
129 itself and will integrate with the MDS layout locking to make it safe
130 in the presence of opened files and ongoing file IO.
131 .SH AVAILABILITY
132 .B lfs_migrate
133 is part of the 
134 .BR Lustre (7) 
135 filesystem package.  Added in the 1.8.4 release.
136 .SH SEE ALSO
137 .BR lfs (1)