File: mkfs.ocfs2.8.in

package info (click to toggle)
ocfs2-tools 1.6.4-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,644 kB
  • ctags: 8,411
  • sloc: ansic: 77,632; sh: 4,626; python: 2,380; makefile: 1,115
file content (336 lines) | stat: -rw-r--r-- 14,464 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
.TH "mkfs.ocfs2" "8" "September 2010" "Version @VERSION@" "OCFS2 Manual Pages"
.SH "NAME"
mkfs.ocfs2 \- Creates an \fIOCFS2\fR file system.
.SH "SYNOPSIS"
\fBmkfs.ocfs2\fR [\fB\-b\fR \fIblock\-size\fR] [\fB\-C\fR \fIcluster\-size\fR] [\fB\-L\fR \fIvolume\-label\fR] [\fB\-M\fR \fImount-type\fR] [\fB\-N\fR \fInumber\-of\-nodes\fR] [\fB\-J\fR \fIjournal\-options\fR] [\fB\-\-fs\-features=\fR\fI[no]sparse...\fR] [\fB\-\-fs\-feature\-level=\fR\fIfeature\-level\fR] [\fB\-T\fR \fIfilesystem\-type\fR] [\fB\-FqvV\fR] \fIdevice\fR [\fIblocks-count\fI]
.SH "DESCRIPTION"
.PP
\fBmkfs.ocfs2\fR is used to create an \fIOCFS2\fR file system on a \fIdevice\fR,
usually a partition on a shared disk. In order to prevent data loss,
\fBmkfs.ocfs2\fR will not format an existing \fIOCFS2\fR volume if it
detects that it is mounted on another node in the cluster. This tool
requires the cluster service to be online.

.SH "OPTIONS"
.TP
\fB\-b, \-\-block\-size\fR \fIblock\-size\fR
Valid block size values are 512, 1K, 2K and 4K bytes per block. If
omitted, a value will be heuristically determined based on the
expected usage of the file system (see the \fB\-T\fR option). A block
size of 512 bytes is never recommended. Choose 1K, 2K or 4K.

.TP
\fB\-C, \-\-cluster\-size\fR \fIcluster\-size\fR
Valid cluster size values are 4K, 8K, 16K, 32K, 64K, 128K, 256K, 512K
and 1M. If omitted, a value will be heuristically determined based on
the expected usage of the file system (see the \fB\-T\fR option). For
volumes expected to store large files, like database files, while a
cluster size of 128K or more is recommended, one can opt for a smaller
size as long as that value is not smaller than the database block size.
For others, use 4K.

.TP
\fB\-F, \-\-force\fR
For existing \fIOCFS2\fR volumes, \fImkfs.ocfs2\fR ensures the volume
is not mounted on any node in the cluster before formatting. For that to
work, \fImkfs.ocfs2\fR expects the cluster service to be online.
Specify this option to disable this check.

.TP
\fB\-J, \-\-journal-options\fR \fIoptions\fR
Create the journal using options specified on the command\-line. Journal
options are comma separated, and may take an argument using the equals
('=') sign. The following options are supported:
.RS 1.2i
.TP
\fBsize\fR=\fIjournal\-size\fR
Create a journal of size \fIjournal\-size\fR. Minimum size is 4M.
If omitted, a value is heuristically determined based upon the file system size.
.RE
.RS 1.2i
.TP
\fBblock32\fR
Use a standard 32bit journal.  The journal will be able to access up to
2^32-1 blocks.  This is the default.  It has been the journal format for
\fIOCFS2\fR volumes since the beginning.  The journal is compatible with
all versions of \fIOCFS2\fR.  Prepending \fBno\fR is equivalent to the
\fBblock64\fR journal option.
.RE
.RS 1.2i
.TP
\fBblock64\fR
Use a 64bit journal.  The journal will be able to access up to 2^64-1
blocks.  This allows large filesystems that can extend to the
theoretical limits of \fIOCFS2\fR.  It requires a new-enough filesystem
driver that uses the new journalled block device, \fBJBD2\fR. Prepending
\fBno\fR is equivalent to the \fBblock32\fR journal option.
.RE

