Whamcloud - gitweb
LU-1222 ldlm: Fix the race in AST sender vs multiple arriving RPCs
[fs/lustre-release.git] / lustre / doc / lfs_migrate.1
1 .TH lfs_migrate 1 "Jul 21, 2010" Lustre "utilities"
2 .SH NAME
3 .Blfs_migrate
4 \- simple tool to migrate files between Lustre OSTs
5 .SH SYNOPSIS
6 .B lfs_migrate
7 .RB [ -h ]
8 .RB [ -l ]
9 .RB [ -n ]
10 .RB [ -R ]
11 .RB [ -s ]
12 .RB [ -y ]
13 .RI [ file | "directory ..." ]
14 .br
15 .SH DESCRIPTION
16 .B lfs_migrate
17 is a simple tool to assist migration of files between Lustre OSTs.  It
18 is simply copying each specified file to a new file, verifying the file
19 contents have not changed, and then renaming the new file back to the
20 original filename.  This allows balancing space usage between OSTs, moving
21 files of OSTs that are starting to show hardware problems (though are still
22 functional), or OSTs will be discontinued.
23 .PP
24 Because
25 .B lfs_migrate
26 is
27 .B not
28 closely integrated with the MDS, it cannot determine whether a file
29 is currently open and/or in-use by other applications or nodes.  That makes
30 it
31 .B
32 UNSAFE
33 for use on files that might be modified by other applications, since the
34 migrated file is only a copy of the current file, and this will result in
35 the old file becoming an open-unlinked file and any modifications to that
36 file will be lost.
37 .PP
38 Files to be migrated can be specified as command-line arguments.  If a
39 directory is specified on the command-line then all files within that
40 directory are migrated.  If no files are specified on the command-line,
41 then a list of files is read from the standard input, making
42 .B lfs_migrate
43 suitable for use with
44 .BR lfs (1) " find"
45 to locate files on specific OSTs and/or matching other file attributes.
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 \\-h
59 Display help information.
60 .TP
61 .B \\-l
62 Migrate files with hard links (skip by default).  Files with multiple
63 hard links will be split into multiple separate files by
64 .B lfs_migrate
65 so they are skipped by default to avoid breaking the hard links.
66 .TP
67 .B \\-n
68 Only print the names of files to be migrated
69 .TP
70 .B \\-q
71 Run quietly (don't print filenames or status)
72 .TP
73 .B \\-R
74 Restripe file using default directory striping instead of keeping striping.
75 .TP
76 .B \\-s
77 skip file data comparison after migrate.  Default is to compare migrated file
78 against original to verify correctness.
79 .TP
80 .B \\-y
81 Answer 'y' to usage warning without prompting (for scripts, use with caution).
82 .SH EXAMPLES
83 To rebalance all files within
84 .IR /mnt/lustre/dir :
85 .IP
86 lfs_migrate /mnt/lustre/file
87 .PP
88 To migrate files within the
89 .I /test
90 filesystem on OST0004 larger than 4GB in size:
91 .IP
92 lfs find /test -obd test-OST0004 -size +4G | lfs_migrate -y
93 .SH KNOWN BUGS
94 Hard links could be handled correctly in Lustre 2.0 by using
95 .BR lfs (1) " fid2path" .
96 .PP
97 Eventually, this functionality will be integrated into
98 .BR lfs (1)
99 itself and will integrate with the MDS layout locking to make it safe
100 in the presence of opened files and ongoing file IO.
101 .PP
102 Please report all bugs to http://bugzilla.lustre.org/
103 .SH AVAILABILITY
104 .B lfs_migrate
105 is part of the 
106 .BR Lustre (7) 
107 filesystem package.  Added in the 1.8.4 release.
108 .SH SEE ALSO
109 .BR lfs (1)