1 .TH LFS-SETSTRIPE 1 2017-08-23 "Lustre" "Lustre Utilities"
3 lfs-setstripe \- set striping pattern of a file or directory default
5 .B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR] \fIDIRECTORY\fR|\fIFILENAME\fR
7 .B lfs setstripe -E \fICOMP_END\fR [\fISTRIPE_OPTIONS\fR] ... \
8 \fIDIRECTORY\fR|\fIFILENAME\fR
10 .B lfs setstripe --comp-add -E \fICOMP_END\fR [\fISTRIPE_OPTIONS\fR] ... \
13 .B lfs setstripe --comp-del \fR[\fB-I \fICOMP_ID\fR|\
14 \fB--comp-flags=\fICOMP_FLAGS\fR] \fIFILENAME\fR
16 .B lfs setstripe --comp-set \fR[\fB-I \fICOMP_ID\fR|\
17 \fB--comp-flags=\fICOMP_FLAGS\fR] \fIFILENAME\fR
19 .B lfs setstripe -N\fR[\fIMIRROR_COUNT\fR] \fR[\fISTRIPE_OPTIONS\fR] \fIDIRECTORY\fR|\fIFILENAME\fR
21 .B lfs setstripe -d \fR\fIDIRECTORY\fR
23 .B lfs setstripe --yaml=\fR\fIYAML_TEMPLATE_FILE.LYL\fR \fIFILENAME\fR
25 .B lfs setstripe --copy=\fR\fISOURCE_TEMPLATE_FILE\fR \fIFILENAME\fR
27 .B lfs setstripe --foreign\fR[\fB=\fR\fIFOREIGN_TYPE\fR] \
28 \fR[\fB--flags=\fR\fIHEX\fR] \fB--xattr=\fR\fILAYOUT_STRING\fR \fIFILENAME\fR
34 command is used to create a new
36 in a Lustre filesystem with the specified layout, or to specify the default
37 layout for new files created in
39 or anywhere in the filesystem if
41 is the filesystem root and no other layout takes precedence.
43 Files with composite layouts allow different
45 to be specified for non-overlapping extents of the file. Files will
46 inherit options not explicitly specified on the command line either from
47 the default layout on the parent directory, or from the filesystem-wide
48 default. New subdirectories created under root directory will not explicitly
49 copy the default layout at creation time, but will implicitly inherit the
50 default layout at runtime. The default layout set on a non-root directory
51 will be copied to any new subdirectories created within that directory
52 at the time they are created.
54 .B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR ...] \fIDIRECTORY\fR|\fIFILENAME\fR
57 with specified plain layout using the specified
59 or replace the default file layout on an existing
62 .B lfs setstripe -E \fIEND_OFFSET\fR [\fISTRIPE_OPTIONS\fR] ... \
63 \fIDIRECTORY\fR|\fIFILENAME\fR
65 Create a new composite
67 with one or more component layouts (where \fIEND_OFFSET\fR marks the end of the
68 current component), or set or replace the default file layout on an existing
71 .B lfs setstripe --component-add -E \fIEND_OFFSET\fR [\fISTRIPE_OPTIONS\fR] \
74 Add one or more components after the last component of an existing composite
75 file that does not yet have a component at
78 .B lfs setstripe --comp-del \fR[\fB-I \fICOMP_ID\fR | \
79 \fB--comp-flags \fICOMP_FLAGS\fR] \fIFILENAME\fR
80 Remove the component(s) specified by component ID or flags from
83 .B lfs setstripe --comp-set \fR[\fB-I \fICOMP_ID\fR | \
84 \fB--comp-flags \fICOMP_FLAGS\fR] \fIFILENAME\fR
87 on the specified component. This command can be only
88 be applied to mirrored files.
90 .B lfs setstripe -N \fR[\fIMIRROR_COUNT\fR] \fR[\fICOMPONENT_OPTIONS\fR] \fIDIRECTORY\fR|\fIFILENAME\fR
93 with the specified number of mirrors and other specified layout options, or
94 set or replace the default file layout on an existing
97 .B lfs setstripe -d \fR\fIDIRECTORY\fR
99 Delete the default layout on the specified directory. It is not necessary
100 to delete the default layout on a directory before replacing it, only if
101 the directory should revert from a directory-specific default layout
102 to using the global filesystem default layout stored on the root directory.
104 .B lfs setstripe --yaml=\fR\fIYAML_TEMPLATE_FILE.LYL\fR \fIFILENAME\fR
108 using the Lustre YAML Layout template
109 .IR YAML_TEMPLATE_FILE.LYL ,
114 .B lfs getstripe --yaml \fR\fIEXISTING_FILE\fR > \fIYAML_TEMPLATE_FILE.LYL\fR
116 .I YAML_TEMPLATE_FILE.LYL
117 is a plain-text file that may be saved and/or modified after creation.
118 This allows complex file layouts to be created once and re-used later.
120 .B lfs setstripe --copy=\fR\fISOURCE_TEMPLATE_FILE\fR \fIFILENAME\fR
124 using the same layout as an existing
125 .IR SOURCE_TEMPLATE_FILE .
126 This is similar to the
128 option but avoids the need for the intermediate
132 .B lfs setstripe --foreign[=\fR\fIFOREIGN_TYPE\fR\fB] \
133 [--flags=\fR\fIHEX\fR\fB] --xattr=\fR\fILAYOUT_STRING\fR \fIFILENAME\fR
137 with a foreign/non-lustre layout of type
138 .I FOREIGN_TYPE \fR(\fBnone\fR, \fBdaos\fR, ...)
141 and a free-format layout value of
144 The various OST stripe related options are listed and explained below:
146 .B -c\fR, \fB--stripe-count \fR\fISTRIPE_COUNT\fR
147 The number of OSTs to stripe a file over. \fB0 \fRmeans to use the
148 filesystem-wide default stripe count (default 1), and \fB-1 \fRmeans to stripe
149 over all available OSTs.
151 .B -C\fR, \fB--overstripe-count \fR\fISTRIPE_COUNT\fR
152 The number of stripes to create, creating > 1 stripe per OST if count exceeds
153 the number of OSTs in the file system. \fB0 \fRmeans to use the filesystem-wide
154 default stripe count (default 1), and \fB range -1 to -32\fRmeans to stripe
155 over all available OSTs in multiple of OST count. For example, \fB-1\fR means
156 one stripe per OST, -2 means two stripes per OST, and so on.
158 .B -S\fR, \fB--stripe-size \fR\fISTRIPE_SIZE\fR
159 The number of bytes to store on each OST before moving to the next OST. A
162 means the file should use the filesystem-wide default stripe size
163 (default 4MiB). An optional suffix can be used to specify the units in
169 must be a multiple of 64KiB. Values below 4096 are assumed to be in KiB units.
171 .B -i\fR, \fB--stripe-index \fR\fISTART_OST_IDX\fR
172 The OST index (starting at 0) on which to start striping for this file. A
176 allows the MDS to choose the starting index and it is strongly recommended, as
177 this allows space and load balancing to be done by the MDS as needed.
180 The type of layout for that component, which can be one of:
182 .B raid0\fR - stripe the file data across
183 \fISTRIPE_COUNT\fR OST objects in units of
184 \fISTRIPE_SIZE\fR chunks. This is the default layout if not specified.
187 .B mdt\fR - place the first component of the file data on the MDT for faster
188 access where the inode is located. This can be used for small files, and with
189 composite file layouts. The
191 type may only be used for first component of a file. The
193 of the MDT component is always equal to the component size. There is also a
194 per-MDT tunable parameter
195 .IR lod.dom_stripesize
196 that limits the maximum size of a DoM stripe. It can be changed on the MDS via
197 .B lctl set_param lod.*.dom_stripesize=\fR\fISTRIPE_SIZE\fR ,
200 must be a multiple of 64KiB in size,
206 .B -o\fR, \fB--ost \fR\fIOST_IDX\fR
207 Used to specify the exact stripe layout on the file system. \fIOST_IDX\fR
208 is a list of OSTs referenced by their indices, which are specified in decimal
209 or hex form and can be obtained using the
211 command. The list format consists of individual OST indices and index ranges
212 separated by commas, e.g. 1,2-4,7. The
214 option may be specified multiple times to stripe across the union of all listed
217 option is combined with
221 must agree with the number of OSTs in
225 option is combined with
229 must be in the OST list, and it will be used as the index on which to start
230 striping the file. Otherwise the striping will occur in the order specified in
233 .B -p\fR, \fB--pool \fR\fIPOOL_NAME\fR
234 Allocate objects from the predefined OST pool
236 for the layout of this file or component. The
241 can be used to select a subset of the OSTs within the pool; the
243 must be part of the pool or an error will be returned.
244 It is possible to specify a different pool for each component of a file. If
245 no pool is specified, it will be inherited from the previous component (for
246 later components of a composite layout) or the parent or root directory (for
249 layouts, or the first component of a composite file).
252 to force a component without a pool set (no inheritance from last component,
257 .BR pool_name=inherit
258 (since Lustre 2.15) to force a component to inherit the pool from the parent
259 or root directory instead of the previous component.
261 .B --foreign \fR[\fIFOREIGN_TYPE\fR]
262 file layout is non-lustre/free-format and of type
264 , if specified (see also
269 Current known types are
276 .B -x\fR, \fB--xattr \fR\fILAYOUT_STRING\fR
277 Mandatory non-lustre/free-format layout/LOV EA content for
281 .B -F\fR, \fB--flags \fR\fIHEX\fR
282 Optional bitmap of flags for foreign type.
283 .SH COMPONENT_OPTIONS
284 The various component related options are listed and explained below. The
286 options can be shortened to
290 .B -E\fR, \fB--component-end \fR\fIEND_OFFSET\fR
291 Add a new component to a file using the
295 argument. These options apply to the component ending at offset
297 in bytes, or by using a suffix (KMGTP) to specify base-two units,
298 such as 256M for 2^28 bytes. An offset of
302 means the following options extend to the end of the file. The first
303 component starts at offset 0, and each subsequent component starts at
304 the end of the previous component, so they must be specified in increasing
305 file offset order, and must be a multiple of 64KiB to align with the
308 value. Values below 4096 are assumed to be in KiB units.
311 The first component specified will inherit default parameters from the
312 parent directory or the root directory like a plain layout, as specified
313 above. Later components will inherit the default layout parameters from
314 the previous component. Multiple
316 options are used to separate the
318 parameters for different regions of the file.
322 If a file does not have a component extending to
324 it will generate an error when trying to write beyond the last component
326 This can be useful to limit the size of a file to the end of the last
327 specified component, or use
329 to add more components to the end of the file.
332 .B -z, --extension-size, --ext-size\fR \fIEXT_SIZE\fR
333 This option modifies the \fB-E\fR option, components which have this
334 option specified are created as pairs of components, extendable and
338 The extendable component starts at offset 0 if this is the first
339 component of the file. In this case it ends at offset \fIEXT_SIZE\fR and
340 it gets the flag \fBinit\fR (initialized). The extendable component starts
341 at the end of the previous component if this is not the first component of
342 the file. In this case it ends at the same offset (0-length component).
344 The extension component covers the rest of the specified region up to
345 the \fIEND_OFFSET\fR specified by \fB-E\fR option and gets
346 the flag \fBextension\fR.
347 This component covers the space reserved for the extendable component but
348 not used immediately, the later extension of the extendable component is done
349 by \fIEXT_SIZE\fR each time until the extension component is used up. This is
350 used to control the space on OSTs the stripe is located on, in case one of
351 them is low on space, the remaining extension component region is added to the
356 Add components to the end an existing composite file. It is not possible
357 to add components incrementally to the default directory layout, since the
358 entire default layout can be replaced with a single
360 command. Adding components to mirrored files is not currently allowed.
363 Delete specified the components from an existing file using either the
364 .BR --component-id | -I
366 .BR --component-flags .
367 Deletion must start with the last component. The ID specified by the
369 option is the numerical unique ID of the component, it can be obtained using
372 command. It is not possible to delete components from a default directory
373 layout, since the entire default layout can be replaced with a single
376 The \fB--component-flags\fR option is used to specify certain type of
377 components. The only allowed component flag for deleting a component is
379 to indicate an uninstantiated component. Deleting a single component from
380 mirrored files is not currently allowed, see the
381 .BR lfs-mirror-split (1)
384 .B --component-flags \fR\fICOMP_FLAGS\fR
387 on a specific component. Allowed
391 .B * init\fR - component is initialized (has allocated objects). Used with
392 .B --component-del --component-flags ^init
393 to find uninitialized components.
396 .B * prefer\fR - component preferred for read/write in a mirrored file
399 .B * prefrd\fR - component preferred for read in a mirrored file
402 .B * prefwr\fR - component preferred for write in a mirrored file
405 .B * stale\fR - component has outdated data in a mirrored file. This flag is
406 not allowed to be set on a component of the last non-stale mirror.
407 Once a component is marked
409 it isn't permitted to clear this flag directly. \fBlfs-mirror-resync\fR(1)
410 is required to clear the flag.
413 .B * nosync\fR - mirror components will not be resynched by default when the
414 .BR lfs-mirror-resync (1)
415 command is run. This option is useful to freeze a file mirror as an old
416 version or snapshot of the file.
419 A leading '^' before \fIflags\fR clears the flags, or finds components not
420 matching the flags. Multiple flags can be separated by comma(s).
423 .B -I\fR, \fB--component-id \fR\fICOMP_ID\fR
424 The numerical unique component ID to identify a component to be modified.
426 .BR -N, \fB--mirror-count \fR[\fIMIRROR_COUNT\fR]
429 identical replicas on the file or directory. The
431 argument is optional and defaults to 1 if it's not specified; if specified,
434 option without a space. The maximum possible value for the mirror count is 16.
436 The \fISTRIPE_OPTIONS\fR specify the specific layout for the mirror. It
437 can be a plain layout with specific striping pattern or a composite layout.
438 If not specified, the stripe options are inherited from the previous
439 component. If there is no previous component, the
443 options are inherited from filesystem-wide default values, and OST
445 will be inherited from the parent directory.
449 options may be specified, each with its own
451 if there is a reason to have different layouts for the replicas, such as
452 flash pools and archive pools (see
453 .BR lfs-mirror-create (1)
457 that in the current client implementation, only
459 replica will be written by client nodes, and the other replicas need to
460 be resynched using the
462 command, or an external resync agent.
465 .B lfs setstripe -S 128K -c 2 /mnt/lustre/file1
466 This creates a file striped on two OSTs with 128KiB on each stripe.
468 .B lfs setstripe -d /mnt/lustre/dir
469 This deletes a default stripe pattern on dir. New files created in that
470 directory will use the filesystem global default instead.
472 .B lfs setstripe -N2 -E 1M -E eof -c -1 /mnt/lustre/dir1
473 This sets a default mirror layout on a directory with 2 PFL mirrors. Each mirror
474 has the same specified PFL layout.
476 .B lfs setstripe -N -E 1M -L mdt -E eof --component-flags=prefer -p flash \
477 -N -E 1G -c 1 -p disk -E eof -c -1 /mnt/lustre/file1
478 This creates a mirrored file with 2 replicas. The first replica is using the
479 MDT for files smaller than 1MB, and the remainder of the file is on the
481 OST pool with filesystem-wide default values. The second replica is on the
483 OST pool, with 1 stripe for the first 1GB of the file, and striped across
485 .B disk pool for the remainder of the file. Clients will
487 the first (flash) replica for both reads and writes.
489 .B lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1
490 This creates a file with composite layout, the component has 1 stripe and
491 covers [0, 4MiB), the second component has 4 stripes and covers [4MiB, 64MiB),
492 the last component stripes over all available OSTs and covers [64MiB, EOF).
494 .B lfs setstripe -E -1 -z 64M /mnt/lustre/file1
495 This creates a file with a composite layout, the component one covers [0, 64MiB)
496 and the second component the rest [64MiB, EOF) originally. Once written beyond
497 64MiB the component one is extended to [0, 128MiB), once written beyond 128MiB
498 it is extended to [0, 192MiB), etc; the second component is shortened
502 When one of the OSTs of the first component layout is low on space, e.g. while
503 writing beyond 192MiB, the first component is left as [0, 192MiB), and a new
504 component is allocated between them, its layout repeats the first component
505 layout but initialized on different OSTs so that the full OSTs are avoided.
506 It is allocated and immediately extended to [192MiB, 256MiB), the following
507 extension component is shortened again.
510 .B lfs setstripe -E 1G -z 64M -E 100G -z 256M -E -1 -z 1G /mnt/lustre/file1
511 This creates a file with a composite layout, the component one covers [0,
512 64MiB), the third component covers [1G, 1G), the fifth component covers
513 [100GiB, 100GiB) originally. The second, fourth and sixth extension components
514 cover the left space accordingly. The process of writing is similar to above,
515 but when one of the OSTs of the first component layout is low on space, e.g.
516 while writing beyond 192MiB in the example above, the first component is left
517 as [0, 192MiB), the second (extension) component is removed, and its range
518 spills over to the third and the fourth components - they are moved left to
519 start at 192MiB instead of 100GiB; the third component is immediately extended
520 and becomes [192MiB, 448MiB), the fourth (the extension one) component becomes
523 .B lfs setstripe --component-add -E eof -c 4 /mnt/lustre/file1
524 This add a component which starts at the end of last existing component to
527 .B lfs setstripe --component-del -I 1 /mnt/lustre/file1
528 This deletes the component with ID equal to 1 from an existing file.
530 .B lfs setstripe --comp-set -I 1 --comp-flags=^prefer,stale /mnt/lustre/file1
531 This command will clear the \fBprefer\fR flag and set the \fBstale\fR flag on
535 .B lfs setstripe -E 1M -L mdt -E -1 /mnt/lustre/file1
538 with Data-on-MDT layout. The first 1MiB of the file data is placed on the
539 MDT and rest of file is placed on OST(s) with default striping.
541 .B lfs setstripe --yaml=/tmp/layout_yaml /mnt/lustre/file2
544 with layout stored in the layout template
547 which can be created with the
548 .B lfs getstripe --yaml
551 .B lfs setstripe --foreign=symlink --flags=0xda08 \
552 --xattr=PUUID:CUUID /mnt/lustre/file1
557 with non-lustre/free-format
559 layout/LOV EA and flags
566 .BR lfs-mirror-create (1),
567 .BR lfs-mirror-split (1),