Whamcloud - gitweb
8d48380e86a57642382ea743e503577e0e3221d6
[fs/lustre-release.git] / lustre / doc / lfs-setdirstripe.1
1 .TH LFS-SETDIRSTRIPE 1 2017-11-07 "Lustre" "Lustre Utilities"
2 .SH NAME
3 lfs setdirstripe, mkdir \- set striping pattern of a directory.
4 .SH SYNOPSIS
5 .B lfs setdirstripe [\fR-cdDHioTx\fR] \fIDIR\fR...
6 .br
7 .SH DESCRIPTION
8 Create a striped directory with specified striping pattern. This lfs utility
9 is similar to
10 .BR lfs setstripe
11 , but is used to create striped directory.
12 Can also be used to create directory with a foreign (free format) striping pattern (see
13 .BR --foreign
14 and
15 .BR --xattr
16 options).
17 .B lfs mkdir
18 is an alias for this command.
19 .SH OPTIONS
20 .TP
21 .BR \-c ", " \-T ", " \-\-mdt\-count =\fICOUNT\fR
22 Stripe the new directory over
23 .I COUNT
24 MDTs.
25 .TP
26 .BR \-i ", " \-\-mdt\-index =\fISTART_MDT_INDEX\fR[,\fIMDT_INDEX ...]
27 Use the MDT whose index is
28 .I START_MDT_INDEX
29 as the master/starting MDT for the directory. If multiple
30 .I MDT_INDEX
31 values are given, then the stripes will be allocated on the specified
32 MDT indices.  If index -1 (default) is used, it will prefer to select
33 .B COUNT
34 MDTs proportional to the free space and inodes on each.
35 .TP
36 .BR \-H ", " \-\-mdt-hash =\fIHASH_TYPE\fR
37 Use
38 .I hash_type
39 for the striped directory.
40 .RS 1.2i
41 .TP
42 .B crush
43 CRUSH hash algorithm.  This is a consistent hash
44 algorithm, so minimum sub files need to relocate
45 during directory restripe.
46 .TP
47 .B fnv_1a_64
48 Fowler-Noll-Vo (FNV-1a) hash algorithm.  This provides
49 reasonably uniform, but not cryptographically strong,
50 hashing of the filename. (default)
51 .TP
52 .B all_char
53 Sum of ASCII characters modulo number of MDTs. This
54 provides weak hashing of the filename, and is suitable
55 for only testing or when the input is known to have
56 perfectly uniform distribution (e.g. sequential numbers).
57 .RE
58 .TP
59 .BR \-d ", " \-\-delete
60 Delete the default striping layout from the directory.  New subdirectories
61 created in this directory will inherit the global default directory layout
62 (by default they will not be striped).
63 .TP
64 .BR \-D ", " \-\-default
65 Set the default striping pattern of subdirectories. Newly created
66 sub-directories will use the new default striping pattern,
67 but existing sub-directories will not be affected.  The newly
68 created sub-directories will also inherit the specified default
69 striping pattern. Only default stripe count is supported for now.
70
71 Note that striping all directories across all MDTs by default is not
72 recommended at this time, as the clients will have to do more RPCs to
73 create and access each directory, hurting performance rather than
74 improving it.  Default striped directories are preferred for cases
75 where large subdirectories will be created (e.g. file-per-process
76 job output directories).
77 .TP
78 .BR \-o ", " \-\-mode =\fIMODE\fR
79 Set the file access permissions of the new directory to the specified
80 numeric
81 .I MODE
82 (typically octal), as with
83 .BR chmod (1).
84 It is not affected by the current
85 .BR umask (1p).
86 .TP
87 .BR \-\-foreign[=type]
88 Create a directory with a foreign (non-Lustre/free format, see
89 .BR \-\-xattr
90 option) striping. Where
91 .BR type
92 specifies a known foreign type (like
93 .BR none
94 ,
95 .BR daos
96 , ...) or a 32-bit numeric type.
97 .TP
98 .BR \-\-flags =\fI<hex>\fR
99 Specify a bitmask of flags.
100 .TP
101 .BR \-x ", " \-\-xattr =\fISTRING\fR
102 Specify a string to be used as a foreign (free format) striping.
103 .SH NOTE
104 .PP
105 The
106 .B lfs setdirstripe
107 command is only executable by root unless
108 .B "mdt.*.enable_remote_dir_gid"
109 is set on the MDS via
110 .B lctl set_param
111 to be either a non-zero GID to limit it to a single group
112 (e.g. "operator" or "admin"), or "-1" to allow any group
113 to create remote directories.
114
115 The root of the file system is on MDT0000, and directories and files inherit the
116 MDT of their parent directory unless a different MDT is specified with this
117 command.
118
119 By default, only directories on MDT0000 can contain directories that are not on
120 the same MDT.  However, if "mdt.*.enable_remote_dir" is set non-zero on an MDT
121 then it will allow creating remote directories that have parents other than
122 MDT0000. This is restricted to avoid creating directory trees that have
123 intermediate path components on a series different MDTs and become unavailable
124 if any of the intermediate MDTs are offline.
125 .SH EXAMPLES
126 .TP
127 .B $ lfs setdirstripe -c 2 -i 1 -H all_char /mnt/lustre/dir1
128 This creates a directory striped on two MDTs, whose first stripe is on
129 .B MDT0001
130 (MDT index 1), and whose hash type is
131 .BR all_char .
132 .TP
133 .B $ lfs mkdir --foreign=daos --xattr PUUID:CUUID /mnt/lustre/dir1
134 This creates
135 .B dir1
136 with foreign (non-lustre/free format)
137 .B PUUID:CUUID
138 striping/LMV EA.
139 .SH AVAILABILITY
140 The
141 .B lfs setdirstripe
142 command is part of the Lustre filesystem.
143 .SH SEE ALSO
144 .BR lctl (8),
145 .BR lfs (1),
146 .BR lfs-getdirstripe (1),
147 .BR lfs-setstripe (1),
148 .BR lustre (7)