Whamcloud - gitweb
2943851508ea62a076e37b8afa652c43a9ddd568
[fs/lustre-release.git] / lustre / doc / lfs-mirror-create.1
1 .TH LFS-MIRROR-CREATE 1 2017-07-25 "Lustre" "Lustre Utilities"
2 .SH NAME
3 lfs mirror create \- create a mirrored file or directory
4 .SH SYNOPSIS
5 .B lfs mirror create
6 <\fB\-\-mirror\-count\fR|\fB\-N\fR[\fImirror_count\fR]>
7 [\fIsetstripe_options\fR|\fB--parent\fR|[\fB--flags\fR<=\fIflags\fR>]] ...
8 .RI < filename | directory >
9 .SH DESCRIPTION
10 This command creates a mirrored file or directory specified by the path name
11 \fIfilename\fR or \fIdirectory\fR.
12 .br
13 The \fB\-\-mirror\-count\fR|\fB\-N\fR option is required and indicates how many
14 mirrors that have the same layout will be created. It can be repeated multiple
15 times to separate mirrors that have different layouts. The \fImirror_count\fR
16 argument is optional and defaults to 1 if it's not specified; if specified, it
17 must follow the option without a space.
18 .br
19 The \fIsetstripe_options\fR specify the specific layout for the mirror. It can
20 be a plain layout with specific striping pattern or a composite layout like
21 Progressive File Layout (PFL) (see \fBlfs-setstripe\fR(1)).
22 If \fIsetstripe_options\fR are not specified,
23 then the stripe options inherited from the previous component will be used. If
24 there is no previous component or \fB\-\-parent\fR option is specified, then the
25 default stripe options inherited from parent directory will be used. For stripe
26 options, only \fIstripe_count\fR, \fIstripe_size\fR and OST \fIpool_name\fR can
27 be inherited.
28 .br
29 If no option is specified, then the command will return an error.
30 .SH OPTIONS
31 .TP
32 .BR \-\-mirror\-count\fR|\fB\-N\fR[\fImirror_count\fR]
33 The number of mirrors that have the same layout to be created. The option can be
34 repeated multiple times to separate mirrors that have different layouts. The
35 \fImirror_count\fR argument is optional and defaults to 1 if it's not specified;
36 if specified, it must follow the option without a space.
37 .TP
38 .I setstripe_options
39 The layout of one mirror. The options are the same as those for
40 \fBlfs-setstripe\fR(1) command.
41 If \fIsetstripe_options\fR are not specified, then
42 the stripe options inherited from the previous component will be used.
43 .TP
44 .B \-\-parent
45 This option indicates that the default stripe options inherited from parent
46 directory will be used.
47 .TP
48 .B --flags<=\fIflags\fR>
49 Where available \fIflags\fR are as follows:
50 .RS
51 .TP
52 .BI prefer
53 is supported in mirror creation. This flag will be set to all components that
54 belong to ths corresponding mirror. The \fBprefer\fR flag gives hint to Lustre
55 for which mirrors should be used to serve I/O. When a mirrored file is being
56 read, the component(s) with \fBprefer\fR are likely to be picked to serve the
57 read; and when a mirrored file is prepared to be written, the MDT will
58 tend to choose the component with \fBprefer\fR flag set and stale the other
59 components with overlapping extents. This flag just provides a hint to Lustre,
60 which means Lustre may still choose mirrors without this flag set, for instance,
61 if all preferred mirrors are unavailable when the I/O occurs. This flag could be
62 set on multiple components.
63 .LP
64 Please note that this flag will be set to all components that belong to the
65 corresponding mirror. There also exists option \fB--comp-flags\fR that can be
66 set to individual components at mirror creation time.
67 .RE
68 .SH EXAMPLES
69 .TP
70 .B lfs mirror create -N2 /mnt/lustre/file1
71 Create a mirrored file with 2 mirrors. Each mirror has the same default striping
72 pattern inherited from parent directory or filesystem-wide default.
73 .TP
74 .B lfs mirror create -N2 -E 1M -E eof -c -1 /mnt/lustre/dir1
75 Create a mirrored directory with 2 PFL mirrors. Each mirror has the same
76 specified PFL layout.
77 .LP
78 .B lfs mirror create -N3 -E 1M -c 1 -E 32M -c 4 -S 16M -E eof -c -1
79 .B /mnt/lustre/file1
80 .in
81 Create a mirrored file with 3 PFL mirrors. Each mirror has the same specified
82 PFL layout.
83 .TP
84 .B lfs mirror create -N -c 1 -S 4M -N -c 2 -o 2,3 -N --parent /mnt/lustre/file1
85 Create a mirrored file with 3 plain layout mirrors. The first mirror has a
86 single stripe and 4MB stripe size. The second mirror has two stripes and locates
87 on OSTs with indices 2 and 3. It also has 4MB stripe size inherited from the
88 first mirror. The third mirror has default striping pattern inherited from
89 parent directory.
90 .LP
91 .B lfs mirror create -N2 -E 4M -c 2 --pool flash --flags prefer -E eof -c 4
92 .B -N3 -E 16M -c 4 -S 16M --pool archive --comp-flags=prefer -E eof -c -1
93 .B /mnt/lustre/file1
94 .in
95 Create a mirrored file with 5 PFL mirrors. The first and second mirrors have the
96 same PFL layout, and both of the components are allocated from the \fBflash\fR
97 OST pool. Also, flag \fBprefer\fR is applied to all the components of the first
98 two mirrors, which tells the client to read data from those components whenever
99 they are available.
100 .br
101 The last three mirrors have the same PFL layout, and each of these
102 components have a stripe size of 16MB and use OSTs in the \fBarchive\fR pool.
103 However, the flag \fBprefer\fR is only applied to the first component of each
104 mirror.
105 .SH AUTHOR
106 The \fBlfs mirror create\fR command is part of the Lustre filesystem.
107 .SH SEE ALSO
108 .BR lfs (1),
109 .BR lfs-setstripe (1),
110 .BR lfs-mirror-extend (1),
111 .BR lfs-mirror-split (1),
112 .BR lfs-mirror-resync (1),
113 .BR lfs-mirror-verify (1)