Whamcloud - gitweb
LU-3285 merge: 'dom' branch merging
[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 -d \fR<\fIdirectory\fR>
18 .br
19 .SH DESCRIPTION
20 .TP
21 .B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR>
22 Create a file with specified layout, or set or replace the default file
23 layout on an existing directory.  If the default file layout is set on
24 the filesystem root directory, it will be used as the filesystem-wide
25 default layout for all files that do not explicitly specify a layout and
26 do not have a default layout on the parent directory.  The default layout
27 set on a directory will be copied to any new subdirectories created within
28 that directory at the time they are created.
29 .TP
30 .B lfs setstripe \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR] \
31 [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
32 .br
33 Create a file with the specified composite layout. Each component defines the
34 stripe pattern of the file in the range of
35 .RI [ start ", " end ].
36 The first component implicitly starts at offset 0, and all later components
37 start at the end of previous extent.  The
38 .B -E
39 option is used to specify the end offset of each component, and it also
40 indicates the following \fISTRIPE_OPTIONS\fR are for this component. The end
41 offset of
42 .B -1
43 or
44 .B eof
45 indicates the component extends to the end of file.
46 .TP
47 .B lfs setstripe --component-add \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR] \
48 [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
49 .br
50 Add components to an existing composite file. The extent start of the first
51 component to be added is equal to the extent end of last component in existing
52 file, and all components to be added must be adjacent with each other.  It is
53 not possible to add components incrementally to the default directory layout,
54 since the entire default layout can be replaced with one
55 .B lfs setstripe
56 call.
57 .TP
58 .B lfs setstripe --component-del \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR | \
59 \fB--component-flags \fIcomp_flags\fR} <\fIfilename\fR>
60 .br
61 Remove the component(s) specified by component ID or flags from an existing
62 file. The ID specified by the
63 .B -I
64 option is the numerical unique ID of the component, it can be obtained using
65 the
66 .B lfs getstripe
67 command.  It is not possible to delete components from a default directory
68 layout, since the entire default layout can be replaced with one
69 .B lfs setstripe
70 call.
71 The \fB--component-flags\fR option is used to specify certain type of
72 components, such as all instantiated ones.
73 .TP
74 .B lfs setstripe -d \fR<\fIdirectory\fR>
75 .br
76 Delete the default layout on the specified directory.  It is not necessary
77 to delete the default layout on a directory before replacing it.  This is
78 only needed if the directory should revert from a directory-specific layout
79 to using the global filesystem default layout stored on the root directory.
80 .SH STRIPE_OPTIONS
81 The various stripe related options are listed and explained below:
82 .TP
83 .B -c\fR, \fB--stripe-count \fR<\fIstripe_count\fR>
84 The number of OSTs to stripe a file over. \fB0 \fRmeans to use the
85 filesystem-wide default stripe count (default 1), and \fB-1 \fRmeans to stripe
86 over all available OSTs.
87 .TP
88 .B -S\fR, \fB--stripe-size \fR<\fIstripe_size\fR>
89 The number of bytes to store on each OST before moving to the next OST. \fB0\fR
90 means to use the filesystem-wide default stripe_size (default 1MB).
91 .TP
92 .B -i\fR, \fB--stripe-index \fR<\fIstart_ost_index\fR>
93 The OST index (starting at 0) on which to start striping for this file. \fB-1\fR
94 allows the MDS to choose the starting index and it is strongly recommended, as
95 this allows space and load balancing to be done by the MDS as needed.
96 .TP
97 .B -o\fR, \fB--ost-list \fR<\fIost_indices\fR>
98 Used to specify the exact stripe layout on the file system. \fIost_indices\fR
99 is a list of OSTs referenced by their indices, which are specified in decimal
100 or hex form and can be obtained using the
101 .B lfs osts
102 command. The list format consists of individual OST indices and index ranges
103 separated by commas, e.g. 1,2-4,7. The
104 .B -o
105 option may be specified multiple times to stripe across the union of all listed
106 OSTs. If the
107 .B -c
108 option is combined with
109 .B -o
110 the
111 .I stripe_count
112 must agree with the number of OSTs in
113 .IR ost_indices .
114 If the
115 .B -i
116 option is combined with
117 .B -o
118 the
119 .I start_ost_index
120 must be in the OST list, and it will be used as the index on which to start
121 striping the file. Otherwise the striping will occur in the order specified in
122 .IR ost_indices .
123 .TP
124 .B -p\fR, \fB--pool \fR<\fIpool_name\fR>
125 The name of a predefined pool of OSTs (see
126 .BR lctl (8))
127 that will be used for striping. The
128 .IR stripe_count ,
129 .IR stripe_size ,
130 and
131 .I start_ost_index
132 will be used as well; the
133 .I start_ost_index
134 must be part of the pool or an error will be returned.
135 .TP
136 .B -L, --layout <\fIlayout type\fB>\fR
137 The type of stripe layout, can be
138 .BR raid0 ", " released " or " mdt ".
139 It is
140 .BR raid0
141 by default. The
142 .BR mdt
143 type allows place the first component of the file on the MDT where the inode
144 is located. This is used with composite file layouts and can be defined as
145 first component only. The
146 .IR stripe_size
147 of MDT part is always equal to the component size. There is also per-MDT
148 parameter
149 .IR lod.dom_stripesize
150 to limit maximum size of DoM stripe which can be changed with
151 .BR lctl\ set_param
152 command, (e.g.
153 .IR lctl\ set_param\ lod.*.dom_stripesize=0
154 , see
155 .BR lctl (8))
156 .TP
157 There are two options available only for \fBlfs migrate\fR:
158 .TP
159 .BR -b , --block
160 Block file access during data migration (default).
161 .TP
162 .BR -n , --non-block
163 Abort migrations if concurrent access is detected.
164 .SH COMPONENT_OPTIONS
165 The various component related options are listed and explained below:
166 .TP
167 .B -E\fR,\fB--component-end \fR< \fIend\fR>
168 The end offset of the component,
169 .I end
170 is specified in bytes, or using a suffix (kMGTP),
171 such as 256M. \fB-1\fR means the end of file.
172 .TP
173 .B -I\fR, \fB--component-id \fR<\fIcomp_id\fR>
174 The numerical unique component id.
175 .TP
176 .B --component-flags \fR<\fIflags\fR>
177 Component flags. Available \fIflags\fR:
178 .RS
179 .RS
180 .B init\fR: instantiated component.
181 .RE
182 .RS
183 .B ^init\fR: uninstantiated component.
184 .RE
185 .RE
186 .TP
187 .B --component-add
188 Add specified components to an existing composite file.
189 .TP
190 .B --component-del
191 Delete specified the components from an existing file. Deletion must start
192 with the last component.
193 .SH EXAMPLES
194 .TP
195 .B $ lfs setstripe -S 128k -c 2 /mnt/lustre/file1
196 This creates a file striped on two OSTs with 128kB on each stripe.
197 .TP
198 .B $ lfs setstripe -d /mnt/lustre/dir
199 This deletes a default stripe pattern on dir. New files created in that
200 directory will use the filesystem global default instead.
201 .TP
202 .B $ lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1
203 This creates a file with composite layout, the component has 1 stripe and \
204 covers [0, 4M), the second component has 4 stripes and covers [4M, 64M), the \
205 last component stripes over all available OSTs and covers [64M, EOF).
206 .TP
207 .B $ lfs setstripe --component-add -E -1 -c 4  /mnt/lustre/file1
208 This add a component which start from the end of last existing component to \
209 the end of file.
210 .TP
211 .B $ lfs setstripe --component-del -I 1 /mnt/lustre/file1
212 This deletes the component with ID equals 1 from an existing file.
213 .TP
214 .B $ lfs setstripe -E 1M -L mdt -E -1 /mnt/lustre/file1
215 This created file with Data-on-MDT layout. The first 1M is placed on MDT and \
216 rest of file is placed on OST with default striping.
217 .SH SEE ALSO
218 .BR lfs (1),
219 .BR lfs-migrate (1),
220 .BR lustre (7)