Whamcloud - gitweb
LU-10277 utils: 'lfs mkdir -i -1' pick the less full MDTs
[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-cdDHioT\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 .B lfs mkdir
13 is an alias for this command.
14 .SH OPTIONS
15 .TP
16 .BR \-c ", " \-T ", " \-\-mdt\-count =\fICOUNT\fR
17 Stripe the new directory over
18 .I COUNT
19 MDTs.
20 .TP
21 .BR \-i ", " \-\-mdt\-index =\fISTART_MDT_INDEX\fR
22 Use the MDT whose index is
23 .I START_MDT_INDEX
24 as the master/starting MDT for the directory. If -1 (default) is set, it will randomly pick
25 .I COUNT
26 less full MDTs.
27 .TP
28 .BR \-H ", " \-\-mdt-hash =\fIHASH_TYPE\fR
29 Use
30 .I hash_type
31 for the striped directory.
32 .RS 1.2i
33 .TP
34 .B fnv_1a_64
35 Fowler-Noll-Vo (FNV-1a) hash algorithm.  This provides
36 reasonably uniform, but not cryptographically strong,
37 hashing of the filename. (default)
38 .TP
39 .B all_char
40 Sum of ASCII characters modulo number of MDTs. This
41 provides weak hashing of the filename, and is suitable
42 for only testing or when the input is known to have
43 perfectly uniform distribution (e.g. sequential numbers).
44 .RE
45 .TP
46 .BR \-d ", " \-\-delete
47 Delete the default striping layout from the directory.  New subdirectories
48 created in this directory will inherit the global default directory layout
49 (by default they will not be striped).
50 .TP
51 .BR \-D ", " \-\-default
52 Set the default striping pattern of subdirectories. Newly created
53 sub-directories will use the new default striping pattern,
54 but existing sub-directories will not be affected.  The newly
55 created sub-directories will also inherit the specified default
56 striping pattern. Only default stripe count is supported for now.
57
58 Note that striping all directories across all MDTs by default is not
59 recommended at this time, as the clients will have to do more RPCs to
60 create and access each directory, hurting performance rather than
61 improving it.  Default striped directories are preferred for cases
62 where large subdirectories will be created (e.g. file-per-process
63 job output directories).
64 .TP
65 .BR \-o ", " \-\-mode =\fIMODE\fR
66 Set the file access permissions of the new directory to the specified
67 numeric
68 .I MODE
69 (typically octal), as with
70 .BR chmod (1).
71 It is not affected by the current
72 .BR umask (1p).
73 .SH NOTE
74 .PP
75 The
76 .B lfs setdirstripe
77 command is only executable by root unless
78 .B "mdt.*.enable_remote_dir_gid"
79 is set on the MDS via
80 .B lctl set_param
81 to be either a non-zero GID to limit it to a single group
82 (e.g. "operator" or "admin"), or "-1" to allow any group
83 to create remote directories.
84
85 The root of the file system is on MDT0000, and directories and files inherit the
86 MDT of their parent directory unless a different MDT is specified with this
87 command.
88
89 By default, only directories on MDT0000 can contain directories that are not on
90 the same MDT.  However, if "mdt.*.enable_remote_dir" is set non-zero on an MDT
91 then it will allow creating remote directories that have parents other than
92 MDT0000. This is restricted to avoid creating directory trees that have
93 intermediate path components on a series different MDTs and become unavailable
94 if any of the intermediate MDTs are offline.
95 .SH EXAMPLES
96 .TP
97 .B $ lfs setdirstripe -c 2 -i 1 -H all_char /mnt/lustre/dir1
98 This creates a directory striped on two MDTs, whose first stripe is on
99 .B MDT0001
100 (MDT index 1), and whose hash type is
101 .BR all_char .
102 .SH AVAILABILITY
103 The
104 .B lfs setdirstripe
105 command is part of the Lustre filesystem.
106 .SH SEE ALSO
107 .BR lctl (8),
108 .BR lfs (1),
109 .BR lfs-getdirstripe (1),
110 .BR lfs-setstripe (1),
111 .BR lustre (7)