Whamcloud - gitweb
LU-14789 tests: make sanity 133f and 133g working
[fs/lustre-release.git] / lustre / doc / lfs-setstripe.1
index 5009354..b9a144a 100644 (file)
@@ -23,6 +23,9 @@ lfs setstripe \- set striping pattern of a file or directory default
 .B lfs setstripe --yaml=\fR<\fIyaml_template_file.lyl\fR> <\fIfile\fR>
 .br
 .B lfs setstripe --copy=\fR<\fIsource_template_file\fR> <\fIfile\fR>
+.br
+.B lfs setstripe --foreign[=\fR<\fIforeign_type\fR>\fB] \
+[--flags=\fR<\fIhex\fR>\fB] --xattr=\fR<\fIlayout_string\fR> <\fIfile\fR>
 .SH DESCRIPTION
 The
 .B lfs setstripe
@@ -40,8 +43,11 @@ Files with composite layouts allow different
 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.  The default layout set on a directory will be copied to any new
-subdirectories created within that directory at the time they are created.
+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.
 .TP
 .B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR ...] <\fIdirectory\fR|\fIfile\fR>
 Create a new
@@ -56,9 +62,9 @@ or replace the default file layout on an existing
 .br
 Create a new composite
 .I file
-with one or more component layouts, or set or replace the default file layout
-on an existing
-.IR directory .
+with one or more component layouts (where \fIend\fR marks the end of the
+current component), or set or replace the default file layout on an existing
+.IR directory.
 .TP
 .B lfs setstripe --component-add -E \fIend1\fR [\fISTRIPE_OPTIONS\fR] \
 ... <\fIfile\fR>
@@ -120,6 +126,18 @@ This is similar to the
 option but avoids the need for the intermediate
 .B .lyl
 file.
+.TP
+.B lfs setstripe --foreign[=\fR<\fIforeign_type\fR>\fB] \
+[--flags=\fR<\fIhex\fR>\fB] --xattr=\fR<\fIlayout_string\fR> <\fIfile\fR>
+.br
+Create a new
+.I file
+with a foreign/non-lustre layout of type
+.I foreign_type \fR(\fBnone\fR, \fBsymlink\fR, ...)
+with flags
+.I hex
+and a free-format layout value of
+.I layout_string.
 .SH STRIPE_OPTIONS
 The various OST stripe related options are listed and explained below:
 .TP
@@ -128,6 +146,12 @@ The number of OSTs to stripe a file over. \fB0 \fRmeans to use the
 filesystem-wide default stripe count (default 1), and \fB-1 \fRmeans to stripe
 over all available OSTs.
 .TP
+.B -C\fR, \fB--overstripe-count \fR<\fIstripe_count\fR>
+The number of stripes to create, creating > 1 stripe per OST if count exceeds
+the number of OSTs in the file system. \fB0 \fRmeans to use the filesystem-wide
+default stripe count (default 1), and \fB-1 \fRmeans to stripe over all
+available OSTs.
+.TP
 .B -S\fR, \fB--stripe-size \fR<\fIstripe_size\fR>
 The number of bytes to store on each OST before moving to the next OST. A
 stripe size of
@@ -139,7 +163,7 @@ means the file should use the filesystem-wide default stripe_size
 .BR G ibibytes.
 The
 .I stripe_size
-must be a multiple of 64KiB in size.
+must be a multiple of 64KiB.  Values below 4096 are assumed to be in KiB units.
 .TP
 .B -i\fR, \fB--stripe-index \fR<\fIstart_ost_index\fR>
 The OST index (starting at 0) on which to start striping for this file.  A
@@ -228,6 +252,29 @@ or
 .BR pool_name=none
 (since Lustre 2.11) to force a component to inherit the pool from the parent
 or root directory instead of the previous component.
