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-1 \fRmeans to stripe over all
157 .B -S\fR, \fB--stripe-size \fR\fISTRIPE_SIZE\fR
158 The number of bytes to store on each OST before moving to the next OST. A
161 means the file should use the filesystem-wide default stripe size
162 (default 4MiB). An optional suffix can be used to specify the units in
168 must be a multiple of 64KiB. Values below 4096 are assumed to be in KiB units.
170 .B -i\fR, \fB--stripe-index \fR\fISTART_OST_IDX\fR
171 The OST index (starting at 0) on which to start striping for this file. A
175 allows the MDS to choose the starting index and it is strongly recommended, as
176 this allows space and load balancing to be done by the MDS as needed.
179 The type of layout for that component, which can be one of:
181 .B raid0\fR - stripe the file data across
182 \fISTRIPE_COUNT\fR OST objects in units of
183 \fISTRIPE_SIZE\fR chunks. This is the default layout if not specified.
186 .B mdt\fR - place the first component of the file data on the MDT for faster
187 access where the inode is located. This can be used for small files, and with
188 composite file layouts. The
190 type may only be used for first component of a file. The
192 of the MDT component is always equal to the component size. There is also a
193 per-MDT tunable parameter
194 .IR lod.dom_stripesize
195 that limits the maximum size of a DoM stripe. It can be changed on the MDS via
196 .B lctl set_param lod.*.dom_stripesize=\fR\fISTRIPE_SIZE\fR ,
199 must be a multiple of 64KiB in size,
205 .B -o\fR, \fB--ost \fR\fIOST_IDX\fR
206 Used to specify the exact stripe layout on the file system. \fIOST_IDX\fR
207 is a list of OSTs referenced by their indices, which are specified in decimal
208 or hex form and can be obtained using the
210 command. The list format consists of individual OST indices and index ranges
211 separated by commas, e.g. 1,2-4,7. The
213 option may be specified multiple times to stripe across the union of all listed
216 option is combined with
220 must agree with the number of OSTs in
224 option is combined with
228 must be in the OST list, and it will be used as the index on which to start
229 striping the file. Otherwise the striping will occur in the order specified in
232 .B -p\fR, \fB--pool \fR\fIPOOL_NAME\fR
233 Allocate objects from the predefined OST pool
235 for the layout of this file or component. The
240 can be used to select a subset of the OSTs within the pool; the
242 must be part of the pool or an error will be returned.
243 It is possible to specify a different pool for each component of a file. If
244 no pool is specified, it will be inherited from the previous component (for
245 later components of a composite layout) or the parent or root directory (for
248 layouts, or the first component of a composite file).
251 to force a component without a pool set (no inheritance from last component,
256 .BR pool_name=inherit
257 (since Lustre 2.15) to force a component to inherit the pool from the parent
258 or root directory instead of the previous component.
260 .B --foreign \fR[\fIFOREIGN_TYPE\fR]
261 file layout is non-lustre/free-format and of type
263 , if specified (see also
268 Current known types are
275 .B -x\fR, \fB--xattr \fR\fILAYOUT_STRING\fR
276 Mandatory non-lustre/free-format layout/LOV EA content for
280 .B -F\fR, \fB--flags \fR\fIHEX\fR
281 Optional bitmap of flags for foreign type.
282 .SH COMPONENT_OPTIONS
283 The various component related options are listed and explained below. The
285 options can be shortened to
289 .B -E\fR, \fB--component-end \fR\fIEND_OFFSET\fR
290 Add a new component to a file using the
294 argument. These options apply to the component ending at offset
296 in bytes, or by using a suffix (KMGTP) to specify base-two units,
297 such as 256M for 2^28 bytes. An offset of
301 means the following options extend to the end of the file. The first
302 component starts at offset 0, and each subsequent component starts at
303 the end of the previous component, so they must be specified in increasing
304 file offset order, and must be a multiple of 64KiB to align with the
307 value. Values below 4096 are assumed to be in KiB units.
310 The first component specified will inherit default parameters from the
311 parent directory or the root directory like a plain layout, as specified
312 above. Later components will inherit the default layout parameters from
313 the previous component. Multiple
315 options are used to separate the
317 parameters for different regions of the file.
321 If a file does not have a component extending to
323 it will generate an error when trying to write beyond the last component
325 This can be useful to limit the size of a file to the end of the last
326 specified component, or use
328 to add more components to the end of the file.
331 .B -z, --extension-size, --ext-size\fR \fIEXT_SIZE\fR
332 This option modifies the \fB-E\fR option, components which have this
333 option specified are created as pairs of components, extendable and
337 The extendable component starts at offset 0 if this is the first
338 component of the file. In this case it ends at offset \fIEXT_SIZE\fR and
339 it gets the flag \fBinit\fR (initialized). The extendable component starts
340 at the end of the previous component if this is not the first component of
341 the file. In this case it ends at the same offset (0-length component).
343 The extension component covers the rest of the specified region up to
344 the \fIEND_OFFSET\fR specified by \fB-E\fR option and gets
345 the flag \fBextension\fR.
346 This component covers the space reserved for the extendable component but
347 not used immediately, the later extension of the extendable component is done
348 by \fIEXT_SIZE\fR each time until the extension component is used up. This is
349 used to control the space on OSTs the stripe is located on, in case one of
350 them is low on space, the remaining extension component region is added to the
355 Add components to the end an existing composite file. It is not possible
356 to add components incrementally to the default directory layout, since the
357 entire default layout can be replaced with a single
359 command. Adding components to mirrored files is not currently allowed.
362 Delete specified the components from an existing file using either the
363 .BR --component-id | -I
365 .BR --component-flags .
366 Deletion must start with the last component. The ID specified by the
368 option is the numerical unique ID of the component, it can be obtained using
371 command. It is not possible to delete components from a default directory
372 layout, since the entire default layout can be replaced with a single
375 The \fB--component-flags\fR option is used to specify certain type of
376 components. The only allowed component flag for deleting a component is
378 to indicate an uninstantiated component. Deleting a single component from
379 mirrored files is not currently allowed, see the
380 .BR lfs-mirror-split (1)
383 .B --component-flags \fR\fICOMP_FLAGS\fR
386 on a specific component. Allowed
390 .B * init\fR - component is initialized (has allocated objects). Used with
391 .B --component-del --component-flags ^init
392 to find uninitialized components.
395 .B * prefer\fR - component preferred for read/write in a mirrored file
398 .B * prefrd\fR - component preferred for read in a mirrored file
401 .B * prefwr\fR - component preferred for write in a mirrored file
404 .B * stale\fR - component has outdated data in a mirrored file. This flag is
405 not allowed to be set on a component of the last non-stale mirror.
406 Once a component is marked
408 it isn't permitted to clear this flag directly. \fBlfs-mirror-resync\fR(1)
409 is required to clear the flag.
412 .B * nosync\fR - mirror components will not be resynched by default when the
413 .BR lfs-mirror-resync (1)
414 command is run. This option is useful to freeze a file mirror as an old
415 version or snapshot of the file.
418 A leading '^' before \fIflags\fR clears the flags, or finds components not
419 matching the flags. Multiple flags can be separated by comma(s).
422 .B -I\fR, \fB--component-id \fR\fICOMP_ID\fR
423 The numerical unique component ID to identify a component to be modified.
425 .BR -N, \fB--mirror-count \fR[\fIMIRROR_COUNT\fR]
428 identical replicas on the file or directory. The
430 argument is optional and defaults to 1 if it's not specified; if specified,
433 option without a space. The maximum possible value for the mirror count is 16.
435 The \fISTRIPE_OPTIONS\fR specify the specific layout for the mirror. It
436 can be a plain layout with specific striping pattern or a composite layout.
437 If not specified, the stripe options are inherited from the previous
438 component. If there is no previous component, the
442 options are inherited from filesystem-wide default values, and OST
444 will be inherited from the parent directory.
448 options may be specified, each with its own
450 if there is a reason to have different layouts for the replicas, such as
451 flash pools and archive pools (see
452 .BR lfs-mirror-create (1)
456 that in the current client implementation, only
458 replica will be written by client nodes, and the other replicas need to
459 be resynched using the
461 command, or an external resync agent.
464 .B lfs setstripe -S 128K -c 2 /mnt/lustre/file1
465 This creates a file striped on two OSTs with 128KiB on each stripe.
467 .B lfs setstripe -d /mnt/lustre/dir
468 This deletes a default stripe pattern on dir. New files created in that
469 directory will use the filesystem global default instead.
471 .B lfs setstripe -N2 -E 1M -E eof -c -1 /mnt/lustre/dir1
472 This sets a default mirror layout on a directory with 2 PFL mirrors. Each mirror
473 has the same specified PFL layout.
475 .B lfs setstripe -N -E 1M -L mdt -E eof --component-flags=prefer -p flash \
476 -N -E 1G -c 1 -p disk -E eof -c -1 /mnt/lustre/file1
477 This creates a mirrored file with 2 replicas. The first replica is using the
478 MDT for files smaller than 1MB, and the remainder of the file is on the
480 OST pool with filesystem-wide default values. The second replica is on the
482 OST pool, with 1 stripe for the first 1GB of the file, and striped across
484 .B disk pool for the remainder of the file. Clients will
486 the first (flash) replica for both reads and writes.
488 .B lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1
489 This creates a file with composite layout, the component has 1 stripe and
490 covers [0, 4MiB), the second component has 4 stripes and covers [4MiB, 64MiB),
491 the last component stripes over all available OSTs and covers [64MiB, EOF).
493 .B lfs setstripe -E -1 -z 64M /mnt/lustre/file1
494 This creates a file with a composite layout, the component one covers [0, 64MiB)
495 and the second component the rest [64MiB, EOF) originally. Once written beyond
496 64MiB the component one is extended to [0, 128MiB), once written beyond 128MiB
497 it is extended to [0, 192MiB), etc; the second component is shortened
501 When one of the OSTs of the first component layout is low on space, e.g. while
502 writing beyond 192MiB, the first component is left as [0, 192MiB), and a new
503 component is allocated between them, its layout repeats the first component
504 layout but initialized on different OSTs so that the full OSTs are avoided.
505 It is allocated and immediately extended to [192MiB, 256MiB), the following
506 extension component is shortened again.
509 .B lfs setstripe -E 1G -z 64M -E 100G -z 256M -E -1 -z 1G /mnt/lustre/file1
510 This creates a file with a composite layout, the component one covers [0,
511 64MiB), the third component covers [1G, 1G), the fifth component covers
512 [100GiB, 100GiB) originally. The second, fourth and sixth extension components
513 cover the left space accordingly. The process of writing is similar to above,
514 but when one of the OSTs of the first component layout is low on space, e.g.
515 while writing beyond 192MiB in the example above, the first component is left
516 as [0, 192MiB), the second (extension) component is removed, and its range
517 spills over to the third and the fourth components - they are moved left to
518 start at 192MiB instead of 100GiB; the third component is immediately extended
519 and becomes [192MiB, 448MiB), the fourth (the extension one) component becomes
522 .B lfs setstripe --component-add -E eof -c 4 /mnt/lustre/file1
523 This add a component which starts at the end of last existing component to
526 .B lfs setstripe --component-del -I 1 /mnt/lustre/file1
527 This deletes the component with ID equal to 1 from an existing file.
529 .B lfs setstripe --comp-set -I 1 --comp-flags=^prefer,stale /mnt/lustre/file1
530 This command will clear the \fBprefer\fR flag and set the \fBstale\fR flag on
534 .B lfs setstripe -E 1M -L mdt -E -1 /mnt/lustre/file1
537 with Data-on-MDT layout. The first 1MiB of the file data is placed on the
538 MDT and rest of file is placed on OST(s) with default striping.
540 .B lfs setstripe --yaml=/tmp/layout_yaml /mnt/lustre/file2
543 with layout stored in the layout template
546 which can be created with the
547 .B lfs getstripe --yaml
550 .B lfs setstripe --foreign=symlink --flags=0xda08 \
551 --xattr=PUUID:CUUID /mnt/lustre/file1
556 with non-lustre/free-format
558 layout/LOV EA and flags
565 .BR lfs-mirror-create (1),
566 .BR lfs-mirror-split (1),