1
.TH "mkfs.ocfs2" "8" "September 2010" "Version 1.6.3" "OCFS2 Manual Pages"
3
mkfs.ocfs2 \- Creates an \fIOCFS2\fR file system.
5
\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]
8
\fBmkfs.ocfs2\fR is used to create an \fIOCFS2\fR file system on a \fIdevice\fR,
9
usually a partition on a shared disk. In order to prevent data loss,
10
\fBmkfs.ocfs2\fR will not format an existing \fIOCFS2\fR volume if it
11
detects that it is mounted on another node in the cluster. This tool
12
requires the cluster service to be online.
16
\fB\-b, \-\-block\-size\fR \fIblock\-size\fR
17
Valid block size values are 512, 1K, 2K and 4K bytes per block. If
18
omitted, a value will be heuristically determined based on the
19
expected usage of the file system (see the \fB\-T\fR option). A block
20
size of 512 bytes is never recommended. Choose 1K, 2K or 4K.
23
\fB\-C, \-\-cluster\-size\fR \fIcluster\-size\fR
24
Valid cluster size values are 4K, 8K, 16K, 32K, 64K, 128K, 256K, 512K
25
and 1M. If omitted, a value will be heuristically determined based on
26
the expected usage of the file system (see the \fB\-T\fR option). For
27
volumes expected to store large files, like database files, while a
28
cluster size of 128K or more is recommended, one can opt for a smaller
29
size as long as that value is not smaller than the database block size.
34
For existing \fIOCFS2\fR volumes, \fImkfs.ocfs2\fR ensures the volume
35
is not mounted on any node in the cluster before formatting. For that to
36
work, \fImkfs.ocfs2\fR expects the cluster service to be online.
37
Specify this option to disable this check.
40
\fB\-J, \-\-journal-options\fR \fIoptions\fR
41
Create the journal using options specified on the command\-line. Journal
42
options are comma separated, and may take an argument using the equals
43
('=') sign. The following options are supported:
46
\fBsize\fR=\fIjournal\-size\fR
47
Create a journal of size \fIjournal\-size\fR. Minimum size is 4M.
48
If omitted, a value is heuristically determined based upon the file system size.
53
Use a standard 32bit journal. The journal will be able to access up to
54
2^32-1 blocks. This is the default. It has been the journal format for
55
\fIOCFS2\fR volumes since the beginning. The journal is compatible with
56
all versions of \fIOCFS2\fR. Prepending \fBno\fR is equivalent to the
57
\fBblock64\fR journal option.
62
Use a 64bit journal. The journal will be able to access up to 2^64-1
63
blocks. This allows large filesystems that can extend to the
64
theoretical limits of \fIOCFS2\fR. It requires a new-enough filesystem
65
driver that uses the new journalled block device, \fBJBD2\fR. Prepending
66
\fBno\fR is equivalent to the \fBblock32\fR journal option.
70
\fB\-L, \-\-label\fR \fIvolume\-label\fR
71
Set the volume label for the file system. This is
72
useful for mounting\-by\-label. Limit the label to under 64 bytes.
75
\fB\-M, \-\-mount\fR \fImount\-type\fR
76
Valid types are \fIlocal\fR and \fIcluster\fR. Local mount allows users
77
to mount the volume without the cluster overhead and works only with \fIOCFS2\fR
78
bundled with Linux kernels 2.6.20 or later. Defaults to \fIcluster\fR.
81
\fB\-N, \-\-node\-slots\fR \fInumber\-of\-node\-slots\fR
82
Valid number ranges from 1 to 255. This number specifies the maximum
83
number of nodes that can concurrently mount the partition. If omitted,
84
the number defaults to 8. The number of slots can be later tuned up or
85
down using \fItunefs.ocfs2\fR.
88
\fB\-T\fR \fIfilesystem\-type\fR
89
Specify how the filesystem is going to be used, so that \fImkfs.ocfs2\fR can
90
chose optimal filesystem parameters for that use. The supported
95
Appropriate for file systems that will host lots of small files.
100
Appropriate for file systems that will host a relatively small number
106
Appropriate for file systems that will host Virtual machine images.
110
\fB\-\-fs\-features=\fR\fR\fI[no]sparse...\fR
111
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:
115
\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.
120
Create the file system as a local mount, so that it can be mounted without a cluster stack.
125
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.
130
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.
135
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.
139
\fBextended-slotmap\fR
140
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.
145
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.
150
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.
155
Enable extended attributes support. With this enabled, users can attach name:value pairs to objects
156
within the file system. In \fIOCFS2\fR, the names can be upto 255 bytes in length, terminated by the first
157
NUL byte. While it is not required, printable names (ASCII) are recommended. The values can be upto 64KB of
158
arbitrary binary data. Attributes can be attached to all types of inodes: regular files, directories,
159
symbolic links, device nodes, etc. This feature is required for users wanting to use extended security
160
facilities like POSIX ACLs or SELinux.
165
Enable user quota support. With this feature enabled, filesystem will track amount of space
166
and number of inodes (files, directories, symbolic links) each user owns. It is then possible
167
to limit the maximum amount of space or inodes user can have. See a documentation of
168
quota-tools package for more details.
173
Enable group quota support. With this feature enabled, filesystem will track amount of space
174
and number of inodes (files, directories, symbolic links) each group owns. It is then possible
175
to limit the maximum amount of space or inodes user can have. See a documentation of
176
quota-tools package for more details.
181
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.
186
Enables discontiguous block groups. With this feature enabled, the file system is able to grow
187
the inode and the extent allocators even when there is no contiguous free chunk available. It
188
allows the file system to grow the allocators in smaller (discontiguous) chunks.
192
\fB\-\-fs\-feature\-level=\fR\fR\fIfeature\-level\fR
193
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:
197
Chooses fewer features but ensures that the file system can be mounted from older versions of the \fIOCFS2\fR module.
202
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.
207
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.
211
\fB\-\-no-backup-super\fR
212
This option is deprecated, please use \fB--fs-features=nobackup-super\fR instead.
216
Display the heuristically determined values without overwriting the existing file system.
223
\fB\-v, \-\-verbose\fR
227
\fB\-V, \-\-version\fR
228
Print version and exit.
232
Usually \fBmkfs.ocfs2\fR automatically determines the size of the given device
233
and creates a file system that uses all of the available space on the
234
device. This optional argument specifies that the file system should only
235
consume the given number of file system blocks (see \fB-b\fR) on the device.
237
.SH "FEATURE COMPATIBILITY"
238
This section lists the file system features that have been added to the \fIOCFS2\fR
239
file system and the version that it first appeared in. The table below lists the versions
240
of the mainline Linux kernel and that of the file system for the Enterprise Linux
241
Distributions. Users should use this information to enable only those features that
242
are available in the file system that they are using. Before enabling new features,
243
users are advised to review to the section titled \fBfeature values\fR.
249
Feature Mainline Kernel Version Enterprise OCFS2 Version
250
local Linux 2.6.20 OCFS2 1.2
251
sparse Linux 2.6.22 OCFS2 1.4
252
unwritten Linux 2.6.23 OCFS2 1.4
253
inline-data Linux 2.6.24 OCFS2 1.4
254
extended-slotmap Linux 2.6.27 OCFS2 1.6
255
metaecc Linux 2.6.29 OCFS2 1.6
256
grpquota Linux 2.6.29 OCFS2 1.6
257
usrquota Linux 2.6.29 OCFS2 1.6
258
xattr Linux 2.6.29 OCFS2 1.6
259
indexed-dirs Linux 2.6.30 OCFS2 1.6
260
refcount Linux 2.6.32 OCFS2 1.6
261
discontig-bg Linux 2.6.35 OCFS2 1.6
267
Users can query the features enabled in the file system as follows:
273
[root@node1 ~]# tunefs.ocfs2 -Q "Label: %V\\nFeatures: %H %O\\n" /dev/sdg1
274
Label: apache_files_10
275
Features: sparse inline-data unwritten
279
This section lists the hex values that are associated with the file system features.
280
This information is useful when debugging mount failures that are due to feature
281
incompatibility. When a user attempts to mount an \fBOCFS2\fR volume that has features
282
enabled that are not supported by the running file system software, it will fail
285
\fBERROR: couldn't mount because of unsupported optional features (200).\fR
287
By referring to the table below, it becomes apparent that the user attempted to mount
288
a volume with the \fIxattr\fR (extended attributes) feature enabled with a version of
289
the file system software that did not support it. At this stage, the user has the option
290
of either upgrading the file system software, or, disabling that on-disk feature using
293
Some features allow the file system to be mounted with an older version of the software
294
provided the mount is read-only. If a user attempts to mount such a volume in a read-write
295
mode, it will fail with an error like:
297
\fBERROR: couldn't mount RDWR because of unsupported optional features (1).\fR
299
This error indicates that the volume had the \fIunwritten\fR RO compat feature enabled.
300
This volume can be mounted by an older file system software only in the read-only mode.
301
In this case, the user has the option of either mounting the volume with the \fIro\fR
302
mount option, or, disabling that on-disk feature using \fBtunefs.ocfs2\fR.
308
Feature Category Hex value
311
inline-data Incompat 40
312
extended-slotmap Incompat 100
314
indexed-dirs Incompat 400
316
refcount Incompat 1000
317
discontig-bg Incompat 2000
318
unwritten RO Compat 1
336
Copyright \(co 2004, 2010 Oracle. All rights reserved.