Whamcloud - gitweb
b=24037 Changes of 2.6.32 kernel.
[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 [ -c | -s ]
8 .RB [ -h ]
9 .RB [ -l ]
10 .RB [ -n ]
11 .RB [ -y ]
12 .RI [ file | "directory ..." ]
13 .br
14 .SH DESCRIPTION
15 .B lfs_migrate
16 is a simple tool to assist migration of files between Lustre OSTs.  It
17 is simply copying each specified file to a new file, verifying the file
18 contents have not changed, and then renaming the new file back to the
19 original filename.  This allows balancing space usage between OSTs, moving
20 files of OSTs that are starting to show hardware problems (though are still
21 functional), or OSTs will be discontinued.
22 .PP
23 Because
24 .B lfs_migrate
25 is
26 .B not
27 closely integrated with the MDS, it cannot determine whether a file
28 is currently open and/or in-use by other applications or nodes.  That makes
29 it
30 .B
31 UNSAFE
32 for use on files that might be modified by other applications, since the
33 migrated file is only a copy of the current file, and this will result in
34 the old file becoming an open-unlinked file and any modifications to that
35 file will be lost.
36 .PP
37 Files to be migrated can be specified as command-line arguments.  If a
38 directory is specified on the command-line then all files within that
39 directory are migrated.  If no files are specified on the command-line,
40 then a list of files is read from the standard input, making
41 .B lfs_migrate
42 suitable for use with
43 .BR lfs (1) " find"
44 to locate files on specific OSTs and/or matching other file attributes.
45 .PP
46 The current file allocation policies on MDS dictate where the new files
47 are placed, taking into account whether specific OSTs have been disabled
48 on the MDS via
49 .BR lctl (8)
50 (preventing new files from being allocated there), whether
51 some OSTs are overly full (reducing the number of files placed on those
52 OSTs), or if there is a specific default file striping for the target
53 directory (potentially changing the stripe count, stripe size, OST pool,
54 or OST index of a new file).
55 .SH OPTIONS
56 .TP
57 .B \\-c
58 Compare file data after migrate (default, use
59 .B \\-s
60 to disable).
61 .TP
62 .B \\-s
63 skip file data comparison after migrate (use
64 .B \\-c
65 to enable).
66 .TP
67 .B \\-h
68 Display help information.
69 .TP
70 .B \\-l
71 Migrate files with hard links (skip by default).  Files with multiple
72 hard links will be split into multiple separate files by
73 .B lfs_migrate
74 so they are skipped by default to avoid breaking the hard links.
75 .TP
76 .B \\-n
77 Only print the names of files to be migrated
78 .TP
79 .B \\-q
80 Run quietly (don't print filenames or status)
81 .TP
82 .B \\-y
83 Answer 'y' to usage warning without prompting (for scripts)
84 .SH EXAMPLES
85 To rebalance all files within
86 .IR /mnt/lustre/dir :
87 .IP
88 lfs_migrate /mnt/lustre/file
89 .PP
90 To migrate files within the
91 .I /test
92 filesystem on OST0004 larger than 4GB in size:
93 .IP
94 lfs find /test -obd test-OST0004 -size +4G | lfs_migrate -y
95 .SH KNOWN BUGS
96 Hard links could be handled correctly in Lustre 2.0 by using
97 .BR lfs (1) " fid2path" .
98 .PP
99 Eventually, this functionality will be integrated into
100 .BR lfs (1)
101 itself and will integrate with the MDS layout locking to make it safe
102 in the presence of opened files and ongoing file IO.
103 .PP
104 Please report all bugs to http://bugzilla.lustre.org/
105 .SH AVAILABILITY
106 .B lfs_migrate
107 is part of the 
108 .BR Lustre (7) 
109 filesystem package.  Added in the 1.8.4 release.
110 .SH SEE ALSO
111 .BR lfs (1)