.TP
\fB\-L, \-\-label\fR \fIvolume\-label\fR
Set the volume label for the file system. This is
useful for mounting\-by\-label. Limit the label to under 64 bytes.

.TP
\fB\-M, \-\-mount\fR \fImount\-type\fR
Valid types are \fIlocal\fR and \fIcluster\fR. Local mount allows users
to mount the volume without the cluster overhead and works only with \fIOCFS2\fR
bundled with Linux kernels 2.6.20 or later. Defaults to \fIcluster\fR.

.TP
\fB\-N, \-\-node\-slots\fR \fInumber\-of\-node\-slots\fR
Valid number ranges from 1 to 255. This number specifies the maximum
number of nodes that can concurrently mount the partition. If omitted,
the number defaults to 8. The number of slots can be later tuned up or
down using \fItunefs.ocfs2\fR.

.TP
\fB\-T\fR \fIfilesystem\-type\fR
Specify how the filesystem is going to be used, so that \fImkfs.ocfs2\fR can
chose optimal filesystem parameters for that use. The supported
filesystem types are:
.RS 1.2i
.TP
\fBmail\fR
Appropriate for file systems that will host lots of small files.
.RE
.RS 1.2i
.TP
\fBdatafiles\fR
Appropriate for file systems that will host a relatively small number
of very large files.
.RE
.RS 1.2i
.TP
\fBvmstore\fR
Appropriate for file systems that will host Virtual machine images.
.RE

.TP
\fB\-\-fs\-features=\fR\fR\fI[no]sparse...\fR
Turn specific file system features on or off. A comma separated list of feature flags can be provided, and \fImkfs.ocfs2\fR will try to create the file system with those features set according to the list. To turn a feature on, include it in the list. To turn a feature off, prepend \fBno\fR to the name. Choices here will override individual features set via the \fB\-\-fs\-feature\-level\fR option. \fBRefer to the section titled feature compatibility before selecting specific features.\fR The following flags are supported:
.RS 1.2i
.TP
\fBbackup-super\fR
\fImkfs.ocfs2\fR, by default, makes up to 6 backup copies of the super block at offsets 1G, 4G, 16G, 64G, 256G and 1T depending on the size of the volume.  This can be useful in disaster recovery. This feature is fully compatible with all versions of the file system and generally should not be disabled.
.RE
.RS 1.2i
.TP
\fBlocal\fR
Create the file system as a local mount, so that it can be mounted without a cluster stack.
.RE
.RS 1.2i
.TP
\fBsparse\fR
Enable support for sparse files. With this, \fIOCFS2\fR can avoid allocating (and zeroing) data to fill holes. Turn this feature on if you can, otherwise extends and some writes might be less performant.
.RE
.RS 1.2i
.TP
\fBunwritten\fR
Enable unwritten extents support. With this turned on, an application can request that a range of clusters be pre-allocated within a file. \fIOCFS2\fR will mark those extents with a special flag so that expensive data zeroing doesn't have to be performed. Reads and writes to a pre-allocated region act as reads and writes to a hole, except a write will not fail due to lack of data allocation. This feature requires \fBsparse\fR file support to be turned on.
.RE
.RS 1.2i
.TP
\fBinline-data\fR
Enable inline-data support. If this feature is turned on, \fIOCFS2\fR will store small files and directories inside the inode block. Data is transparently moved out to an extent when it no longer fits inside the inode block. In some cases, this can also make a positive impact on cold-cache directory and file operations.
.RE
.RS 1.2i
.TP
\fBextended-slotmap\fR
The slot-map is a hidden file on an \fIOCFS2\fR fs which is used to map mounted nodes to system file resources. The extended slot map allows a larger range of possible node numbers, which is useful for userspace cluster stacks. This feature is automatically turned on when needed, thus users have no need to turn this on manually.
.RE
.RS 1.2i
.TP
\fBmetaecc\fR
Enables metadata checksums. With this enabled, the file system computes and stores the checksums in all metadata blocks. It also computes and stores an error correction code capable of fixing single bit errors.
.RE
.RS 1.2i
.TP
\fBrefcount\fR
Enables creation of reference counted trees. With this enabled, the file system allows users to create inode-based snapshots and clones known as \fBreflinks\fR.
.RE
.RS 1.2i
.TP
\fBxattr\fR
Enable extended attributes support. With this enabled, users can attach name:value pairs to objects
within the file system. In \fIOCFS2\fR, the names can be upto 255 bytes in length, terminated by the first
NUL byte. While it is not required, printable names (ASCII) are recommended. The values can be upto 64KB of
arbitrary binary data. Attributes can be attached to all types of inodes: regular files, directories,
symbolic links, device nodes, etc. This feature is required for users wanting to use extended security
facilities like POSIX ACLs or SELinux.
.RE
.RS 1.2i
.TP
\fBusrquota\fR
Enable user quota support. With this feature enabled, filesystem will track amount of space
and number of inodes (files, directories, symbolic links) each user owns. It is then possible
to limit the maximum amount of space or inodes user can have. See a documentation of
quota-tools package for more details.
.RE
.RS 1.2i
.TP
\fBgrpquota\fR
Enable group quota support. With this feature enabled, filesystem will track amount of space
and number of inodes (files, directories, symbolic links) each group owns. It is then possible
to limit the maximum amount of space or inodes user can have. See a documentation of
quota-tools package for more details.
.RE
.RS 1.2i
.TP
\fBindexed-dirs\fR
Enable directory indexing support. With this feature enabled, the file system creates indexed tree for non-inline directory entries. For large scale directories, directory entry lookup perfromance from the indexed tree is faster then from the legacy directory blocks.
.RE
.RS 1.2i
.TP
\fBdiscontig-bg\fR
Enables discontiguous block groups. With this feature enabled, the file system is able to grow
the inode and the extent allocators even when there is no contiguous free chunk available. It
allows the file system to grow the allocators in smaller (discontiguous) chunks.
.RE

