1mkfs.ocfs2(8) OCFS2 Manual Pages mkfs.ocfs2(8)
2
3
4
6 mkfs.ocfs2 - Creates an OCFS2 file system.
7
9 mkfs.ocfs2 [-b block-size] [-C cluster-size] [-L volume-label] [-M
10 mount-type] [-N number-of-nodes] [-J journal-options] [--fs-fea‐
11 tures=[no]sparse...] [--fs-feature-level=feature-level] [-T filesys‐
12 tem-type] [-FqvV] device [blocks-count]
13
15 mkfs.ocfs2 is used to create an OCFS2 file system on a device, usually
16 a partition on a shared disk. In order to prevent data loss, mkfs.ocfs2
17 will not format an existing OCFS2 volume if it detects that it is
18 mounted on another node in the cluster. This tool requires the cluster
19 service to be online.
20
21
23 -b, --block-size block-size
24 Valid block size values are 512, 1K, 2K and 4K bytes per block.
25 If omitted, a value will be heuristically determined based on
26 the expected usage of the file system (see the -T option). A
27 block size of 512 bytes is never recommended. Choose 1K, 2K or
28 4K.
29
30
31 -C, --cluster-size cluster-size
32 Valid cluster size values are 4K, 8K, 16K, 32K, 64K, 128K, 256K,
33 512K and 1M. If omitted, a value will be heuristically deter‐
34 mined based on the expected usage of the file system (see the -T
35 option). For volumes expected to store large files, like data‐
36 base files, while a cluster size of 128K or more is recommended,
37 one can opt for a smaller size as long as that value is not
38 smaller than the database block size. For others, use 4K.
39
40
41 -F, --force
42 For existing OCFS2 volumes, mkfs.ocfs2 ensures the volume is not
43 mounted on any node in the cluster before formatting. For that
44 to work, mkfs.ocfs2 expects the cluster service to be online.
45 Specify this option to disable this check.
46
47
48 -J, --journal-options options
49 Create the journal using options specified on the command-line.
50 Journal options are comma separated, and may take an argument
51 using the equals ('=') sign. The following options are sup‐
52 ported:
53
54 size=journal-size
55 Create a journal of size journal-size. Minimum size
56 is 4M. If omitted, a value is heuristically deter‐
57 mined based upon the file system size.
58
59 block32
60 Use a standard 32bit journal. The journal will be
61 able to access up to 2^32-1 blocks. This is the
62 default. It has been the journal format for OCFS2
63 volumes since the beginning. The journal is compat‐
64 ible with all versions of OCFS2. Prepending no is
65 equivalent to the block64 journal option.
66
67 block64
68 Use a 64bit journal. The journal will be able to
69 access up to 2^64-1 blocks. This allows large
70 filesystems that can extend to the theoretical lim‐
71 its of OCFS2. It requires a new-enough filesystem
72 driver that uses the new journalled block device,
73 JBD2. Prepending no is equivalent to the block32
74 journal option.
75
76
77 -L, --label volume-label
78 Set the volume label for the file system. This is useful for
79 mounting-by-label. Limit the label to under 64 bytes.
80
81
82 -M, --mount mount-type
83 Valid types are local and cluster. Local mount allows users to
84 mount the volume without the cluster overhead and works only
85 with OCFS2 bundled with Linux kernels 2.6.20 or later. Defaults
86 to cluster.
87
88
89 -N, --node-slots number-of-node-slots
90 Valid number ranges from 1 to 255. This number specifies the
91 maximum number of nodes that can concurrently mount the parti‐
92 tion. If omitted, the number defaults to 8. The number of slots
93 can be later tuned up or down using tunefs.ocfs2.
94
95
96 -T filesystem-type
97 Specify how the filesystem is going to be used, so that
98 mkfs.ocfs2 can chose optimal filesystem parameters for that use.
99 The supported filesystem types are:
100
101 mail Appropriate for file systems which will have many
102 meta data updates. Creates a larger journal.
103
104 datafiles
105 Appropriate for file systems which will host a rela‐
106 tively small number of very large files. A small
107 journal is selected. Cluster size will be at least
108 128K.
109
110
111 --fs-features=[no]sparse...
112 Turn specific file system features on or off. A comma separated
113 list of feature flags can be provided, and mkfs.ocfs2 will try
114 to create the file system with those features set according to
115 the list. To turn a feature on, include it in the list. To turn
116 a feature off, prepend no to the name. Choices here will over‐
117 ride individual features set via the --fs-feature-level option.
118 Refer to the section titled feature compatibility before select‐
119 ing specific features. The following flags are supported:
120
121 backup-super
122 mkfs.ocfs2, by default, makes up to 6 backup copies
123 of the super block at offsets 1G, 4G, 16G, 64G, 256G
124 and 1T depending on the size of the volume. This
125 can be useful in disaster recovery. This feature is
126 fully compatible with all versions of the file sys‐
127 tem and generally should not be disabled.
128
129 local Create the file system as a local mount, so that it
130 can be mounted without a cluster stack.
131
132 sparse Enable support for sparse files. With this, OCFS2
133 can avoid allocating (and zeroing) data to fill
134 holes. Turn this feature on if you can, otherwise
135 extends and some writes might be less performant.
136
137 unwritten
138 Enable unwritten extents support. With this turned
139 on, an application can request that a range of clus‐
140 ters be pre-allocated within a file. OCFS2 will mark
141 those extents with a special flag so that expensive
142 data zeroing doesn't have to be performed. Reads and
143 writes to a pre-allocated region act as reads and
144 writes to a hole, except a write will not fail due
145 to lack of data allocation. This feature requires
146 sparse file support to be turned on.
147
148 inline-data
149 Enable inline-data support. If this feature is
150 turned on, OCFS2 will store small files and directo‐
151 ries inside the inode block. Data is transparently
152 moved out to an extent when it no longer fits inside
153 the inode block. In some cases, this can also make a
154 positive impact on cold-cache directory and file
155 operations.
156
157 extended-slotmap
158 The slot-map is a hidden file on an OCFS2 fs which
159 is used to map mounted nodes to system file
160 resources. The extended slot map allows a larger
161 range of possible node numbers, which is useful for
162 userspace cluster stacks. This feature is automati‐
163 cally turned on when needed, thus users have no need
164 to turn this on manually.
165
166 xattr Enable extended attributes support. With this
167 enabled, users can attach name:value pairs to
168 objects within the file system. In OCFS2, the names
169 can be upto 255 bytes in length, terminated by the
170 first NUL byte. While it is not required, printable
171 names (ASCII) are recommended. The values can be
172 upto 64KB of arbitrary binary data. Attributes can
173 be attached to all types of inodes: regular files,
174 directories, symbolic links, device nodes, etc. This
175 feature is required for users wanting to use
176 extended security facilities like POSIX ACLs or
177 SELinux.
178
179
180 --fs-feature-level=feature-level
181 Choose from a set of pre-determined file-system features. This
182 option is designed to allow users to conveniently choose a set
183 of file system features which fits their needs. There is no
184 downside to trying a set of features which your module might not
185 support - if it won't mount the new file system simply reformat
186 at a lower level. Feature levels can be fine-tuned via the
187 --fs-features option. Currently, there are 3 types of feature
188 levels:
189
190 max-compat
191 Chooses fewer features but ensures that the file
192 system can be mounted from older versions of the
193 OCFS2 module.
194
195 default
196 The default feature set tries to strike a balance
197 between providing new features and maintaining com‐
198 patibility with relatively recent versions of OCFS2.
199 It currently enables sparse, unwritten and inline-
200 data.
201
202 max-features
203 Choose the maximum amount of features available.
204 This will typically provide the best performance
205 from OCFS2 at the expense of creating a file system
206 that is only compatible with very recent versions of
207 the OCFS2 kernel module.
208
209
210 --no-backup-super
211 This option is deprecated, please use --fs-features=nobackup-
212 super instead.
213
214
215 -q, --quiet
216 Quiet mode.
217
218
219 -v, --verbose
220 Verbose mode.
221
222
223 -V, --version
224 Print version and exit.
225
226
227 blocks-count
228 Usually mkfs.ocfs2 automatically determines the size of the
229 given device and creates a file system that uses all of the
230 available space on the device. This optional argument specifies
231 that the file system should only consume the given number of
232 file system blocks (see -b) on the device.
233
234
236 This section lists the file system features that have been added to the
237 OCFS2 file system and the version that each appeared in. The table
238 below lists the versions of the mainline Linux kernel and that of the
239 file system for the Enterprise Linux Distributions. Users should use
240 this information to enable only those features that are available in
241 the file system that they are using.
242
243
244 ┌─────────────────┬─────────────────────────┬──────────────────────────┐
245 │Feature │ Mainline Kernel Version │ Enterprise OCFS2 Version │
246 ├─────────────────┼─────────────────────────┼──────────────────────────┤
247 │block64 │ Linux 2.6.29 │ Not available as yet │
248 ├─────────────────┼─────────────────────────┼──────────────────────────┤
249 │local │ Linux 2.6.20 │ OCFS2 1.2 and 1.4 │
250 ├─────────────────┼─────────────────────────┼──────────────────────────┤
251 │sparse │ Linux 2.6.22 │ OCFS2 1.4 │
252 ├─────────────────┼─────────────────────────┼──────────────────────────┤
253 │unwritten │ Linux 2.6.23 │ OCFS2 1.4 │
254 ├─────────────────┼─────────────────────────┼──────────────────────────┤
255 │inline-data │ Linux 2.6.24 │ OCFS2 1.4 │
256 ├─────────────────┼─────────────────────────┼──────────────────────────┤
257 │extended-slotmap │ Linux 2.6.27 │ Not available as yet │
258 ├─────────────────┼─────────────────────────┼──────────────────────────┤
259 │xattr │ Linux 2.6.29 │ Not available as yet │
260 └─────────────────┴─────────────────────────┴──────────────────────────┘
261
262 Users can query the features enabled in the file system as follows:
263
264
265 [root@node1 ~]# tunefs.ocfs2 -Q "Label: %V\nFeatures: %H %O\n" /dev/sdg1
266 Label: apache_files_10
267
268 Features: sparse inline-data unwritten
269
270
272 debugfs.ocfs2(8) fsck.ocfs2(8) tunefs.ocfs2(8) mounted.ocfs2(8)
273 ocfs2console(8) o2cb(7)
274
275
277 Oracle Corporation
278
279
281 Copyright © 2004, 2009 Oracle. All rights reserved.
282
283
284
285Version 1.4.3 April 2009 mkfs.ocfs2(8)