Whamcloud - gitweb
LU-17705 ptlrpc: replace synchronize_rcu() with rcu_barrier()
[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> [\fIpath\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--extension-size\fR|\fB-ext-size\fR|\fB-z\fR [\fB+-\fR]\fIn\fR[\fBKMG\fR]]
43       [[\fB!\fR] \fB--stripe-size\fR|\fB-S\fR [\fB+-\fR]\fIn\fR[\fBKMG\fR]]
44 [[\fB!\fR] \fB--type\fR|\fB-t\fR {\fBbcdflps\fR}]
45       [[\fB!\fR] \fB--uid\fR|\fB-u\fR|\fB--user\fR|\fB-U
46 \fR<\fIuname\fR>|<\fIuid\fR>]
47 .br
48 .B lfs flushctx
49 .RB [ --help | -h "] [" -k "] [" -r "] [" \fIrootpath\fR "]"
50 .br
51 .B lfs getname
52 .RB [ --help | -h "] [" --instance | -i "] [" --fsname | -n "] ["
53 .IR path ...]
54 .br
55 .B lfs getstripe
56 [\fB--component-count\fR|\fB--comp-count\fR]
57         [\fB--component-end\fR|\fB-E\fR[=[\fB+-\fR]\fIN\fR[\fBKMGTPE\fR]]
58         [\fB--component-flags\fR[=[\fB^\fR]\fIflag\fB,\fR...]]
59         [\fB--component-id\fR|\fB-I \fR[=\fIcomp_id\fR]]
60         [\fB--component-start\fR[=[\fB+-\fR]\fIN\fR[\fBKMGTPE\fR]]]
61         [\fB--directory\fR|\fB-d\fR]
62 [\fB--fid\fR|\fB-F\fR]
63 [\fB--generation\fR|\fB-g\fR]
64         [\fB--layout\fR|\fB-L\fR]
65 [\fB--mdt\fR|\fB--mdt-index\fR|\fB-m\fR]
66 [\fB--ost\fR|\fB-O\fR <\fIuuid\fR>]
67         [\fB--pool\fR|\fB-p\fR]
68 [\fB--quiet\fR|\fB-q\fR]
69 [\fB--recursive\fR|\fB-r\fR]
70         [\fB--raw\fR|\fB-R\fR]
71 [\fB--stripe-count\fR|\fB-c\fR]
72 [\fB--stripe-index\fR|\fB-i\fR]
73         [\fB--stripe-size\fR|\fB-S\fR]
74 [\fB--extension-size\fR|\fB--ext-size\fR|\fB-z\fR]
75         [\fB--verbose\fR|\fB-v\fR]
76 [\fB--yaml\fR|\fB-y\fR]
77         <\fIdirname\fR|\fIfilename\fR> ...
78 .br
79 .B lfs migrate \fR{\fB--mdt-index\fR|\fB-m\fR} <\fImdt_index\fR> \fIdirectory\fR
80 .br
81 .B lfs migrate \fR[\fB--stripe-count\fR|\fB-c\fR \fR<\fIstripe_count\fR>]
82             [\fB--stripe-index\fR|\fB-i\fR \fR<\fIstart_ost_idx\fR>]
83             [\fB--stripe-size\fR|\fB-S\fR \fR<\fIstripe_size\fR>]
84 [\fB--pool\fR|\fB-p\fR \fR<\fIpool_name\fR>]
85             [\fB-o\fR|\fB--ost-list \fR<\fIost_indices\fR>]
86 [\fB--block\fR|\fB-b\fR]
87             [\fB--non-block\fR|\fB-n\fR] <\fIfile\fR|\fIdirectory\fR>
88 .br
89 .B lfs migrate \fR<\fB--component-end\fR|\fB-E\fR \fIcomp_end1\fR>
90 [\fISTRIPE_OPTIONS\fR]
91             <\fB--component-end\fR|\fB-E\fR \fIcomp_end2\fR>
92 [\fISTRIPE_OPTIONS\fR]
93             ... \fIfilename\fR
94 .br
95 .B lfs mkdir \fR[\fB-c\fR|\fB--count \fR<\fIstripe_count\fR>]
96 [\fB-i\fR|\fB--index \fR<\fImdt_idx\fR>]
97           [\fB-h\fR|\fB--hash-type \fR<\fIhash_name\fR>]
98 [\fB-m\fR|\fB--mode \fR<\fImode\fR>]
99           [\fB-D\fR|\fB--default\fR] \fIdirectory\fR
100 .br
101 .B lfs osts \fR[<\fIpath\fR>]
102 .br
103 .B lfs mdts \fR[<\fIpath\fR>]
104 .br
105 .B lfs path2fid \fR[\fB--parents\fR] <\fIpath\fR> ...
106 .br
107 .B lfs pool_list \fR<\fIfilesystem\fR>[\fB.\fR<\fIpool\fR>] | <\fIpathname\fR>
108 .br
109 .B lfs setstripe \fR[\fB--stripe-size\fR|\fB-S <\fIsize\fR>] [\fB--stripe-count\fR|-c <\fIcount\fR>]
110         [\fB--stripe-index\fR|\fB-i <\fIstart_ost_index\fR>] [\fB--pool\fR|\fB-p \fR<\fIpoolname\fR>]
111         [\fB--extension-size\fR|\fB--ext-size\fR|\fB-z <\fIext_size\fR>]
112         [\fB--ost-list\fR|\fB-o <\fIost_indices\fR>] <\fIdirectory\fR|\fIfilename\fR>
113 .br
114 .B lfs setstripe -d \fR<\fIdir\fR>
115 .br
116 .B lfs setstripe --component-end\fR|\fB-E <\fIend1> [\fISTRIPE_OPTIONS\fR]
117              [\fB--component-end\fR|\fB-E \fR<\fIend2\fR> [\fISTRIPE_OPTIONS\fR]]
118              ... <\fIfilename>\fR
119 .br
120 .B lfs setstripe --component-add \fB-E\fR <\fIend1> [\fISTRIPE_OPTIONS]
121              [\fB--component-end\fR|\fB-E \fR<\fIend2\fR> [\fISTRIPE_OPTIONS\fR]]
122              ... <\fIfilename\fR>
123 .br
124 .B lfs setstripe --component-del \fR{\fB--component-id\fR|\fB-I \fR<\fIid\fR> |
125                                \fB--component-flags \fR<\fIflags\fR>}
126 <\fIfilename\fR>
127 .br
128 .B lfs setstripe --yaml=\fR<\fIyaml_template_file\fR> <\fIfilename\fR>
129 .br
130 .B lfs unlink_foreign
131 .IR path \fR[\fIpath\fR ...]
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 COMMANDS
145 A number of sub-commands supported by lfs are listed below.  Other commands
146 are described in separate man pages of the form
147 .BI lfs- command
148 as listed in the
149 .B SEE ALSO
150 section at the end.
151 .TP
152 .B check <mgts|mdts|osts|all> [path]
153 Display the status of the MGTs, MDTs or OSTs (as specified in the command) or
154 all the servers (MGTs, MDTs and OSTs). If \fBpath\fR is provided, display
155 the status of the lustre file system mounted at specified \fBpath\fR only.
156 .TP
157 .B data_version [-nrw] <filename>
158 Display the current version of file data. If -n is specified, the data version
159 is read without taking a lock. As a consequence, the data version could be
160 outdated if there are dirty caches on filesystem clients, but this option will
161 not force data flushes and has less of an impact on the filesystem. If -r is
162 specified, the data version is read after dirty pages on clients are flushed. If
163 -w is specified, the data version is read after all caching pages on clients are
164 flushed.
165
166 Even with -r or -w, race conditions are possible and the data version should be
167 checked before and after an operation to be confident the data did not change
168 during it.
169
170 The data version is the sum of the last committed transaction numbers of all
171 data objects of a file. It is used by HSM policy engines for verifying that file
172 data has not been changed during an archive operation or before a release
173 operation, and by OST migration, primarily for verifying that file data has not
174 been changed during a data copy, when done in non-blocking mode.
175 .TP
176 .B flushctx
177 See lfs-flushctx(1).
178 .TP
179 .B osts
180 .RB [ path ]
181 List all the OSTs for all mounted filesystems. If a \fBpath\fR is provided
182 that is located on a lustre mounted file system then only the OSTs belonging
183 to that filesystem are displayed.
184 .TP
185 .B pool_list
186 .RI { filesystem }[ .poolname "] | {" pathname }
187 List the pools in
188 .I filesystem
189 or
190 .IR pathname ,
191 or the OSTs in
192 .IR filesystem.pool .
193 .TP
194 .B swap_layouts <filename1> <filename2>
195 Swap the data (layout and OST objects) of two regular files. The
196 two files have to be in the same filesystem, owned by the same user,
197 reside on the same MDT and writable by the user.
198
199 Swapping the layout of two directories is not permitted.
200 .TP
201 .B mkdir
202 lfs mkdir is documented in the man page: lfs-mkdir(1). NOTE:
203 .B lfs setdirstripe
204 is an alias of the command
205 .B lfs mkdir
206 .TP
207 .B mv
208 lfs mv is deprecated, use lfs
209 .B migrate
210 instead.
211 .TP
212 .B migrate
213 See lfs-migrate(1).
214 .TP
215 .B setstripe
216 See lfs-setstripe(1).
217 .TP
218 .B unlink_foreign
219 Remove the foreign files/dirs that are prevented to be using regular unlink/rmdir commands/syscalls. Works also for regular files/dirs.
220 .TP
221 .B --version
222 Output the build version of the lfs utility. Use "lctl lustre_build_version" to get the version of the Lustre kernel modules
223 .TP
224 .B --list-commands
225 Output a list of the commands supported by the lfs utility
226 .TP
227 .B help
228 Provides brief help on the various arguments
229 .TP
230 .B exit/quit
231 Quit the interactive lfs session
232 .SH EXAMPLES
233 .TP
234 .B $ lfs check all
235 Check the status of all servers (MGT, MDT, OST)
236 .TP
237 .B $ lfs osts
238 List all the OSTs
239 .TP
240 .B $ lfs mdts
241 List all the MDTs
242 .TP
243 .B $ lfs quotaoff -ug /mnt/lustre
244 Turn quotas of user and group off
245 .SH NOTES
246 The usage of \fBlfs find\fR, \fBlfs getstripe\fR, \fBlfs hsm_*\fR,
247 \fBlfs setstripe\fR, \fBlfs migrate\fR, \fBlfs getdirstripe\fR,
248 \fBlfs setdirstripe\fR, \fBlfs mkdir\fR, \fBlfs flushctx\fR,
249 \fBlfs changelog\fR, \fBlfs changelog_clear\fR
250 and \fBlfs project\fR are explained in separate man pages.
251 .SH AUTHOR
252 The lfs command is part of the Lustre filesystem.
253 .SH SEE ALSO
254 .BR lctl (8),
255 .BR lfs-changelog (1),
256 .BR lfs-changelog_clear (1),
257 .BR lfs-df (1),
258 .BR lfs-fid2path (1),
259 .BR lfs-find (1),
260 .BR lfs-flushctx (1),
261 .BR lfs-getdirstripe (1),
262 .BR lfs-getname (1),
263 .BR lfs-getstripe (1),
264 .BR lfs-hsm (1),
265 .BR lfs_migrate (1),
266 .BR lfs-migrate (1),
267 .BR lfs-mkdir (1),
268 .BR lfs-path2fid (1),
269 .BR lfs-pcc (1),
270 .BR lfs-project (1),
271 .BR lfs-quota (1),
272 .BR lfs-setdirstripe (1),
273 .BR lfs-setquota (1),
274 .BR lfs-setstripe (1),
275 .BR lustre (7)