Whamcloud - gitweb
52dc756b080fbf586d6da56daee03bddea13412b
[fs/lustre-release.git] / lustre / doc / lfs-setstripe.1
1 .TH LFS-SETSTRIPIE 1 2015-11-06 "Lustre" "Lustre Utilities"
2 .SH NAME
3 lfs setstripe \- set striping pattern of a file.
4 .SH SYNOPSIS
5 .B lfs setstripe [\fISTRIPE_OPTIONS\fR] <directory|filename>
6 .br
7 .B lfs setstripe -d <directory>
8 .br
9 .B lfs setstripe <--component-end|-E end1> [\fISTRIPE_OPTIONS\fR] \
10 [<--component-end|-E end2> [\fISTRIPE_OPTIONS\fR] ...] <filename>
11 .br
12 .B lfs setstripe --component-add <--component-end|-E end1> [\fISTRIPE_OPTIONS\fR] \
13 [<--component-end|-E end2> [\fISTRIPE_OPTIONS\fR] ...] <filename>
14 .br
15 .B lfs setstripe --component-del <--component-id|-I comp_id | \
16 --component-flags comp_flags> <filename>
17 .br
18 .SH DESCRIPTION
19 .TP
20 .B lfs setstripe [\fISTRIPE_OPTIONS\fR] <directory|filename>
21 Create a file with specified striping pattern, or set default stripping pattern
22 to a directory.
23 .br
24 .TP
25 .B lfs setstripe -d <directory>
26 .br
27 Delete the default striping on the specified directory.
28 .TP
29 .B lfs setstripe <--component-end|-E end1> [\fISTRIPE_OPTIONS\fR] \
30 [<--component-end|-E end2> [\fISTRIPE_OPTIONS\fR] ...] <filename>
31 .br
32 Create a file with the specified composite layout. Each component defines the
33 stripe pattern of the file in the range of [start, end). The first component
34 must start from offset 0, and all components must be adjacent with each other,
35 no holes are allowed, so each extent will start at the end of previous extent.
36 The
37 .I -E
38 option is used to specify the end offset of each component, and it also
39 indicates the following \fISTRIPE_OPTIONS\fR are for this component. A -1 end
40 offset indicates the EOF.
41 .TP
42 .B lfs setstripe --component-add <--component-end|-E end1> [\fISTRIPE_OPTIONS\fR] \
43 [<--component-end|-E end2> [\fISTRIPE_OPTIONS\fR] ...] <filename>
44 .br
45 Add components to an existing composite file. The extent start of the first
46 component to be added is equal to the extent end of last component in existing
47 file, and all components to be added must be adjacent with each other.
48 .TP
49 .B lfs setstripe --component-del <--component-id|-I comp_id | \
50 --component-flags comp_flags> <filename>
51 .br
52 Remove the component(s) specified by component ID or flags from an existing
53 file. The ID specified by
54 .I -I
55 option is the numerical unique ID of the component, it can be obtained using
56 the
57 .B lfs getstripe
58 command.
59 .I --component-flags
60 option is used to specify certain type of components, such as all instantiated
61 ones.
62 .SH STRIPE_OPTIONS
63 The various stripe related options are listed and explained below:
64 .TP
65 .B -c, --stripe-count <\fIstripe_count\fR>
66 The number of OSTs to stripe a file over. 0 means to use the filesystem-wide
67 default stripe count (default 1), and -1 means to stripe over all available
68 OSTs.
69 .TP
70 .B -S, --stripe-size <\fIstripe_size\fR>
71 The number of bytes to store on each OST before moving to the next OST. 0 means
72 to use the filesystem-wide default stripe_size (default 1MB).
73 .TP
74 .B -i, --stripe-index <\fIstart_ost_index\fR>
75 The OST index (starting at 0) on which to start striping for this file. -1
76 allows the MDS to choose the starting index and it is strongly recommended, as
77 this allows space and load balancing to be done by the MDS as needed.
78 .TP
79 .B -o, --ost-list <\fIost_indices\fR>
80 Used to specify the exact stripe layout on the file system. \fIost_indices\fR
81 is a list of OSTs referenced by their indices, which are specified in decimal
82 or hex form and can be obtained using the
83 .B lfs osts
84 command. The list format consists of individual OST indices and index ranges
85 separated by commas, e.g. 1,2-4,7. The
86 .B -o
87 option may be specified multiple times to stripe across the union of all listed
88 OSTs. If the
89 .B -c
90 option is combined with
91 .B -o
92 the
93 .I stripe_count
94 must agree with the number of OSTs in
95 .IR ost_indices .
96 If the
97 .B -i
98 option is combined with
99 .B -o
100 the
101 .I start_ost_index
102 must be in the OST list, and it will be used as the index on which to start
103 striping the file. Otherwise the striping will occur in the order specified in
104 .IR ost_indices .
105 .TP
106 .B -p, --pool <\fIpool_name\fR>
107 The name of a predefined pool of OSTs (see
108 .BR lctl (8))
109 that will be used for striping. The
110 .IR stripe_count ,
111 .IR stripe_size ,
112 and
113 .I start_ost_index
114 will be used as well; the
115 .I start_ost_index
116 must be part of the pool or an error will be returned.
117 .TP
118 There are two options available only for \fBlfs migrate\fR:
119 .TP
120 .B -b, --block
121 Block file access during data migration (default).
122 .TP
123 .B -n, --non-block
124 Abort migrations if concurrent access is detected.
125 .SH COMPONENT_OPTIONS
126 The various component related options are listed and explained below:
127 .TP
128 .B -E, --component-end <\fIend\fR>
129 The end offset of the component,
130 .I end
131 is specified in bytes, or using a suffix (kMGTP),
132 such as 256M. -1 means the end of file.
133 .TP
134 .B -I, --component-id <\fIcomp_id\fR>
135 The numerical unique component id.
136 .TP
137 .B --component-flags <\fIflags\fR>
138 Component flags. Available flags: \fBinit\fR: instantiated component.
139 \fB^init\fR: uninstantiated component.
140 .TP
141 .B --component-add
142 Add specified components to an existing composite file.
143 .TP
144 .B --component-del
145 Delete specified the components from an existing file. Deletion must start
146 with the last component.
147 .SH EXAMPLES
148 .TP
149 .B $ lfs setstripe -S 128k -c 2 /mnt/lustre/file1
150 This creates a file striped on two OSTs with 128kB on each stripe.
151 .TP
152 .B $ lfs setstripe -d /mnt/lustre/dir
153 This deletes a default stripe pattern on dir. New files will use the default \
154 striping pattern created therein.
155 .TP
156 .B $ lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1
157 This creates a file with composite layout, the component has 1 stripe and \
158 covers [0, 4M), the second component has 4 stripes and covers [4M, 64M), the \
159 last component stripes over all available OSTs and covers [64M, EOF).
160 .TP
161 .B $ lfs setstripe --component-add -E -1 -c 4  /mnt/lustre/file1
162 This add a component which start from the end of last existing component to \
163 the end of file.
164 .TP
165 .B $ lfs setstripe --component-del -I 1 /mnt/lustre/file1
166 This deletes the component with ID equals 1 from an existing file.
167 .SH SEE ALSO
168 .BR lfs (1),
169 .BR lfs-migrate (1),
170 .BR lustre (7)