+.TP
+.B --foreign \fR[<\fIforeign_type\fR>]
+file layout is non-lustre/free-format and of type <
+.IR foreign_type
+>, if specified (see also
+.IR --xattr
+and
+.IR --flags
+options).
+Current known types are
+.BR none
+and
+.BR symlink
+, default is
+.BR none
+.
+.B -x\fR, \fB--xattr \fR<\fIlayout_string\fR>
+Mandatory non-lustre/free-format layout/LOV EA content for
+.I foreign
+file.
+.TP
+.B -F\fR, \fB--flags \fR<\fIhex\fR>
+Optional bitmap of flags for foreign type.
 .SH COMPONENT_OPTIONS
 The various component related options are listed and explained below.  The
 .B --component-*
@@ -250,7 +297,10 @@ or
 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.
+file offset order, and must be a multiple of 64KiB to align with the
+minimum
+.I stripe_size
+value.  Values below 4096 are assumed to be in KiB units.
 .PP
 .RS
 The first component specified will inherit default parameters from the
@@ -274,6 +324,28 @@ specified component, or use
 to add more components to the end of the file.
 .RE
 .TP
+.B -z, --extension-size, ext-size\fR <\fIext_size\fR>
+This option modifies the \fB-E\fR option, components which have this
+option specified are created as pairs of components, extendable and
+extension ones.
+.PP
+.RS
+The extendable component starts at offset 0 if this is the first
+component of the file. In this case it ends at offset \fIext_size\fR and
+it gets the flag \fBinit\fR (initialized). The extendable component starts
+at the end of the previous component if this is not the first component of
+the file. In this case it ends at the same offset (0-length component).
+.PP
+The extension component covers the rest of the specified region up to
+the \fIend\fR specified by \fB-E\fR option and gets the flag \fBextension\fR.
+This component covers the space reserved for the extendable component but
+not used immediately, the later extension of the extendable component is done
+by \fIext_size\fR 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.
+.RE
+.TP
 .B --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
@@ -310,21 +382,28 @@ on a specific component. Allowed
 .I flags
 are:
 .RS
-.B init\fR - component is initialized (has allocated objects).  Used with
+.B init\fR - component is initialized (has allocated objects).  Used with
 .B --component-del --component-flags ^init
 to find uninitialized components.
 .RE
 .RS
-.B prefer\fR - component preferred for read/write in a mirrored file
+.B prefer\fR - component preferred for read/write in a mirrored file
 .RE
 .RS
-.B stale\fR - component has outdated data in a mirrored file.  Once a
-component is marked
+.B * stale\fR - component has outdated data in a mirrored file. This flag is
+not allowed to be set on a component of the last non-stale mirror.
+Once a component is marked
 .BR stale ,
 it isn't permitted to clear this flag directly. \fBlfs-mirror-resync\fR(1)
 is required to clear the flag.
 .RE
 .RS
+.B * nosync\fR - mirror components will not be resynched by default when the
+.BR lfs-mirror-resync (1)
+command is run. This option is useful to freeze a file mirror as an old
+version or snapshot of the file.
+.RE
+.RS
 A leading '^' before \fIflags\fR clears the flags, or finds components not
 matching the flags.  Multiple flags can be separated by comma(s).
 .RE
@@ -400,6 +479,35 @@ 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).
 .TP
+.B 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.
+.PP
+.RS
+When one of the OSTs of the first component layout is low on space, e.g. while
+writing beyond 192MiB, the first component is left as [0, 192MiB), and a new
+component is allocated between them, its layout repeats the first component
+layout but initialized on different OSTs so that the full OSTs are avoided.
+It is allocated and immediately extended to [192MiB, 256MiB), the following
+extension component is shortened again.
+.RE
+.TP
+.B 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).
+.TP
 .B 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.
@@ -427,6 +535,18 @@ file
 which can be created with the
 .B lfs getstripe --yaml
 command.
+.TP
+.B lfs setstripe --foreign=symlink --flags=0xda08 \
+       --xattr=PUUID:CUUID /mnt/lustre/file1
+This creates foreign
+.BR file1
+of type
+.BR symlink
+with non-lustre/free-format
+.BR PUUID:CUUID
+layout/LOV EA and flags
+.BR 0xda08
+.
 .SH SEE ALSO
 .BR lctl (1),
 .BR lfs (1),