.TP
\fB\-\-fs\-feature\-level=\fR\fR\fIfeature\-level\fR
Choose from a set of pre-determined file-system features. This option is designed to allow users to conveniently choose a set of file system features which fits their needs. There is no downside to trying a set of features which your module might not support - if it won't mount the new file system simply reformat at a lower level. Feature levels can be fine-tuned via the \fB\-\-fs\-features\fR option. Currently, there are 3 types of feature levels:
.RS 1.2i
.TP
\fBmax-compat\fR
Chooses fewer features but ensures that the file system can be mounted from older versions of the \fIOCFS2\fR module.
.RE
.RS 1.2i
.TP
\fBdefault\fR
The default feature set tries to strike a balance between providing new features and maintaining compatibility with relatively recent versions of \fIOCFS2\fR. It currently enables \fBsparse\fR, \fBunwritten\fR \fBinline-data\fR and \fBxattr\fR. It also enables \fBrefcount\fR for the \fIvmstore\fR volumes.
.RE
.RS 1.2i
.TP
\fBmax-features\fR
Choose the maximum amount of features available. This will typically provide the best performance from \fIOCFS2\fR at the expense of creating a file system that is only compatible with very recent versions of the \fIOCFS2\fR kernel module.
.RE

.TP
\fB\-\-no-backup-super\fR
This option is deprecated, please use \fB--fs-features=nobackup-super\fR instead.

.TP
\fB\-n, --dry-run\fR
Display the heuristically determined values without overwriting the existing file system.

.TP
\fB\-q, \-\-quiet\fR
Quiet mode.

.TP
\fB\-v, \-\-verbose\fR
Verbose mode.

.TP
\fB\-V, \-\-version\fR
Print version and exit.

