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 \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR]
8 [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
10 .B lfs setstripe --component-add \fR{\fB--component-end\fR|\fB-E \fIend1\fR}
11 [\fISTRIPE_OPTIONS\fR] [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR]
12 \&...] <\fIfilename\fR>
14 .B lfs setstripe --component-del \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR|
15 .B --component-flags=\fIcomp_flags\fR} <\fIfilename\fR>
17 .B lfs setstripe --component-set \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR|
18 .B --component-flags=\fIcomp_flags\fR} <\fIfilename\fR>
20 .B lfs setstripe -d \fR<\fIdirectory\fR>
24 .B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR>
25 Create a file with specified layout, or set or replace the default file
26 layout on an existing directory. If the default file layout is set on
27 the filesystem root directory, it will be used as the filesystem-wide
28 default layout for all files that do not explicitly specify a layout and
29 do not have a default layout on the parent directory. The default layout
30 set on a directory will be copied to any new subdirectories created within
31 that directory at the time they are created.
33 .B lfs setstripe \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR] \
34 [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
36 Create a file with the specified composite layout. Each component defines the
37 stripe pattern of the file in the range of
38 .RI [ start ", " end ].
39 The first component implicitly starts at offset 0, and all later components
40 start at the end of previous extent. The
42 option is used to specify the end offset of each component, and it also
43 indicates the following \fISTRIPE_OPTIONS\fR are for this component. The end
48 indicates the component extends to the end of file.
50 .B lfs setstripe --component-add \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR] \
51 [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
53 Add components to an existing composite file. The extent start of the first
54 component to be added is equal to the extent end of last component in existing
55 file, and all components to be added must be adjacent with each other. It is
56 not possible to add components incrementally to the default directory layout,
57 since the entire default layout can be replaced with one
61 Adding a component to FLR files is not allowed.
63 .B lfs setstripe --component-del \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR | \
64 \fB--component-flags \fIcomp_flags\fR} <\fIfilename\fR>
66 Remove the component(s) specified by component ID or flags from an existing
67 file. The ID specified by the
69 option is the numerical unique ID of the component, it can be obtained using
72 command. It is not possible to delete components from a default directory
73 layout, since the entire default layout can be replaced with one
76 The \fB--component-flags\fR option is used to specify certain type of
77 components, such as all instantiated ones. Available component flags for
78 deleting a component would be:
82 instantiated component.
84 A leading '^' in front of the \fIflags\fR means inverted flags.
86 Deleting a component from FLR files is not allowed.
89 .B lfs setstripe --component-set \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR | \
90 \fB--component-flags \fIcomp_flags\fR} <\fIfilename\fR>
91 Set or clear \fIflags\fR to the specified component. This command can be only
92 be applied to FLR files. Available \fIflags\fR are:
96 indicates the data in the corresponding component is not available for I/O.
97 Once a component is set to stale, a \fBlfs-mirror-resync\fR(1) is required to
101 set this flag to the corresponding component so that Lustre would prefer to
102 choose the specified component for I/O.
104 A leading '^' means to clear the corresponding flag. It doesn't allow to clear
108 .B lfs setstripe -d \fR<\fIdirectory\fR>
110 Delete the default layout on the specified directory. It is not necessary
111 to delete the default layout on a directory before replacing it. This is
112 only needed if the directory should revert from a directory-specific layout
113 to using the global filesystem default layout stored on the root directory.
115 The various stripe related options are listed and explained below:
117 .B -c\fR, \fB--stripe-count \fR<\fIstripe_count\fR>
118 The number of OSTs to stripe a file over. \fB0 \fRmeans to use the
119 filesystem-wide default stripe count (default 1), and \fB-1 \fRmeans to stripe
120 over all available OSTs.
122 .B -S\fR, \fB--stripe-size \fR<\fIstripe_size\fR>
123 The number of bytes to store on each OST before moving to the next OST. \fB0\fR
124 means to use the filesystem-wide default stripe_size (default 1MB).
126 .B -i\fR, \fB--stripe-index \fR<\fIstart_ost_index\fR>
127 The OST index (starting at 0) on which to start striping for this file. \fB-1\fR
128 allows the MDS to choose the starting index and it is strongly recommended, as
129 this allows space and load balancing to be done by the MDS as needed.
131 .B -o\fR, \fB--ost-list \fR<\fIost_indices\fR>
132 Used to specify the exact stripe layout on the file system. \fIost_indices\fR
133 is a list of OSTs referenced by their indices, which are specified in decimal
134 or hex form and can be obtained using the
136 command. The list format consists of individual OST indices and index ranges
137 separated by commas, e.g. 1,2-4,7. The
139 option may be specified multiple times to stripe across the union of all listed
142 option is combined with
146 must agree with the number of OSTs in
150 option is combined with
154 must be in the OST list, and it will be used as the index on which to start
155 striping the file. Otherwise the striping will occur in the order specified in
158 .B -p\fR, \fB--pool \fR<\fIpool_name\fR>
159 The name of a predefined pool of OSTs (see
161 that will be used for striping. The
166 will be used as well; the
168 must be part of the pool or an error will be returned.
169 If <\fIpool_name\fR> is
171 , then the OST pool name will be cleared and inherit from parent directory.
173 .B -L, --layout <\fIlayout type\fB>\fR
174 The type of stripe layout, can be
175 .BR raid0 ", " released " or " mdt ".
180 type allows place the first component of the file on the MDT where the inode
181 is located. This is used with composite file layouts and can be defined as
182 first component only. The
184 of MDT part is always equal to the component size. There is also per-MDT
186 .IR lod.dom_stripesize
187 to limit maximum size of DoM stripe which can be changed with
190 .IR lctl\ set_param\ lod.*.dom_stripesize=0
194 There are two options available only for \fBlfs migrate\fR:
197 Block file access during data migration (default).
200 Abort migrations if concurrent access is detected.
201 .SH COMPONENT_OPTIONS
202 The various component related options are listed and explained below:
204 .B -E\fR,\fB--component-end \fR< \fIend\fR>
205 The end offset of the component,
207 is specified in bytes, or using a suffix (kMGTP),
208 such as 256M. \fB-1\fR means the end of file.
210 .B -I\fR, \fB--component-id \fR<\fIcomp_id\fR>
211 The numerical unique component id.
213 .B --component-flags \fR<\fIflags\fR>
214 Component flags. Available \fIflags\fR:
217 .B init\fR: instantiated component.
220 .B prefer\fR: preferred component, for FLR only.
223 .B stale\fR: stale component, for FLR only.
226 A leading '^' means inverted flag. Multiple flags can be separated by comma(s).
230 Add specified components to an existing composite file.
233 Delete specified the components from an existing file. Deletion must start
234 with the last component.
237 .B $ lfs setstripe -S 128k -c 2 /mnt/lustre/file1
238 This creates a file striped on two OSTs with 128kB on each stripe.
240 .B $ lfs setstripe -d /mnt/lustre/dir
241 This deletes a default stripe pattern on dir. New files created in that
242 directory will use the filesystem global default instead.
244 .B $ lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1
245 This creates a file with composite layout, the component has 1 stripe and \
246 covers [0, 4M), the second component has 4 stripes and covers [4M, 64M), the \
247 last component stripes over all available OSTs and covers [64M, EOF).
249 .B $ lfs setstripe --component-add -E -1 -c 4 /mnt/lustre/file1
250 This add a component which start from the end of last existing component to \
253 .B $ lfs setstripe --component-del -I 1 /mnt/lustre/file1
254 This deletes the component with ID equals 1 from an existing file.
256 .B $ lfs setstripe --component-set -I 1 --component-flags=^prefer,stale /mnt/lustre/file1
257 This command will clear the \fBprefer\fR flag and set the \fBstale\fR to
260 .B $ lfs setstripe -E 1M -L mdt -E -1 /mnt/lustre/file1
261 This created file with Data-on-MDT layout. The first 1M is placed on MDT and \
262 rest of file is placed on OST with default striping.