Whamcloud - gitweb
LU-10966 utils: Fix `lfs check` documentation and arguments
[fs/lustre-release.git] / lustre / doc / lfs.1
1 .TH lfs 1 "2018-01-24" Lustre "user utilities"
2 .SH NAME
3 lfs \- client utility for Lustre-specific file layout and other attributes
4 .SH SYNOPSIS
5 .br
6 .B lfs changelog [--follow] <mdtname> [startrec [endrec]]
7 .br
8 .B lfs changelog_clear <mdtname> <id> <endrec>
9 .br
10 .B lfs check <mgts|mdts|osts|all>
11 .br
12 .B lfs data_version [-nrw] \fB<filename>\fR
13 .br
14 .B lfs df [-ihlv] [--pool|-p <fsname>[.<pool>]] [path]
15 .br
16 .B lfs fid2path [--link <linkno>] <fsname|rootpath> <fid> ...
17 .br
18 .B lfs find \fR<\fIdirectory\fR|\fIfilename \fR...>
19       [[\fB!\fR] \fB--atime\fR|\fB-A\fR [\fB-+\fR]\fIn\fR]
20 [[\fB!\fR] \fB--ctime\fR|\fB-C\fR [\fB+-\fR]\fIn\fR]
21       [[\fB!\fR] \fB--mtime\fR|\fB-M\fR [\fB-+\fR]\fIn\fR]
22       [[\fB!\fR] \fB--component-count|\fB--comp-count\fR [\fB+-\fR]\fIn\fR]
23       [[\fB!\fR] \fB--component-flags|\fB--comp-flags\fR <[\fB^\fR]\fIflag\fB,\fR...>]
24       [[\fB!\fR] \fB--component-end|\fB--comp-end\fR|\fB-E\fR [\fB+-\fR]\fIn\fR[\fBKMGTPE\fR]]
25       [[\fB!\fR] \fB--component-start|\fB--comp-start\fR [\fB+-\fR]\fIn\fR[\fBKMGTPE\fR]]
26       [[\fB!\fR] \fB--mirror-count|\fB-N\fR [\fB+-\fR]\fIn\fR]
27       [[\fB!\fR] \fB--mirror-state\fR <[^]\fIstate\fR>]
28       [[\fB!\fR] \fB--gid\fR|\fB-g\fR|\fB--group\fR|\fB-G\fR <\fIgname\fR>|<\fIgid\fR>]
29       [[\fB!\fR] \fB--layout\fR|\fB-L mdt\fR,\fBraid0\fR,\fBreleased\fR]
30 [\fB--maxdepth\fR|\fB-D\fI n\fR]
31       [[\fB!\fR] \fB--mdt\fR|\fB--mdt-index\fR|\fB-m\fR <\fIuuid\fR|\fIindex\fR,...>]
32       [[\fB!\fR] \fB--mdt-count\fR|\fB-T\fR [\fB+-\fR]\fIn\fR]
33 [[\fB!\fR] \fB--mdt-hash\fR|\fB-H \fI<hashtype>\fR]
34       [[\fB!\fR] \fB--name\fR|\fB-n \fI<pattern>\fR]
35 [[\fB!\fR] \fB--ost\fR|\fB-O\fR <\fIuuid\fR|\fIindex\fR,...>]
36       [[\fB!\fR] \fB--pool\fR <\fIpool\fR>]
37 [\fB--print\fR|\fB-P\fR] [\fB--print0\fR|\fB-0\fR]
38       [[\fB!\fR] \fB--projid\fR |<\fIprojid\fR>]
39 [[\fB!\fR] \fB--size|\fB-s\fR [\fB-+\fR]\fIn\fR[\fBKMGTPE\fR]]
40       [[\fB!\fR] \fB--stripe-count|\fB-c\fR [\fB+-\fR]\fIn\fR]
41       [[\fB!\fR] \fB--stripe-index|\fB-i\fR \fIn\fR,...]
42       [[\fB!\fR] \fB--stripe-size|\fB-S\fR [\fB+-\fR]\fIn\fR[\fBKMG\fR]]
43 [[\fB!\fR] \fB--type\fR|\fB-t\fR {\fBbcdflps\fR}]
44       [[\fB!\fR] \fB--uid\fR|\fB-u\fR|\fB--user\fR|\fB-U
45 <\fIuname\fR>|<\fIuid>\fR]
46 .br
47 .B lfs getname [-h]|[path ...]
48 .br
49 .B lfs getstripe
50 [\fB--component-count\fR|\fB--comp-count\fR]
51         [\fB--component-end\fR[=[\fB+-\fR]\fIN\fR[kMGTPE]]|\fB-E\fR[[+-]\fIN\fR[kMGTPE]]]
52         [\fB--component-flags\fR[=[\fB^\fR]\fIflag\fB,\fR...]]
53         [\fB--component-id\fR[=\fIcomp_id\fR]|\fB-I\fR[<\fIcomp_id\fR>]]
54         [\fB--component-start\fR[=[\fB+-\fR]\fIN\fR[kMGTPE]]]
55         [\fB--directory\fR|\fB-d\fR]
56 [\fB--fid\fR|\fB-F\fR]
57 [\fB--generation\fR|\fB-g\fR]
58         [\fB--layout\fR|\fB-L\fR]
59 [\fB--mdt\fR|\fB--mdt-index\fR|\fB-m\fR]
60 [\fB--ost\fR|\fB-O\fR <\fIuuid\fR>]
61         [\fB--pool\fR|\fB-p\fR]
62 [\fB--quiet\fR|\fB-q\fR]
63 [\fB--recursive\fR|\fB-r\fR]
64         [\fB--raw\fR|\fB-R\fR]
65 [\fB--stripe-count\fR|\fB-c\fR]
66 [\fB--stripe-index\fR|\fB-i\fR]
67         [\fB--stripe-size\fR|\fB-S\fR]
68 [\fB--verbose\fR|\fB-v\fR]
69 [\fB--yaml\fR|\fB-y\fR]
70         <\fIdirname\fR|\fIfilename\fR> ...
71 .br
72 .B lfs migrate { --mdt-index | -m } \fI<mdt_index>\fR
73 .IR directory
74 .br
75 .B lfs migrate [\fB-c | --stripe-count <stripe_count>\fR]
76             [\fB-i | --stripe-index <start_ost_idx>\fR]
77             [\fB-S | --stripe-size <stripe_size>\fR]
78             [\fB-p | --pool <pool_name>\fR]
79             [\fB-o | --ost-list <ost_indices>\fR]
80             [\fB-b | --block\fR]
81             [\fB-n | --non-block\fR]
82 .IR file|directory
83 .br
84 .B lfs migrate <\fB-E | --component-end comp_end1\fR> [\fBSTRIPE_OPTIONS\fR]
85             <\fB-E | --component-end comp_end2\fR> [\fBSTRIPE_OPTIONS\fR]
86             \fB...\fR
87 .IR filename
88 .br
89 .B lfs mkdir [\fB-c | --count <stripe_count>\fR]
90            [\fB-i | --index <mdt_idx>\fR]
91            [\fB-h | --hash-type <hash_name>\fR]
92            [\fB-m | --mode <mode>\fR]
93            [\fB-D | --default\fR]
94 .IR directory
95 .br
96 .B lfs osts
97 .RB [ path ]
98 .br
99 .B lfs mdts
100 .RB [ path ]
101 .br
102 .B lfs path2fid [--parents] <path> ...
103 .br
104 .B lfs pool_list <filesystem>[.<pool>] | <pathname>
105 .br
106 .B lfs quota [-q] [-v] [-o obd_uuid|-I ost_idx|-i mdt_idx] [-u <uname>| -u <uid>|-g <gname>| -g <gid>] [-p <projid>] <filesystem>
107 .br
108 .B lfs quota -t <-u|-g|-p> <filesystem>
109 .br
110 .B lfs quotacheck [-ug] <filesystem>
111 .br
112 .B lfs quota <-U|-G|-P> <filesystem>
113 .br
114 .B lfs quotaon [-ugf] <filesystem>
115 .br
116 .B lfs quotaoff [-ug] <filesystem>
117 .br
118 .B lfs setstripe [--stripe-size|-S <size>] [--stripe-count|-c <count>]
119         \fB[--stripe-index|-i <start_ost_index>] [--pool|-p <poolname>]
120         \fB[--ost-list|-o <ost_indices>] <directory|filename>\fR
121 .br
122 .B lfs setstripe -d <dir>
123 .br
124 .B lfs setstripe --component-end|-E <end1> [STRIPE_OPTIONS]
125      [\fB--component-end|-E <end2> [STRIPE_OPTIONS]] ... <filename>\fR
126 .br
127 .B lfs setstripe --component-add --component-end|-E <end1> [STRIPE_OPTIONS]
128      \fB<--component-end|-E <end2>> [STRIPE_OPTIONS]] ... <filename>\fR
129 .br
130 .B lfs setstripe --component-del {--component-id|-I id |
131      \fB--component-flags <flags>} <filename>
132 .br
133 .B lfs setstripe --yaml=<yaml_template_file> <filename>
134 .br
135 .B lfs --version
136 .br
137 .B lfs --list-commands
138 .br
139 .B lfs help
140 .SH DESCRIPTION
141 .B lfs
142 can be used to create a new file with a specific striping pattern, determine
143 the default striping pattern, gather the extended attributes (object numbers
144 and location) for a specific file. It can be invoked interactively without any
145 arguments or in a non-interactive mode with one of the arguments supported.
146 .SH OPTIONS
147 The various options supported by lfs are listed and explained below:
148 .TP
149 .B changelog
150 Show the metadata changes on an MDT.  Start and end points are optional.  The --follow option will block on new changes; this option is only valid when run direclty on the MDT node.
151 .TP
152 .B changelog_clear
153 Indicate that changelog records previous to <endrec> are no longer of
154 interest to a particular consumer <id>, potentially allowing the MDT to
155 free up disk space. An <endrec> of 0 indicates the current last record.
156 Changelog consumers must be registered on the MDT node using \fBlctl\fR.
157 .TP
158 .B check <mgts|mdts|osts|all>
159 Display the status of the MGTs, MDTs or OSTs (as specified in the command) or
160 all the servers (MGTs, MDTs and OSTs).
161 .TP
162 .B data_version [-nrw] <filename>
163 Display the current version of file data. If -n is specified, the data version
164 is read without taking a lock. As a consequence, the data version could be
165 outdated if there are dirty caches on filesystem clients, but this option will
166 not force data flushes and has less of an impact on the filesystem. If -r is
167 specified, the data version is read after dirty pages on clients are flushed. If
168 -w is specified, the data version is read after all caching pages on clients are
169 flushed.
170
171 Even with -r or -w, race conditions are possible and the data version should be
172 checked before and after an operation to be confident the data did not change
173 during it.
174
175 The data version is the sum of the last committed transaction numbers of all
176 data objects of a file. It is used by HSM policy engines for verifying that file
177 data has not been changed during an archive operation or before a release
178 operation, and by OST migration, primarily for verifying that file data has not
179 been changed during a data copy, when done in non-blocking mode.
180 .TP
181 .B getname [-h]|[path ...]
182 Report all the Lustre mount points and the corresponding Lustre filesystem
183 instance. If one or more \fBpath\fR entries are provided, then only the
184 Lustre instance for these mount points is returned. If the path given is not on
185 a Lustre instance 'No such device' is reported.
186 .TP
187 .B osts
188 .RB [ path ]
189 List all the OSTs for all mounted filesystems. If a \fBpath\fR is provided
190 that is located on a lustre mounted file system then only the OSTs belonging
191 to that filesystem are displayed.
192 .TP
193 .B fid2path [--link <linkno>] <fsname|rootpath> <fid> ...
194 Print out the pathname(s) for the specified \fIfid\fR(s) from the filesystem
195 mounted at \fBrootpath\fR or named \fBfsname\fR.  If a file has multiple
196 hard links, then all of the pathnames for that file are printed, unless
197 \fB--link\fR limits the printing to only the specified link number (starting
198 at 0, in no particular order).  If multiple fids are specified, but only a
199 single pathname is needed for each file, use \fB--link 0\fR.
200 .TP
201 .B path2fid [--parents] <path> ...
202 Print out the FIDs for the specified \fBpath(s)\fR.  If multiple pathnames
203 are given, then they will be printed one per line with the path as prefix.
204 The \fB--parents\fR switch makes it output the parent FID and name(s) of the
205 given entries. If an entry has multiple links, these are displayed on a single
206 line, tab-separated.
207 .TP
208 .B pool_list
209 .RI { filesystem }[ .poolname "] | {" pathname }
210 List the pools in
211 .I filesystem
212 or
213 .IR pathname ,
214 or the OSTs in
215 .IR filesystem.pool .
216 .TP
217 .B quota [-q] [-v] [-o obd_uuid|-i mdt_idx|-I ost_idx] [-u|-g|-p <uname>|<uid>|<gname>|<gid>|<projid>] <filesystem>
218 To display disk usage and limits, either for the full filesystem, or for objects on a specific obd. A user or group name or an ID can be specified. If user group and project are omitted quotas for current uid/gid/projid are shown. -v provides more verbose (with per-obd statistics) output. -q disables printing of additional descriptions (including column titles).
219 .TP
220 .B quota -t <-u|-g|-p> <filesystem>
221 To display block and inode grace times for user (-u) or group (-g) or project (-p) quotas
222 .TP
223 .B quotacheck [-ugf] <filesystem> (deprecated as of 2.4.0)
224 To scan the specified filesystem for disk usage, and create or update quota files. Options specify quota for users (-u) groups (-g) and force (-f). Not useful anymore with servers >= 2.4.0 since space accounting is always turned on.
225 .TP
226 .B quotaon [-ugf] <filesystem> (deprecated as of 2.4.0)
227 To turn filesystem quotas on. Options specify quota for users (-u) groups (-g) and force (-f). Not used anymore in lustre 2.4.0 where quota enforcement must be enabled via conf_param (e.g. lctl conf_param ${FSNAME}.quota.<ost|mdt>=<u|g|ug>)
228 .TP
229 .B quotaoff [-ugf] <filesystem> (deprecated as of 2.4.0)
230 To turn filesystem quotas off.  Options specify quota for users (-u) groups (-g) and force (-f). Not used anymore in lustre 2.4.0 where quota enforcement can be turned off (for inode or block) by running the following command on the MGS: lctl conf_param ${FSNAME}.quota.<ost|mdt>=""
231 .TP
232 .B swap_layouts <filename1> <filename2>
233 Swap the data (layout and OST objects) of two regular files. The
234 two files have to be in the same filesystem, owned by the same user,
235 reside on the same MDT and writable by the user.
236
237 Swapping the layout of two directories is not permitted.
238 .TP
239 .B mkdir
240 lfs mkdir is documented in the man page: lfs-mkdir(1). NOTE:
241 .B lfs setdirstripe
242 is an alias of the command
243 .B lfs mkdir
244 .TP
245 .B mv
246 lfs mv is deprecated, use lfs
247 .B migrate
248 instead.
249 .TP
250 .B migrate
251 See lfs-migrate(1).
252 .TP
253 .B setstripe
254 See lfs-setstripe(1).
255 .TP
256 .B --version
257 Output the build version of the lfs utility. Use "lctl lustre_build_version" to get the version of the Lustre kernel modules
258 .TP
259 .B --list-commands
260 Output a list of the commands supported by the lfs utility
261 .TP
262 .B help
263 Provides brief help on the various arguments
264 .TP
265 .B exit/quit
266 Quit the interactive lfs session
267 .SH EXAMPLES
268 .TP
269 .B $ lfs check all
270 Check the status of all servers (MGT, MDT, OST)
271 .TP
272 .B $ lfs osts
273 List all the OSTs
274 .TP
275 .B $ lfs mdts
276 List all the MDTs
277 .TP
278 .B $ lfs quota -u bob /mnt/lustre
279 List quotas of user `bob'
280 .TP
281 .B $ lfs quota -U /mnt/lustre
282 List user quotas of system default setting
283 .TP
284 .B $ lfs quota -t -u /mnt/lustre
285 Show grace times for user quotas on /mnt/lustre
286 .TP
287 .B $ lfs quotachown -i /mnt/lustre
288 Change file owner and group
289 .TP
290 .B $ lfs quotacheck -ug /mnt/lustre
291 Quotacheck for user and group - will turn on quotas after making the check.
292 .TP
293 .B $ lfs quotaon -ug /mnt/lustre
294 Turn quotas of user and group on
295 .TP
296 .B $ lfs quotaoff -ug /mnt/lustre
297 Turn quotas of user and group off
298 .SH NOTES
299 The usage of \fBlfs find\fR, \fBlfs getstripe\fR, \fBlfs hsm_*\fR,
300 \fBlfs setstripe\fR, \fBlfs migrate\fR, \fBlfs getdirstripe\fR,
301 \fBlfs setdirstripe\fR, \fBlfs mkdir\fR, and \fBlfs project\fR are explained
302 in separate man pages.
303 .SH AUTHOR
304 The lfs command is part of the Lustre filesystem.
305 .SH SEE ALSO
306 .BR lctl (8),
307 .BR lfs-df (1),
308 .BR lfs-find (1),
309 .BR lfs-getstripe (1),
310 .BR lfs-getdirstripe (1),
311 .BR lfs-hsm (1),
312 .BR lfs-mkdir (1),
313 .BR lfs-migrate (1),
314 .BR lfs_migrate (1),
315 .BR lfs-project (1),
316 .BR lfs-setdirstripe (1),
317 .BR lfs-setquota (1),
318 .BR lfs-setstripe (1),
319 .BR lustre (7)