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