Whamcloud - gitweb
LU-10561 flr: remove "--parent" option from lfs mirror command
[fs/lustre-release.git] / lustre / doc / lfs-setstripe.1
1 .TH LFS-SETSTRIPE 1 2017-08-23 "Lustre" "Lustre Utilities"
2 .SH NAME
3 lfs setstripe \- set striping pattern of a file or directory default
4 .SH SYNOPSIS
5 .B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR>
6 .br
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>
9 .br
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>
13 .br
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>
16 .br
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>
19 .br
20 .B lfs setstripe -d \fR<\fIdirectory\fR>
21 .br
22 .SH DESCRIPTION
23 .TP
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.
32 .TP
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>
35 .br
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
41 .B -E
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
44 offset of
45 .B -1
46 or
47 .B eof
48 indicates the component extends to the end of file.
49 .TP
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>
52 .br
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
58 .B lfs setstripe
59 call.
60 .br
61 Adding a component to FLR files is not allowed.
62 .TP
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>
65 .br
66 Remove the component(s) specified by component ID or flags from an existing
67 file. The ID specified by the
68 .B -I
69 option is the numerical unique ID of the component, it can be obtained using
70 the
71 .B lfs getstripe
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
74 .B lfs setstripe
75 call.
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:
79 .RS
80 .TP
81 .B init
82 instantiated component.
83 .LP
84 A leading '^' in front of the \fIflags\fR means inverted flags.
85 .br
86 Deleting a component from FLR files is not allowed.
87 .RE
88 .TP
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:
93 .RS
94 .TP
95 .B stale
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
98 clear the flag.
99 .TP
100 .B prefer
101 set this flag to the corresponding component so that Lustre would prefer to
102 choose the specified component for I/O.
103 .LP
104 A leading '^' means to clear the corresponding flag. It doesn't allow to clear
105 \fBstale\fR flag.
106 .RE
107 .TP
108 .B lfs setstripe -d \fR<\fIdirectory\fR>
109 .br
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.
114 .SH STRIPE_OPTIONS
115 The various stripe related options are listed and explained below:
116 .TP
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.
121 .TP
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).
125 .TP
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.
130 .TP
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
135 .B lfs osts
136 command. The list format consists of individual OST indices and index ranges
137 separated by commas, e.g. 1,2-4,7. The
138 .B -o
139 option may be specified multiple times to stripe across the union of all listed
140 OSTs. If the
141 .B -c
142 option is combined with
143 .B -o
144 the
145 .I stripe_count
146 must agree with the number of OSTs in
147 .IR ost_indices .
148 If the
149 .B -i
150 option is combined with
151 .B -o
152 the
153 .I start_ost_index
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
156 .IR ost_indices .
157 .TP
158 .B -p\fR, \fB--pool \fR<\fIpool_name\fR>
159 The name of a predefined pool of OSTs (see
160 .BR lctl (8))
161 that will be used for striping. The
162 .IR stripe_count ,
163 .IR stripe_size ,
164 and
165 .I start_ost_index
166 will be used as well; the
167 .I start_ost_index
168 must be part of the pool or an error will be returned.
169 If <\fIpool_name\fR> is
170 .BR none
171 , then the OST pool name will be cleared and inherit from parent directory.
172 .TP
173 .B -L, --layout <\fIlayout type\fB>\fR
174 The type of stripe layout, can be
175 .BR raid0 ", " released " or " mdt ".
176 It is
177 .BR raid0
178 by default. The
179 .BR 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
183 .IR stripe_size
184 of MDT part is always equal to the component size. There is also per-MDT
185 parameter
186 .IR lod.dom_stripesize
187 to limit maximum size of DoM stripe which can be changed with
188 .BR lctl\ set_param
189 command, (e.g.
190 .IR lctl\ set_param\ lod.*.dom_stripesize=0
191 , see
192 .BR lctl (8))
193 .TP
194 There are two options available only for \fBlfs migrate\fR:
195 .TP
196 .BR -b , --block
197 Block file access during data migration (default).
198 .TP
199 .BR -n , --non-block
200 Abort migrations if concurrent access is detected.
201 .SH COMPONENT_OPTIONS
202 The various component related options are listed and explained below:
203 .TP
204 .B -E\fR,\fB--component-end \fR< \fIend\fR>
205 The end offset of the component,
206 .I end
207 is specified in bytes, or using a suffix (kMGTP),
208 such as 256M. \fB-1\fR means the end of file.
209 .TP
210 .B -I\fR, \fB--component-id \fR<\fIcomp_id\fR>
211 The numerical unique component id.
212 .TP
213 .B --component-flags \fR<\fIflags\fR>
214 Component flags. Available \fIflags\fR:
215 .RS
216 .RS
217 .B init\fR: instantiated component.
218 .RE
219 .RS
220 .B prefer\fR: preferred component, for FLR only.
221 .RE
222 .RS
223 .B stale\fR: stale component, for FLR only.
224 .RE
225 .LP
226 A leading '^' means inverted flag. Multiple flags can be separated by comma(s).
227 .RE
228 .TP
229 .B --component-add
230 Add specified components to an existing composite file.
231 .TP
232 .B --component-del
233 Delete specified the components from an existing file. Deletion must start
234 with the last component.
235 .SH EXAMPLES
236 .TP
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.
239 .TP
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.
243 .TP
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).
248 .TP
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 \
251 the end of file.
252 .TP
253 .B $ lfs setstripe --component-del -I 1 /mnt/lustre/file1
254 This deletes the component with ID equals 1 from an existing file.
255 .TP
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
258 component with ID 1.
259 .TP
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.
263 .SH SEE ALSO
264 .BR lfs (1),
265 .BR lfs-migrate (1),
266 .BR lustre (7)