.TP
\fIblocks-count\fR
Usually \fBmkfs.ocfs2\fR automatically determines the size of the given device
and creates a file system that uses all of the available space on the
device.  This optional argument specifies that the file system should only
consume the given number of file system blocks (see \fB-b\fR) on the device.

.SH "FEATURE COMPATIBILITY"
This section lists the file system features that have been added to the \fIOCFS2\fR
file system and the version that it first appeared in. The table below lists the versions
of the mainline Linux kernel and that of the file system for the Enterprise Linux
Distributions. Users should use this information to enable only those features that
are available in the file system that they are using. Before enabling new features,
users are advised to review to the section titled \fBfeature values\fR.

.TS
CENTER ALLBOX;
LI LI LI
LB C C.
Feature	Mainline Kernel Version	Enterprise OCFS2 Version
local	Linux 2.6.20	OCFS2 1.2
sparse	Linux 2.6.22	OCFS2 1.4
unwritten	Linux 2.6.23	OCFS2 1.4
inline-data	Linux 2.6.24	OCFS2 1.4
extended-slotmap	Linux 2.6.27	OCFS2 1.6
metaecc	Linux 2.6.29	OCFS2 1.6
grpquota	Linux 2.6.29	OCFS2 1.6
usrquota	Linux 2.6.29	OCFS2 1.6
xattr	Linux 2.6.29	OCFS2 1.6
indexed-dirs	Linux 2.6.30	OCFS2 1.6
refcount	Linux 2.6.32	OCFS2 1.6
discontig-bg	Linux 2.6.35	OCFS2 1.6
.TE

.TS
;
L.
Users can query the features enabled in the file system as follows:
.TE

.TS
;
L.
[root@node ~]# tunefs.ocfs2 -Q "Label: %V\\nFeatures: %H %O\\n" /dev/sdg1
Label: apache_files_10
Features: sparse inline-data unwritten
.TE

.SH "FEATURE VALUES"
This section lists the hex values that are associated with the file system features.
This information is useful when debugging mount failures that are due to feature
incompatibility. When a user attempts to mount an \fBOCFS2\fR volume that has features
enabled that are not supported by the running file system software, it will fail
with an error like:

\fBERROR: couldn't mount because of unsupported optional features (200).\fR

By referring to the table below, it becomes apparent that the user attempted to mount
a volume with the \fIxattr\fR (extended attributes) feature enabled with a version of
the file system software that did not support it. At this stage, the user has the option
of either upgrading the file system software, or, disabling that on-disk feature using
\fBtunefs.ocfs2\fR.

Some features allow the file system to be mounted with an older version of the software
provided the mount is read-only. If a user attempts to mount such a volume in a read-write
mode, it will fail with an error like:

\fBERROR: couldn't mount RDWR because of unsupported optional features (1).\fR

This error indicates that the volume had the \fIunwritten\fR RO compat feature enabled.
This volume can be mounted by an older file system software only in the read-only mode.
In this case, the user has the option of either mounting the volume with the \fIro\fR
mount option, or, disabling that on-disk feature using \fBtunefs.ocfs2\fR.

.TS
CENTER ALLBOX;
LI LI LI
LB C C.
Feature	Category	Hex value
local	Incompat	8
sparse	Incompat	10
inline-data	Incompat	40
extended-slotmap	Incompat	100
xattr	Incompat	200
indexed-dirs	Incompat	400
metaecc	Incompat	800
refcount	Incompat	1000
discontig-bg	Incompat	2000
unwritten	RO Compat	1
usrquota	RO Compat	2
grpquota	RO Compat	4
.TE


.SH "SEE ALSO"
.BR debugfs.ocfs2(8)
.BR fsck.ocfs2(8)
.BR tunefs.ocfs2(8)
.BR mounted.ocfs2(8)
.BR ocfs2console(8)
.BR o2cb(7)

.SH "AUTHORS"
Oracle Corporation

.SH "COPYRIGHT"
Copyright \(co 2004, 2010 Oracle. All rights reserved.