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>
22 .B lfs setstripe --yaml=<yaml_template_file> <filename>
26 .B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR>
27 Create a file with specified layout, or set or replace the default file
28 layout on an existing directory. If the default file layout is set on
29 the filesystem root directory, it will be used as the filesystem-wide
30 default layout for all files that do not explicitly specify a layout and
31 do not have a default layout on the parent directory. The default layout
32 set on a directory will be copied to any new subdirectories created within
33 that directory at the time they are created.
35 .B lfs setstripe \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR] \
36 [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
38 Create a file with the specified composite layout. Each component defines the
39 stripe pattern of the file in the range of
40 .RI [ start ", " end ].
41 The first component implicitly starts at offset 0, and all later components
42 start at the end of previous extent. The
44 option is used to specify the end offset of each component, and it also
45 indicates the following \fISTRIPE_OPTIONS\fR are for this component. The end
50 indicates the component extends to the end of file.
52 .B lfs setstripe --component-add \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR] \
53 [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
55 Add components to an existing composite file. The extent start of the first
56 component to be added is equal to the extent end of last component in existing
57 file, and all components to be added must be adjacent with each other. It is
58 not possible to add components incrementally to the default directory layout,
59 since the entire default layout can be replaced with one
63 Adding a component to FLR files is not allowed.
65 .B lfs setstripe --component-del \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR | \
66 \fB--component-flags \fIcomp_flags\fR} <\fIfilename\fR>
68 Remove the component(s) specified by component ID or flags from an existing
69 file. The ID specified by the
71 option is the numerical unique ID of the component, it can be obtained using
74 command. It is not possible to delete components from a default directory
75 layout, since the entire default layout can be replaced with one
78 The \fB--component-flags\fR option is used to specify certain type of
79 components, such as all instantiated ones. Available component flags for
80 deleting a component would be:
84 instantiated component.
86 A leading '^' in front of the \fIflags\fR means inverted flags.
88 Deleting a component from FLR files is not allowed.
91 .B lfs setstripe --component-set \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR | \
92 \fB--component-flags \fIcomp_flags\fR} <\fIfilename\fR>
93 Set or clear \fIflags\fR to the specified component. This command can be only
94 be applied to FLR files. Available \fIflags\fR are:
98 indicates the data in the corresponding component is not available for I/O.
99 Once a component is set to stale, a \fBlfs-mirror-resync\fR(1) is required to
103 set this flag to the corresponding component so that Lustre would prefer to
104 choose the specified component for I/O.
106 A leading '^' means to clear the corresponding flag. It doesn't allow to clear
110 .B lfs setstripe -d \fR<\fIdirectory\fR>
112 Delete the default layout on the specified directory. It is not necessary
113 to delete the default layout on a directory before replacing it. This is
114 only needed if the directory should revert from a directory-specific layout
115 to using the global filesystem default layout stored on the root directory.
117 .B lfs setstripe --yaml=<yaml_template_file> <filename>
119 Create a file with layout information specified by a YAML format template
120 file, the template file can be obtained using the
121 .B lfs getstripe --yaml <anotherfile>
124 The various stripe related options are listed and explained below:
126 .B -c\fR, \fB--stripe-count \fR<\fIstripe_count\fR>
127 The number of OSTs to stripe a file over. \fB0 \fRmeans to use the
128 filesystem-wide default stripe count (default 1), and \fB-1 \fRmeans to stripe
129 over all available OSTs.
131 .B -S\fR, \fB--stripe-size \fR<\fIstripe_size\fR>
132 The number of bytes to store on each OST before moving to the next OST. \fB0\fR
133 means to use the filesystem-wide default stripe_size (default 4MB).
135 .B -i\fR, \fB--stripe-index \fR<\fIstart_ost_index\fR>
136 The OST index (starting at 0) on which to start striping for this file. \fB-1\fR
137 allows the MDS to choose the starting index and it is strongly recommended, as
138 this allows space and load balancing to be done by the MDS as needed.
140 .B -o\fR, \fB--ost-list \fR<\fIost_indices\fR>
141 Used to specify the exact stripe layout on the file system. \fIost_indices\fR
142 is a list of OSTs referenced by their indices, which are specified in decimal
143 or hex form and can be obtained using the
145 command. The list format consists of individual OST indices and index ranges
146 separated by commas, e.g. 1,2-4,7. The
148 option may be specified multiple times to stripe across the union of all listed
151 option is combined with
155 must agree with the number of OSTs in
159 option is combined with
163 must be in the OST list, and it will be used as the index on which to start
164 striping the file. Otherwise the striping will occur in the order specified in
167 .B -p\fR, \fB--pool \fR<\fIpool_name\fR>
168 The name of a predefined pool of OSTs (see
170 that will be used for striping. The
175 will be used as well; the
177 must be part of the pool or an error will be returned.
178 If <\fIpool_name\fR> is
180 , then the OST pool name will be cleared and inherit from parent directory.
182 .B -L, --layout <\fIlayout type\fB>\fR
183 The type of stripe layout, can be
184 .BR raid0 ", " released " or " mdt ".
189 type allows place the first component of the file on the MDT where the inode
190 is located. This is used with composite file layouts and can be defined as
191 first component only. The
193 of MDT part is always equal to the component size. There is also per-MDT
195 .IR lod.dom_stripesize
196 to limit maximum size of DoM stripe which can be changed with
199 .IR lctl\ set_param\ lod.*.dom_stripesize=0
203 There are two options available only for \fBlfs migrate\fR:
206 Block file access during data migration (default).
209 Abort migrations if concurrent access is detected.
210 .SH COMPONENT_OPTIONS
211 The various component related options are listed and explained below:
213 .B -E\fR,\fB--component-end \fR< \fIend\fR>
214 The end offset of the component,
216 is specified in bytes, or using a suffix (kMGTP),
217 such as 256M. \fB-1\fR means the end of file.
219 .B -I\fR, \fB--component-id \fR<\fIcomp_id\fR>
220 The numerical unique component id.
222 .B --component-flags \fR<\fIflags\fR>
223 Component flags. Available \fIflags\fR:
226 .B init\fR: instantiated component.
229 .B prefer\fR: preferred component, for FLR only.
232 .B stale\fR: stale component, for FLR only.
235 A leading '^' means inverted flag. Multiple flags can be separated by comma(s).
239 Add specified components to an existing composite file.
242 Delete specified the components from an existing file. Deletion must start
243 with the last component.
246 .B $ lfs setstripe -S 128k -c 2 /mnt/lustre/file1
247 This creates a file striped on two OSTs with 128kB on each stripe.
249 .B $ lfs setstripe -d /mnt/lustre/dir
250 This deletes a default stripe pattern on dir. New files created in that
251 directory will use the filesystem global default instead.
253 .B $ lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1
254 This creates a file with composite layout, the component has 1 stripe and \
255 covers [0, 4M), the second component has 4 stripes and covers [4M, 64M), the \
256 last component stripes over all available OSTs and covers [64M, EOF).
258 .B $ lfs setstripe --component-add -E -1 -c 4 /mnt/lustre/file1
259 This add a component which start from the end of last existing component to \
262 .B $ lfs setstripe --component-del -I 1 /mnt/lustre/file1
263 This deletes the component with ID equals 1 from an existing file.
265 .B $ lfs setstripe --component-set -I 1 --component-flags=^prefer,stale /mnt/lustre/file1
266 This command will clear the \fBprefer\fR flag and set the \fBstale\fR to
269 .B $ lfs setstripe -E 1M -L mdt -E -1 /mnt/lustre/file1
270 This created file with Data-on-MDT layout. The first 1M is placed on MDT and \
271 rest of file is placed on OST with default striping.
273 .B $ lfs setstripe --yaml=/tmp/layout_yaml /mnt/lustre/file2
274 This creates a file with layout specified by a layout template which can be \
275 obtained with \fBlfs getstripe --yaml\fR command.