Whamcloud - gitweb
LU-930 utils: add --help option to lfs sub-commands
[fs/lustre-release.git] / lustre / doc / lfs-getstripe.1
1 .TH lfs-getstripe 1 "2018-01-24" Lustre "user utilities"
2 .SH NAME
3 lfs getstripe \- Lustre client command to print layout parameters of a file
4 .SH SYNOPSIS
5 .B lfs getstripe
6 [\fB--component-count\fR|\fB--comp-count\fR]
7       [\fB--component-end\fR|\fB--comp-end\fR|\fB-E\fR[\fB=\fR[\fB+-\fR]\fIend\fR[\fBKMGTPE\fR]]
8       [\fB--component-flags\fR|\fB--comp-flags\fR[\fB=\fIflags\fR]]
9       [\fB--component-id\fR|\fB--comp-id\fR[=\fIid\fR]|\fB-I\fR[\fIid\fR]]
10       [\fB--component-start\fR[\fB=\fR[\fB+-\fR]\fIstart\fR[\fBKMGTPE\fR]]]
11       [\fB--extension-size\fR|\fB--ext-size\fR|\fB-z\fR]
12       [\fB--directory\fR|\fB-d\fR]
13 [\fB--fid\fR|\fB-F\fR]
14 [\fB--generation\fR|\fB-g\fR]
15 [\fB--help\fR|\fB-h\fR]
16       [\fB--layout\fR|\fB-L\fR]
17 [\fB--mdt\fR|\fB--mdt-index\fR|\fB-m\fR]
18 [\fB--ost\fR|\fB-O\fR <\fIuuid\fR>]
19       [\fB--pool\fR|\fB-p\fR]
20 [\fB--quiet\fR|\fB-q\fR]
21 [\fB--recursive\fR|\fB-r\fR]
22       [\fB--raw\fR|\fB-R\fR]
23 [\fB--stripe-count\fR|\fB-c\fR]
24 [\fB--stripe-index\fR|\fB-i\fR]
25       [\fB--stripe-size\fR|\fB-S\fR] [\fB--mirror-count\fR|\fB-N\fR]
26       [[\fB!\fR] \fB--mirror-index\fR=[\fB+-\fR]\fI<index>\fR | [\fB!\fR] \fB--mirror-id\fR=[\fB+-\fR]\fI<id>\fR]
27       [\fB--verbose\fR|\fB-v\fR]
28 [\fB--yaml\fR|\fB-y\fR]
29 <\fIdirname\fR|\fIfilename\fR> ...
30 .SH DESCRIPTION
31 .B lfs getstripe
32 is used to list the layout/striping information for a given filename or
33 directory tree.  By default the stripe_count, stripe_size, stripe_offset,
34 and allocated OST objects for each file will be shown. If you only want
35 specific layout information to be printed, then the
36 .BR --stripe-count ,
37 .BR --stripe-size ,
38 .BR --extension-size ,
39 .BR --stripe-index ,
40 .BR --layout ,
41 .BR --fid ,
42 .BR --generation ,
43 .BR --component-id ,
44 .BR --component-flags ,
45 .BR --component-count ,
46 .BR --component-start ,
47 .BR --component-end ,
48 .BR --pool
49 or
50 .BR --mirror-index
51 or
52 .BR --mirror-id
53 options, or equivalent single-character options, can be used without an
54 argument to return only the specified field(s).
55 .PP
56 You can limit the displayed content to one or more specific components or
57 mirror of a composite file layout by specifying the matching
58 parameter(s) for the
59 .BR --component-id ,
60 .BR --component-flags ,
61 .BR --component-start ,
62 .BR --component-end ,
63 .BR --mirror-index ,
64 or
65 .BR --mirror-id ,
66 or their single-character options. For single-character options, the
67 argument must follow the option without a space, and for long options an
68 .RB ' = '
69 sign must be used.
70 .PP
71 The default behavior when a directory is specified is to list the striping
72 information for all files within the specified directory (like
73 .RB ' "ls -l <directory>" ').
74 .SH OPTIONS
75 .TP
76 .BR --component-count | --comp-count
77 Print only the number of components in the file's layout.
78 .TP
79 .BR --component-end | --comp-end [ = [ +- ] \fIend [ KMGTPE ]]| -E [[ +- ] \fIend [ KMGTPE ]]
80 Print only the component end offset (in bytes) for the component(s).
81 If the component
82 .I end
83 offset is specified (with optional suffix for SI units), print only the
84 attributes of the component(s) with the given end offset.  If
85 .BI + end
86 or
87 .BI - end
88 is used, print components with respectively a larger or smaller
89 .I end
90 offset.
91 .TP
92 .BR --component-flags | --comp-flags [ = [ ^ ] \fIflag ,...]]
93 Print only the component flags.  If
94 .I flag
95 is specified, print only components matching the specified
96 .I flag
97 set.  If
98 .BI ^ flag
99 is used, print only components not matching
100 .IR flag .
101 Multiple flags may be specified, separated by commas.  Valid flag names are:
102 .RS 1.2i
103 .TP
104 .B init
105 Component has been initialized (has allocated OST objects).
106 .TP
107 .B stale
108 Replicated (mirrored) components that do not have up-to-date data.  Stale
109 components will not be used for read or write operations, and need to be
110 resynched using
111 .B lfs mirror resync
112 before they can be accessed again.
113 .TP
114 .B prefer
115 Replicated (mirrored) components that are preferred for read or write.
116 For example, because they are located on SSD-based OSTs, or are more
117 local on the network to clients.
118 .TP
119 .B nosync
120 Replicated (mirrored) components that do not resync using \fB
121 lfs mirror resync\fR.  Files with the \fBnosync\fR flag will also
122 print the timestamp when the flag was set on the replica.
123 .RE
124 .TP
125 .BR --component-id | --comp-id [ =\fIid ]| -I [ \fIid ]
126 Print only the component ID number for the component(s).  The file-unique
127 component ID is assigned as each component is created, and is not re-used.
128 The ID is
129 .B not
130 necessarily related to the offset of the component within the file, in
131 particular since replicated file layouts may have overlapping extents.
132 If
133 .I id
134 is specified, then print only the fields for the matching component.
135 .TP
136 .BR --component-start | --comp-start [ = [ +- ] \fIstart [ KMGTPE ]]
137 Print only the component start offset (in bytes) for the component(s).
138 If the component
139 .I start
140 offset is specified (with optional suffix for SI units), print only the
141 attributes of the component(s) with the given starting offset.  If
142 .BI + start
143 or
144 .BI - start
145 is used, print components with respectively a larger or smaller
146 .I start
147 offset.
148 .TP
149 .BR --directory | -d
150 Get striping information for only the specified directory, like
151 .RB ' "ls -d" '.
152 .TP
153 .BR --fid | -F
154 Show only the 128-bit unique Lustre File Identifier (FID).
155 .TP
156 .BR --generation | -g
157 Print only the layout generation number.
158 .TP
159 .BR --help | -h
160 Print usage message.
161 .TP
162 .BR --layout
163 Show only the file layout, which is one of:
164 .RS 1.2i
165 .TP
166 .B raid0
167 Traditional Lustre RAID-0 striping format.
168 .TP
169 .B released
170 HSM-archived files that are not resident in the filesystem.
171 .TP
172 .B mdt
173 Files that have the first data component on an MDT.
174 .RE
175 .TP
176 .BR --mdt | --mdt-index | -m
177 Show the MDT index on which the file or directory inode is located.
178 .TP
179 .BR --mirror-count | -N
180 Print the number of mirrors on the file.
181 .TP
182 .BR --mirror-index = [\fB+-\fR]\fR<\fIindex\fR>
183 Print only the components of \fI<index>\fR-th mirror, based on the order
184 that the mirror components are stored in the file layout. The \fIindex\fR
185 starts at 1. If
186 .BI + index
187 or
188 .BI - index
189 is used, print components of mirror(s) respectively later or earlier than
190 the \fIindex\fR-th mirror.
191 .RS 1.2i
192 .TP
193 .B !
194 Negates the meaning. Using + before \fIindex\fR means mirror appears 'later
195 than \fIindex\fR',
196 - before \fIindex\fR means mirror appears 'earlier than \fIindex\fR'. If
197 neither is used, it means 'equal to \fIindex\fR'.
198 .RE
199 .TP
200 .BR --mirror-id = [\fB+-\fR]\fR<\fIid\fR>
201 Print only the components of the mirror with ID of \fIid\fR. The mirror IDs
202 are assigned to new mirrors as they are created, but may not be sequential
203 if some mirrors are removed. If
204 .BI + id
205 or
206 .BI - id
207 is used, print components of mirror(s) with respectively a larger or smaller
208 mirror ID of
209 .I id
210 .
211 .RS 1.2i
212 .TP
213 .B !
214 Negates the meaning. Using + before \fIid\fR means mirror with ID 'larger
215 than \fIid\fR', - before \fIid\fR means mirror with ID 'smaller than \fIid\fR'.
216 If neither is used, it means 'equal to \fIid\fR'.
217 .RE
218 .TP
219 .BR --ost | -O
220 Print the starting OST index for the file layout.
221 .TP
222 .BR --pool | -p
223 Print only the OST pool name on which the file was created.
224 .TP
225 .BR --quiet | -q
226 Print only allocated objects for each file, not other layout parameters.
227 .TP
228 .BR --raw | -R
229 Print layout information without substituting the filesystem's default values
230 for unspecified fields. If the file layout is not set, 0, 0, and -1 will be
231 printed for the stripe_count, stripe_size, and stripe_offset respectively.
232 .TP
233 .BR --recursive | -r
234 Recurse into all subdirectories.
235 .TP
236 .BR --stripe-count | -c
237 Print the number of stripes in the file.  For composite files this is
238 the stripe count of the last initialized component.
239 .TP
240 .BR --stripe-index | -i
241 Print the starting OST index for the file layout.
242 .TP
243 .BR --stripe-size | -S
244 Print the stripe size in bytes.  For composite files this is the stripe
245 size of the last initialized component.
246 .TP
247 .BR --extension-size | --ext-size | -z
248 Print the extension size in bytes. For composite files this is the extension
249 size of the first extension component.
250 .TP
251 .BR --verbose | -v
252 Also print the layout magic, FID sequence, FID object ID, and FID, in
253 addition to the normally-printed attributes.
254 .TP
255 .BR --yaml | -y
256 Always print the layout in YAML format, rather than only using this
257 format for composite files.
258 .br
259 .SH EXAMPLES
260 .TP
261 .B $ lfs getstripe -v /mnt/lustre/file1
262 List the detailed object allocation of the given file.
263 .TP
264 .B $ lfs getstripe -v -I2 /mnt/lustre/file1
265 List the detailed information of only component with ID 2 of the given file.
266 .TP
267 .B $ lfs getstripe --mirror-index=+1 /mnt/lustre/file1
268 Print the mirror(s) appearing later than the first mirror in the the file.
269 .TP
270 .B $ lfs getstripe ! --mirror-id=2 /mnt/lustre/file1
271 Print the mirror(s) with mirror ID other than 2 in the file.
272 .TP
273 .B $ lfs getstripe --component-flags=^init -I /mnt/lustre/file1
274 Print only the component IDs for all the uninitialized components.
275 .TP
276 .B $ lfs getstripe --component-flags=init,^stale -I /mnt/lustre/file1
277 Print only the component(s) that are instantiated but not stale.
278 .TP
279 .B $ lfs getstripe -E-64M /mnt/lustre/file1
280 List information of components in a file with extent end less than 64MiB.
281 .TP
282 .B $ lfs getstripe -I3 --component-start /mnt/lustre/file1
283 Print only the component start for the component with ID of 3
284 .TP
285 .B $ lfs getstripe --yaml /mnt/lustre/file1
286 Lists the information of the components of a file in YAML format.
287 .SH AUTHOR
288 The lfs command is part of the Lustre filesystem.
289 .SH SEE ALSO
290 .BR lfs (1),
291 .BR lfs-find (1),
292 .BR lfs-getdirstripe (1),
293 .BR lfs-setstripe (1),
294 .BR lustre (7)