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