| LFS-SETSTRIPE(1) | Lustre Utilities | LFS-SETSTRIPE(1) |
NAME
lfs-setstripe - set striping pattern of a file or directory default
SYNOPSIS
lfs setstripe [STRIPE_OPTIONS]
DIRECTORY|FILENAME
lfs setstripe -E COMP_END [STRIPE_OPTIONS] ...
DIRECTORY|FILENAME
lfs setstripe --comp-add -E COMP_END [STRIPE_OPTIONS] ...
FILENAME
lfs setstripe --comp-del [-I
COMP_ID|--comp-flags=COMP_FLAGS]
FILENAME
lfs setstripe --comp-set [-I
COMP_ID|--comp-flags=COMP_FLAGS]
FILENAME
lfs setstripe -N[MIRROR_COUNT] [STRIPE_OPTIONS]
DIRECTORY|FILENAME
lfs setstripe -d DIRECTORY
lfs setstripe --yaml=YAML_TEMPLATE_FILE.LYL FILENAME
lfs setstripe --copy=SOURCE_TEMPLATE_FILE FILENAME
lfs setstripe --foreign[=FOREIGN_TYPE]
[--flags=HEX] --xattr=LAYOUT_STRING
FILENAME
DESCRIPTION
The lfs setstripe command is used to create a new FILENAME in a Lustre filesystem with the specified layout, or to specify the default layout for new files created in DIRECTORY, or anywhere in the filesystem if DIRECTORY is the filesystem root and no other layout takes precedence.
Files with composite layouts allow different STRIPE_OPTIONS to be specified for non-overlapping extents of the file. Files will inherit options not explicitly specified on the command line either from the default layout on the parent directory, or from the filesystem-wide default. New subdirectories created under root directory will not explicitly copy the default layout at creation time, but will implicitly inherit the default layout at runtime. The default layout set on a non-root directory will be copied to any new subdirectories created within that directory at the time they are created. Setstripe can be restricted to privileged users (withCAP_SYS_RESOURCE, see setcap(8)) by setting the parameter llite.*.enable_setstripe_gid=0, to an administrator group (e.g. wheel) by using its numeric group ID, or -1 to permit all users this functionality (the default).
- lfs setstripe [STRIPE_OPTIONS ...] DIRECTORY|FILENAME
- Create a new FILENAME with specified plain layout using the specified STRIPE_OPTIONS, or replace the default file layout on an existing DIRECTORY.
- lfs setstripe -E END_OFFSET [STRIPE_OPTIONS] ... DIRECTORY|FILENAME
-
Create a new composite FILENAME with one or more component layouts (where END_OFFSET marks the end of the current component), or set or replace the default file layout on an existing DIRECTORY. - lfs setstripe --component-add -E END_OFFSET [STRIPE_OPTIONS] ... FILENAME
-
Add one or more components after the last component of an existing composite file that does not yet have a component at eof. - lfs setstripe --comp-del [-I COMP_ID | --comp-flags COMP_FLAGS] FILENAME
- Remove the component(s) specified by component ID or flags from FILENAME.
- lfs setstripe --comp-set [-I COMP_ID | --comp-flags COMP_FLAGS] FILENAME
- Set or clear COMP_FLAGS on the specified component. This command can be only be applied to mirrored files.
- lfs setstripe -N [MIRROR_COUNT] [COMPONENT_OPTIONS] DIRECTORY|FILENAME
- Create a new FILENAME with the specified number of mirrors and other specified layout options, or set or replace the default file layout on an existing DIRECTORY.
- lfs setstripe -d DIRECTORY
-
Delete the default layout on the specified directory. It is not necessary to delete the default layout on a directory before replacing it, only if the directory should revert from a directory-specific default layout to using the global filesystem default layout stored on the root directory. - lfs setstripe --yaml=YAML_TEMPLATE_FILE.LYL FILENAME
-
Create a new FILENAME using the Lustre YAML Layout template YAML_TEMPLATE_FILE.LYL, created from EXISTING_FILE via:
lfs getstripe --yaml EXISTING_FILE > YAML_TEMPLATE_FILE.LYL
YAML_TEMPLATE_FILE.LYL is a plain-text file that may be saved and/or modified after creation. This allows complex file layouts to be created once and re-used later. - lfs setstripe --copy=SOURCE_TEMPLATE_FILE FILENAME
-
Create a new file using the same layout as an existing SOURCE_TEMPLATE_FILE. This is similar to the --yaml option but avoids the need for the intermediate .lyl file. - lfs setstripe --foreign[=FOREIGN_TYPE] [--flags=HEX] --xattr=LAYOUT_STRING FILENAME
-
Create a new FILENAME with a foreign/non-lustre layout of type FOREIGN_TYPE (none, daos, ...) with flags HEX and a free-format layout value of LAYOUT_STRING.
STRIPE_OPTIONS
The various OST stripe related options are listed and explained below:
- -c, --stripe-count STRIPE_COUNT
- The number of OSTs to stripe a file over. 0 means to use the filesystem-wide default stripe count (default 1), and -1 means to stripe over all available OSTs.
- -C, --overstripe-count STRIPE_COUNT
- The number of stripes to create, creating > 1 stripe per OST if count exceeds the number of OSTs in the file system. 0 means to use the filesystem-wide default stripe count (default 1), and range -1 to -32means to stripe over all available OSTs in multiple of OST count. For example, -1 means one stripe per OST, -2 means two stripes per OST, and so on.
- -S, --stripe-size STRIPE_SIZE
- The number of bytes to store on each OST before moving to the next OST. A stripe size of 0 means the file should use the filesystem-wide default stripe size (default 4MiB). An optional suffix can be used to specify the units in Kibi-, Mebi-, or Gibibytes. The STRIPE_SIZE must be a multiple of 64KiB. Values below 4096 are assumed to be in KiB units.
- -i, --stripe-index START_OST_IDX
- The OST index (starting at 0) on which to start striping for this file. A START_OST_IDX of -1 allows the MDS to choose the starting index and it is strongly recommended, as this allows space and load balancing to be done by the MDS as needed.
- -L, --layout LAYOUT_TYPE
- The type of layout for that component, which can be one of:
- -o, --ost OST_IDX
- Used to specify the exact stripe layout on the file system. OST_IDX is a list of OSTs referenced by their indices, which are specified in decimal or hex form and can be obtained using the lfs osts command. The list format consists of individual OST indices and index ranges separated by commas, e.g. 1,2-4,7. The -o option may be specified multiple times to stripe across the union of all listed OSTs. If the -c option is combined with -o the STRIPE_COUNT must agree with the number of OSTs in OST_IDX. If the -i option is combined with -o the START_OST_IDX must be in the OST list, and it will be used as the index on which to start striping the file. Otherwise the striping will occur in the order specified in OST_IDX.
- -p, --pool POOL_NAME
- Allocate objects from the predefined OST pool POOL_NAME for the layout of this file or component. The STRIPE_COUNT, STRIPE_SIZE, and START_OST_IDX can be used to select a subset of the OSTs within the pool; the START_OST_IDX must be part of the pool or an error will be returned. It is possible to specify a different pool for each component of a file. If no pool is specified, it will be inherited from the previous component (for later components of a composite layout) or the parent or root directory (for plain raid0 layouts, or the first component of a composite file). Use pool_name=ignore to force a component without a pool set (no inheritance from last component, root or parent). Use pool_name='' or pool_name=inherit (since Lustre 2.15) to force a component to inherit the pool from the parent or root directory instead of the previous component.
- --foreign [FOREIGN_TYPE]
- file layout is non-lustre/free-format and of type FOREIGN_TYPE , if specified (see also --xattr and --flags options). Current known types are none and symlink , default is none -x, --xattr LAYOUT_STRING Mandatory non-lustre/free-format layout/LOV EA content for foreign file.
- -F, --flags HEX
- Optional bitmap of flags for foreign type.
COMPONENT_OPTIONS
The various component related options are listed and explained below. The --component-* options can be shortened to --comp-* if desired.
- -E, --component-end END_OFFSET
- Add a new component to a file using the STRIPE_OPTIONS following the -E argument. These options apply to the component ending at offset END_OFFSET in bytes, or by using a suffix (KMGTP) to specify base-two units, such as 256M for 2^28 bytes. An offset of -1 or eof means the following options extend to the end of the file. The first component starts at offset 0, and each subsequent component starts at the end of the previous component, so they must be specified in increasing file offset order, and must be a multiple of 64KiB to align with the minimum STRIPE_SIZE value. Values below 4096 are assumed to be in KiB units.
- -z, --extension-size, --ext-size EXT_SIZE
- This option modifies the -E option, components which have this option specified are created as pairs of components, extendable and extension ones.
The extension component covers the rest of the specified region up to the END_OFFSET specified by -E option and gets the flag extension. This component covers the space reserved for the extendable component but not used immediately, the later extension of the extendable component is done by EXT_SIZE each time until the extension component is used up. This is used to control the space on OSTs the stripe is located on, in case one of them is low on space, the remaining extension component region is added to the next component.
- --ec, --ec-stripe-count DATA_STRIPES+PARITY_STRIPES
- Enable Erasure Coding (EC) for the file or directory layout by specifying the number of DATA_STRIPES per RAID Set and PARITY_STRIPES per RAID Set in the format DATA+PARITY or DATA:PARITY. For example, --ec 8+2 specifies RAID Sets with 8 data stripes and 2 parity stripes each, providing fault tolerance for up to 2 OST failures per RAID Set.
The current EC implementation is "read-only" or "offline" erasure coding. Any write operation to the file causes the parity mirror to become stale. While stale, the parity information cannot be used for data reconstruction. The parity mirror must be resynchronized using the lfs-mirror-resync(1) command to bring it back into sync with the data mirror. Once resynchronized, the parity mirror provides protection for read operations, allowing data recovery in case of OST failures. This behavior is identical to how non-parity Lustre mirrors work. See lfs-mirror-create(1) and lfs-mirror-resync(1) for more information on mirror operations.
For data components with STRIPE_COUNT greater than DATA_STRIPES, the data component's stripes are divided into one or more independent RAID sets, each containing at most DATA_STRIPES data stripes, each with PARITY_STRIPES parity stripes. Each RAID Set is an independent protection domain. For example, a 16-stripe RAID0 data component with --ec 8+2 is divided into 2 RAID Sets of 8+2 (requiring 4 total parity stripes in two independent domains). A 15-stripe data component with --ec 8+2 is divided into one 8+2 RAID set and one 7+2 RAID Set.
The DATA_STRIPES value must be at least 2, and PARITY_STRIPES must be at least 1 and less than or equal to DATA_STRIPES. The supported limits are 32 data stripes and 4 parity stripes. The sum DATA_STRIPES + PARITY_STRIPES must not exceed 256. This is a theoretical limit of the underlying Cauchy matrix construction over GF(2^8) and applies even with --ec-expert.
For 1-stripe components the EC mirror will be created with only 1 parity stripe (ie. only single device redundancy). If 2 (or more) device redundancy is required for all components, then files should be created with STRIPE_COUNT=2 (or more) data stripes.
EC Option Inheritance and Order Independence
The --ec option can appear anywhere in the command line and applies to all components within the same mirror to ensure the file data can be recovered even when PARITY_STRIPES OSTs used by the file have failed. When a single --ec option is specified, it applies to all components in the parity mirror. When multiple --ec options are used, each one inherits to subsequent components until it is replaced by another --ec option. The first --ec option applies to any components earlier in the command.
The --ec option is per-mirror and only applies within a single mirror definition (specified by -N). Different mirrors can have different EC configurations or no EC at all.
- --ec-expert
- Equivalent to --ec but allows EC stripe counts that exceed the supported limits of 32 data stripes or 4 parity stripes. This option is intended for expert users who understand the performance and reliability implications, or for testing purposes.
- --component-add
- Add components to the end an existing composite file. It is not possible to add components incrementally to the default directory layout, since the entire default layout can be replaced with a single lfs setstripe command. Adding components to mirrored files is not currently allowed.
- --component-del
- Delete specified the components from an existing file using either the --component-id|-I or --component-flags. Deletion must start with the last component. The ID specified by the -I option is the numerical unique ID of the component, it can be obtained using the lfs getstripe -I command. It is not possible to delete components from a default directory layout, since the entire default layout can be replaced with a single lfs setstripe call. The --component-flags option is used to specify certain type of components. The only allowed component flag for deleting a component is ^init to indicate an uninstantiated component. Deleting a single component from mirrored files is not currently allowed, see the lfs-mirror-split(1) command.
- --component-flags COMP_FLAGS
- Find, set, or clear flags on a specific component. Allowed flags are:
- -I, --component-id COMP_ID
- The numerical unique component ID to identify a component to be modified.
- -N,--mirror-count[MIRROR_COUNT]
- Create a file with MIRROR_COUNT identical replicas on the file or
directory. The MIRROR_COUNT argument is optional and defaults to 1
if it's not specified; if specified, it must follow the -N option
without a space. The maximum possible value for the mirror count is 16.
The STRIPE_OPTIONS specify the specific layout for the mirror. It can be a plain layout with specific striping pattern or a composite layout. If not specified, the stripe options are inherited from the previous component. If there is no previous component, the STRIPE_COUNT and STRIPE_SIZE options are inherited from filesystem-wide default values, and OST POOL_NAME will be inherited from the parent directory.
Multiple -N options may be specified, each with its own STRIPE_OPTIONS if there is a reason to have different layouts for the replicas, such as flash pools and archive pools (see lfs-mirror-create(1) for full details).
NOTE that in the current client implementation, only one replica will be written by client nodes, and the other replicas need to be resynched using the lfs mirror resync command, or an external resync agent.
EXAMPLES
- lfs setstripe -S 128K -c 2 /mnt/lustre/file1
- This creates a file striped on two OSTs with 128KiB on each stripe.
- lfs setstripe -d /mnt/lustre/dir
- This deletes a default stripe pattern on dir. New files created in that directory will use the filesystem global default instead.
- lfs setstripe -N2 -E 1M -E eof -c -1 /mnt/lustre/dir1
- This sets a default mirror layout on a directory with 2 PFL mirrors. Each mirror has the same specified PFL layout.
- lfs setstripe -N -E 1M -L mdt -E eof --component-flags=prefer -p flash -N -E 1G -c 1 -p disk -E eof -c -1 /mnt/lustre/file1
- This creates a mirrored file with 2 replicas. The first replica is using the MDT for files smaller than 1MB, and the remainder of the file is on the flash OST pool with filesystem-wide default values. The second replica is on the disk OST pool, with 1 stripe for the first 1GB of the file, and striped across all OSTs in the disk pool for the remainder of the file. Clients will prefer the first (flash) replica for both reads and writes.
- lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1
- This creates a file with composite layout, the component has 1 stripe and covers [0, 4MiB), the second component has 4 stripes and covers [4MiB, 64MiB), the last component stripes over all available OSTs and covers [64MiB, EOF).
- lfs setstripe -E -1 -z 64M /mnt/lustre/file1
- This creates a file with a composite layout, the component one covers [0, 64MiB) and the second component the rest [64MiB, EOF) originally. Once written beyond 64MiB the component one is extended to [0, 128MiB), once written beyond 128MiB it is extended to [0, 192MiB), etc; the second component is shortened appropriately.
- lfs setstripe -E 1G -z 64M -E 100G -z 256M -E -1 -z 1G /mnt/lustre/file1
- This creates a file with a composite layout, the component one covers [0, 64MiB), the third component covers [1G, 1G), the fifth component covers [100GiB, 100GiB) originally. The second, fourth and sixth extension components cover the left space accordingly. The process of writing is similar to above, but when one of the OSTs of the first component layout is low on space, e.g. while writing beyond 192MiB in the example above, the first component is left as [0, 192MiB), the second (extension) component is removed, and its range spills over to the third and the fourth components - they are moved left to start at 192MiB instead of 100GiB; the third component is immediately extended and becomes [192MiB, 448MiB), the fourth (the extension one) component becomes [448MiB, 100GiB).
- lfs setstripe --component-add -E eof -c 4 /mnt/lustre/file1
- This add a component which starts at the end of last existing component to the end of file.
- lfs setstripe --component-del -I 1 /mnt/lustre/file1
- This deletes the component with ID equal to 1 from an existing file.
- lfs setstripe --comp-set -I 1 --comp-flags=^prefer,stale /mnt/lustre/file1
- This command will clear the prefer flag and set the stale flag on file1 component ID 1.
- lfs setstripe -E 1M -L mdt -E -1 /mnt/lustre/file1
- Create file1 with Data-on-MDT layout. The first 1MiB of the file data is placed on the MDT and rest of file is placed on OST(s) with default striping.
- lfs setstripe --yaml=/tmp/layout_yaml /mnt/lustre/file2
- This creates file2 with layout stored in the layout template file layout_yaml which can be created with the lfs getstripe --yaml command.
- lfs setstripe --foreign=symlink --flags=0xda08 --xattr=PUUID:CUUID /mnt/lustre/file1
- This creates foreign file1 of type symlink with non-lustre/free-format PUUID:CUUID layout/LOV EA and flags 0xda08
- lfs setstripe -E -1 -c 8 --ec 8+2 /mnt/lustre/file1
- This creates file1 with an Erasure Coding layout using 8 data stripes and 2 parity stripes. The file will have two mirrors: a data mirror with 8 stripes and a parity mirror with the erasure coding information. Since the data component has 8 stripes and the EC specification is 8+2, this creates a single RAID Set with 8 data stripes and 2 parity stripes, providing fault tolerance for up to 2 OST failures with 25% storage overhead.
- lfs setstripe --ec 8+2 -E -1 -c 8 /mnt/lustre/file1a
- This is equivalent to the previous example, demonstrating if only a single --ec option is specified, it applies to all components.
- lfs setstripe -E 1G -c 4 --ec 4+2 -E -1 -c 8 --ec 8+2 /mnt/lustre/file2
- This creates file2 with a composite EC layout. The first component (0 to 1GiB) uses 4 data stripes with 2 parity stripes (4+2 EC), and the second component (1GiB to EOF) uses 8 data stripes with 2 parity stripes (8+2 EC). Each component has both data and parity mirrors.
- lfs setstripe -E 128M --ec 8+2 -E -1 -c 4 /mnt/lustre/file2a
- This creates file2a with a composite EC layout where a single --ec 8+2 applies to all components. Both the first component (0 to 128MiB) and the second component (128MiB to EOF) will use 8+2 EC, demonstrating that one --ec option applies to all components in the parity mirror.
- lfs setstripe -E 128M --ec 4+2 -E 512M -E -1 --ec 8+2 /mnt/lustre/file2b
- This creates file2b with three components demonstrating multiple --ec options. The first component (0 to 128MiB) uses 4+2 EC. The second component (128MiB to 512MiB) also uses 4+2 EC (inherited from the first --ec). The third component (512MiB to EOF) uses 8+2 EC, as specified by the second --ec option.
- lfs setstripe -E -1 -c 16 --ec 8+2 /mnt/lustre/file3
- This creates file3 with 16 data stripes divided into 2 independent RAID Sets. Each RAID Set contains 8 data stripes and 2 parity stripes (8+2), for a total of 4 parity stripes across both RAID Sets. Each RAID Set can tolerate up to 2 OST failures independently.
- lfs setstripe -E -1 -c 20 --ec 8+2 /mnt/lustre/file3a
- This creates file3a with 20 data stripes; this does not evenly divide into 8+2 RAID Sets. The stripes are automatically divided into multiple RAID Sets of optimal size: two 7+2 RAID Sets (14 data stripes, 4 parity stripes) and one 6+2 RAID Set (6 data stripes, 2 parity stripes). This maintains the requested level of redundancy while creating RAID Sets which are as close to the requested dimensions as possible.
- lfs setstripe -E -1 -c 256 --ec-expert 64+4 /mnt/lustre/file4
- This creates file4 with an EC layout that exceeds the supported limits (32 data stripes, 4 parity stripes). The --ec-expert option allows the use of up to 255 data stripes and up to 15 parity stripes per RAID Set. With 256 data stripes and 64+4 EC, this creates four 64+4 RAID Sets, for a total of 16 parity stripes. This is intended for advanced users who understand the performance and reliability implications.
- lfs setstripe -N -E 128M -E -1 --ec 8+2 -N -E 256M -E -1 /mnt/lustre/file5
- This creates file5 with two mirrors. The first mirror has two components with 8+2 EC applied to both. The second mirror has two components with no EC (plain RAID0). This demonstrates that --ec is per-mirror: the --ec 8+2 only applies to the first mirror (between the first and second -N), and does not affect the second mirror.
- lfs setstripe -E -1 -c 8 --ec 8+2 /mnt/lustre/dir1
- This sets the default EC layout on dir1 so that new files created in this directory will automatically use an 8+2 EC layout with 8 data stripes and 2 parity stripes.
SEE ALSO
lctl(1), lfs(1), lfs-migrate(1), lfs-mirror-create(1), lfs-mirror-split(1), lustre(7) setcap(8)
| 2017-08-23 | Lustre |