Whamcloud - gitweb
LU-10603 ptlrpc: export req_buffers_max via procfs
[fs/lustre-release.git] / lustre / doc / lfs_migrate.1
index a1bf7e6..4390740 100644 (file)
@@ -1,18 +1,20 @@
-.TH lfs_migrate 1 "Jul 21, 2010" Lustre "utilities"
+.TH lfs_migrate 1 "Dec 19, 2017" Lustre "utilities"
 .SH NAME
 .B lfs_migrate
 \- simple tool to migrate files between Lustre OSTs
 .SH SYNOPSIS
 .B lfs_migrate
-.RB [ -c <stripe_count> ]
+.RB [ --dry-run ]
+.RB [ -D ]
 .RB [ -h ]
-.RB [ -l ]
-.RB [ -n ]
+.RB [ --no-rsync | --rsync ]
 .RB [ -q ]
 .RB [ -R ]
 .RB [ -s ]
+.RB [ -v ]
 .RB [ -y ]
-.RI [ file | "directory ..." ]
+.RB [ -0 ]
+.RI [ FILE | DIR ]...
 .br
 .SH DESCRIPTION
 .B lfs_migrate
@@ -23,20 +25,6 @@ original filename.  This allows balancing space usage between OSTs, moving
 files off OSTs that are starting to show hardware problems (though are still
 functional), or OSTs that will be removed from the filesystem.
 .PP
-Because
-.B lfs_migrate
-is
-.B not
-closely integrated with the MDS, it cannot determine whether a file
-is currently open and/or in-use by other applications or nodes.  That makes
-it
-.B
-UNSAFE
-for use on files that might be modified by other applications, since the
-migrated file is only a copy of the current file, and this will result in
-the old file becoming an open-unlinked file and any modifications to that
-file will be lost.
-.PP
 Files to be migrated can be specified as command-line arguments.  If a
 directory is specified on the command-line then all files within that
 directory are migrated.  If no files are specified on the command-line,
@@ -46,6 +34,17 @@ suitable for use with
 .BR lfs (1) " find"
 to locate files on specific OSTs and/or matching other file attributes.
 .PP
+Any options and arguments not explicitly recognized by the script are passed
+through to the
+.B lfs migrate
+command, see
+.BR lfs-migrate (1).
+To maintain backward compatibility, the \fI-n \fRoption is used by the script
+for a dry-run, and is not passed to
+.B lfs migrate
+as the non-block option.  To specify non-block, use the long option
+.IR --non-block .
+.PP
 The current file allocation policies on MDS dictate where the new files
 are placed, taking into account whether specific OSTs have been disabled
 on the MDS via
@@ -57,56 +56,82 @@ directory (potentially changing the stripe count, stripe size, OST pool,
 or OST index of a new file).
 .SH OPTIONS
 .TP
-.B \\-c <stripe_count>
-Restripe file using the specified stripe count. This option may not be
-specified at the same time as the -R option.
+.B \\--dry-run
+Only print the names of files to be migrated.
+.TP
+.B \\-D
+Do not use direct I/O to copy file contents.
 .TP
 .B \\-h
 Display help information.
 .TP
-.B \\-l
-Migrate files with hard links (skip by default).  Files with multiple
-hard links will be split into multiple separate files by
-.B lfs_migrate
-so they are skipped by default to avoid breaking the hard links.
-.TP
-.B \\-n
-Only print the names of files to be migrated
+.B \\--no-rsync
+Do not fall back to using rsync if
+.BR lfs (1) " migrate" " fails."
+Cannot be used at the same time as \fI--rsync\fR.
 .TP
 .B \\-q
-Run quietly (don't print filenames or status)
+Run quietly (don't print filenames or status).
+.TP
+.B \\--rsync
+Force rsync to be used instead of
+.BR lfs (1) " migrate" .
+May not be used at the same time as \fI--no-rsync\fR.
 .TP
 .B \\-R
 Restripe file using default directory striping instead of keeping striping.
-This option may not be specified at the same time as the -c option.
+This option may not be specified at the same time as the -c or -S options
+(these options are passed through to
+.BR "lfs migrate" ,
+and are therefore not listed here).
 .TP
 .B \\-s
-skip file data comparison after migrate.  Default is to compare migrated file
+Skip file data comparison after migrate.  Default is to compare migrated file
 against original to verify correctness.
 .TP
+.B \\-v
+Show verbose debug messages.
+.TP
 .B \\-y
 Answer 'y' to usage warning without prompting (for scripts, use with caution).
+.TP
+.B \\-0
+Input file names on stdin are separated by a null character.
 .SH EXAMPLES
 To rebalance all files within
-.IR /mnt/lustre/dir :
+.I /testfs/jobs/2011
+(which are known not to be modified by in-use programs):
 .IP
-lfs_migrate /mnt/lustre/dir
+lfs_migrate /testfs/jobs/2011
 .PP
 To migrate files within the
-.I /test
-filesystem on OST0004 larger than 4GB in size:
+.I /testfs
+filesystem on OST0004 (perhaps because it is much more full than other OSTs),
+larger than 4GB (because it is more efficient to just migrate large files),
+and older than two days (to avoid files that are in use, though this is NOT
+a guarantee the files are not being modified, that is workload specific):
 .IP
-lfs find /test -obd test-OST0004 -size +4G | lfs_migrate -y
+lfs find /testfs -obd test-OST0004 -size +4G -mtime +2d |
+    lfs_migrate -y
+.SH NOTES
+In versions prior to 2.5,
+.B lfs_migrate
+is
+.B not
+closely integrated with the MDS, and cannot determine whether a file
+is currently open and/or in-use by other applications or nodes.  That makes
+it
+.B
+UNSAFE
+for use on files that might be modified by other applications, since the
+migrated file is only a copy of the current file. This will result in the
+old file becoming an open-unlinked file, and any modifications to that file
+will be lost.
 .SH KNOWN BUGS
-Hard links could be handled correctly in Lustre 2.0 by using
-.BR lfs (1) " fid2path" .
-.PP
 Eventually, this functionality will be integrated into
 .BR lfs (1)
 itself and will integrate with the MDS layout locking to make it safe
 in the presence of opened files and ongoing file IO.
-.PP
-Please report all bugs to http://bugzilla.lustre.org/
 .SH AVAILABILITY
 .B lfs_migrate
 is part of the