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