Whamcloud - gitweb
648e1f76b46e2cf07ce82d2b962b8a7a497871ba
[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--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 getname
49 .RB [ --help | -h "] [" --instance | -i "] [" --fsname | -n "] ["
50 .IR path ...]
51 .br
52 .B lfs getstripe
53 [\fB--component-count\fR|\fB--comp-count\fR]
54         [\fB--component-end\fR|\fB-E\fR[=[\fB+-\fR]\fIN\fR[\fBKMGTPE\fR]]
55         [\fB--component-flags\fR[=[\fB^\fR]\fIflag\fB,\fR...]]
56         [\fB--component-id\fR|\fB-I \fR[=\fIcomp_id\fR]]
57         [\fB--component-start\fR[=[\fB+-\fR]\fIN\fR[\fBKMGTPE\fR]]]
58         [\fB--directory\fR|\fB-d\fR]
59 [\fB--fid\fR|\fB-F\fR]
60 [\fB--generation\fR|\fB-g\fR]
61         [\fB--layout\fR|\fB-L\fR]
62 [\fB--mdt\fR|\fB--mdt-index\fR|\fB-m\fR]
63 [\fB--ost\fR|\fB-O\fR <\fIuuid\fR>]
64         [\fB--pool\fR|\fB-p\fR]
65 [\fB--quiet\fR|\fB-q\fR]
66 [\fB--recursive\fR|\fB-r\fR]
67         [\fB--raw\fR|\fB-R\fR]
68 [\fB--stripe-count\fR|\fB-c\fR]
69 [\fB--stripe-index\fR|\fB-i\fR]
70         [\fB--stripe-size\fR|\fB-S\fR]
71 [\fB--extension-size\fR|\fB--ext-size\fR|\fB-z\fR]
72         [\fB--verbose\fR|\fB-v\fR]
73 [\fB--yaml\fR|\fB-y\fR]
74         <\fIdirname\fR|\fIfilename\fR> ...
75 .br
76 .B lfs migrate \fR{\fB--mdt-index\fR|\fB-m\fR} <\fImdt_index\fR> \fIdirectory\fR
77 .br
78 .B lfs migrate \fR[\fB--stripe-count\fR|\fB-c\fR \fR<\fIstripe_count\fR>]
79             [\fB--stripe-index\fR|\fB-i\fR \fR<\fIstart_ost_idx\fR>]
80             [\fB--stripe-size\fR|\fB-S\fR \fR<\fIstripe_size\fR>]
81 [\fB--pool\fR|\fB-p\fR \fR<\fIpool_name\fR>]
82             [\fB-o\fR|\fB--ost-list \fR<\fIost_indices\fR>]
83 [\fB--block\fR|\fB-b\fR]
84             [\fB--non-block\fR|\fB-n\fR] <\fIfile\fR|\fIdirectory\fR>
85 .br
86 .B lfs migrate \fR<\fB--component-end\fR|\fB-E\fR \fIcomp_end1\fR>
87 [\fISTRIPE_OPTIONS\fR]
88             <\fB--component-end\fR|\fB-E\fR \fIcomp_end2\fR>
89 [\fISTRIPE_OPTIONS\fR]
90             ... \fIfilename\fR
91 .br
92 .B lfs mkdir \fR[\fB-c\fR|\fB--count \fR<\fIstripe_count\fR>]
93 [\fB-i\fR|\fB--index \fR<\fImdt_idx\fR>]
94           [\fB-h\fR|\fB--hash-type \fR<\fIhash_name\fR>]
95 [\fB-m\fR|\fB--mode \fR<\fImode\fR>]
96           [\fB-D\fR|\fB--default\fR] \fIdirectory\fR
97 .br
98 .B lfs osts \fR[<\fIpath\fR>]
99 .br
100 .B lfs mdts \fR[<\fIpath\fR>]
101 .br
102 .B lfs path2fid \fR[\fB--parents\fR] <\fIpath\fR> ...
103 .br
104 .B lfs pool_list \fR<\fIfilesystem\fR>[\fB.\fR<\fIpool\fR>] | <\fIpathname\fR>
105 .br
106 .B lfs setstripe \fR[\fB--stripe-size\fR|\fB-S <\fIsize\fR>] [\fB--stripe-count\fR|-c <\fIcount\fR>]
107         [\fB--stripe-index\fR|\fB-i <\fIstart_ost_index\fR>] [\fB--pool\fR|\fB-p \fR<\fIpoolname\fR>]
108         [\fB--extension-size\fR|\fB--ext-size\fR|\fB-z <\fIext_size\fR>]
109         [\fB--ost-list\fR|\fB-o <\fIost_indices\fR>] <\fIdirectory\fR|\fIfilename\fR>
110 .br
111 .B lfs setstripe -d \fR<\fIdir\fR>
112 .br
113 .B lfs setstripe --component-end\fR|\fB-E <\fIend1> [\fISTRIPE_OPTIONS\fR]
114              [\fB--component-end\fR|\fB-E \fR<\fIend2\fR> [\fISTRIPE_OPTIONS\fR]]
115              ... <\fIfilename>\fR
116 .br
117 .B lfs setstripe --component-add \fB-E\fR <\fIend1> [\fISTRIPE_OPTIONS]
118              [\fB--component-end\fR|\fB-E \fR<\fIend2\fR> [\fISTRIPE_OPTIONS\fR]]
119              ... <\fIfilename\fR>
120 .br
121 .B lfs setstripe --component-del \fR{\fB--component-id\fR|\fB-I \fR<\fIid\fR> |
122                                \fB--component-flags \fR<\fIflags\fR>}
123 <\fIfilename\fR>
124 .br
125 .B lfs setstripe --yaml=\fR<\fIyaml_template_file\fR> <\fIfilename\fR>
126 .br
127 .B lfs --version
128 .br
129 .B lfs --list-commands
130 .br
131 .B lfs help
132 .SH DESCRIPTION
133 .B lfs
134 can be used to create a new file with a specific striping pattern, determine
135 the default striping pattern, gather the extended attributes (object numbers
136 and location) for a specific file. It can be invoked interactively without any
137 arguments or in a non-interactive mode with one of the arguments supported.
138 .SH COMMANDS
139 A number of sub-commands supported by lfs are listed below.  Other commands
140 are described in separate man pages of the form
141 .BI lfs- command
142 as listed in the
143 .B SEE ALSO
144 section at the end.
145 .TP
146 .B changelog
147 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.
148 .TP
149 .B changelog_clear
150 Indicate that changelog records previous to <endrec> are no longer of
151 interest to a particular consumer <id>, potentially allowing the MDT to
152 free up disk space. An <endrec> of 0 indicates the current last record.
153 Changelog consumers must be registered on the MDT node using \fBlctl\fR.
154 .TP
155 .B check <mgts|mdts|osts|all>
156 Display the status of the MGTs, MDTs or OSTs (as specified in the command) or
157 all the servers (MGTs, MDTs 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 osts
179 .RB [ path ]
180 List all the OSTs for all mounted filesystems. If a \fBpath\fR is provided
181 that is located on a lustre mounted file system then only the OSTs belonging
182 to that filesystem are displayed.
183 .TP
184 .B pool_list
185 .RI { filesystem }[ .poolname "] | {" pathname }
186 List the pools in
187 .I filesystem
188 or
189 .IR pathname ,
190 or the OSTs in
191 .IR filesystem.pool .
192 .TP
193 .B swap_layouts <filename1> <filename2>
194 Swap the data (layout and OST objects) of two regular files. The
195 two files have to be in the same filesystem, owned by the same user,
196 reside on the same MDT and writable by the user.
197
198 Swapping the layout of two directories is not permitted.
199 .TP
200 .B mkdir
201 lfs mkdir is documented in the man page: lfs-mkdir(1). NOTE:
202 .B lfs setdirstripe
203 is an alias of the command
204 .B lfs mkdir
205 .TP
206 .B mv
207 lfs mv is deprecated, use lfs
208 .B migrate
209 instead.
210 .TP
211 .B migrate
212 See lfs-migrate(1).
213 .TP
214 .B setstripe
215 See lfs-setstripe(1).
216 .TP
217 .B --version
218 Output the build version of the lfs utility. Use "lctl lustre_build_version" to get the version of the Lustre kernel modules
219 .TP
220 .B --list-commands
221 Output a list of the commands supported by the lfs utility
222 .TP
223 .B help
224 Provides brief help on the various arguments
225 .TP
226 .B exit/quit
227 Quit the interactive lfs session
228 .SH EXAMPLES
229 .TP
230 .B $ lfs check all
231 Check the status of all servers (MGT, MDT, OST)
232 .TP
233 .B $ lfs osts
234 List all the OSTs
235 .TP
236 .B $ lfs mdts
237 List all the MDTs
238 .TP
239 .B $ lfs quotaoff -ug /mnt/lustre
240 Turn quotas of user and group off
241 .SH NOTES
242 The usage of \fBlfs find\fR, \fBlfs getstripe\fR, \fBlfs hsm_*\fR,
243 \fBlfs setstripe\fR, \fBlfs migrate\fR, \fBlfs getdirstripe\fR,
244 \fBlfs setdirstripe\fR, \fBlfs mkdir\fR, and \fBlfs project\fR are explained
245 in separate man pages.
246 .SH AUTHOR
247 The lfs command is part of the Lustre filesystem.
248 .SH SEE ALSO
249 .BR lctl (8),
250 .BR lfs-df (1),
251 .BR lfs-fid2path (1),
252 .BR lfs-find (1),
253 .BR lfs-getdirstripe (1),
254 .BR lfs-getname (1),
255 .BR lfs-getstripe (1),
256 .BR lfs-hsm (1),
257 .BR lfs-mkdir (1),
258 .BR lfs-migrate (1),
259 .BR lfs_migrate (1),
260 .BR lfs-project (1),
261 .BR lfs-path2fid (1),
262 .BR lfs-quota (1),
263 .BR lfs-setdirstripe (1),
264 .BR lfs-setquota (1),
265 .BR lfs-setstripe (1),
266 .BR lfs-pcc (1),
267 .BR lustre (7)