1mkfs.ocfs2(8)                 OCFS2 Manual Pages                 mkfs.ocfs2(8)
2
3
4

NAME

6       mkfs.ocfs2 - Creates an OCFS2 file system.
7

SYNOPSIS

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]   [--cluster-stack=stackname]    [--cluster-name=clustername]
13       [--global-heartbeat] [-FqvV] device [blocks-count]
14

DESCRIPTION

16       mkfs.ocfs2  is used to create an OCFS2 file system on a device, usually
17       a partition on a shared disk. In order to prevent data loss, mkfs.ocfs2
18       will  not  format  an  existing  OCFS2  volume if it detects that it is
19       mounted on another node in the cluster. This tool requires the  cluster
20       service to be online.
21
22

OPTIONS

24       -b, --block-size block-size
25              Valid  block size values are 512, 1K, 2K and 4K bytes per block.
26              If omitted, a value will be heuristically  determined  based  on
27              the  expected  usage  of  the file system (see the -T option). A
28              block size of 512 bytes is never recommended. Choose 1K,  2K  or
29              4K.
30
31
32       -C, --cluster-size cluster-size
33              Valid cluster size values are 4K, 8K, 16K, 32K, 64K, 128K, 256K,
34              512K and 1M. If omitted, a value will  be  heuristically  deter‐
35              mined based on the expected usage of the file system (see the -T
36              option). For volumes expected to store large files,  like  data‐
37              base files, while a cluster size of 128K or more is recommended,
38              one can opt for a smaller size as long  as  that  value  is  not
39              smaller than the database block size.  For others, use 4K.
40
41
42       -F, --force
43              For existing OCFS2 volumes, mkfs.ocfs2 ensures the volume is not
44              mounted on any node in the cluster before formatting.  For  that
45              to  work,  mkfs.ocfs2  expects the cluster service to be online.
46              Specify this option to disable this check.
47
48
49       -J, --journal-options options
50              Create the journal using options specified on the  command-line.
51              Journal  options  are  comma separated, and may take an argument
52              using the equals ('=') sign.  The  following  options  are  sup‐
53              ported:
54
55
56              size=journal-size
57                     Create  a  journal  of size journal-size. Minimum size is
58                     4M.  If omitted,  a  value  is  heuristically  determined
59                     based upon the file system size.
60
61
62              block32
63                     Use  a  standard 32bit journal.  The journal will be able
64                     to access up to 2^32-1 blocks.  This is the default.   It
65                     has  been  the journal format for OCFS2 volumes since the
66                     beginning.  The journal is compatible with  all  versions
67                     of  OCFS2.   Prepending  no  is equivalent to the block64
68                     journal option.
69
70
71              block64
72                     Use a 64bit journal.  The journal will be able to  access
73                     up  to 2^64-1 blocks.  This allows large filesystems that
74                     can extend  to  the  theoretical  limits  of  OCFS2.   It
75                     requires a new-enough filesystem driver that uses the new
76                     journalled block device, JBD2. Prepending no  is  equiva‐
77                     lent to the block32 journal option.
78
79
80       -L, --label volume-label
81              Set  the  volume  label  for the file system. This is useful for
82              mounting-by-label. Limit the label to under 64 bytes.
83
84
85       -M, --mount mount-type
86              Valid types are local and cluster. Local mount allows  users  to
87              mount  the  volume  without  the cluster overhead and works only
88              with OCFS2 bundled with Linux kernels 2.6.20 or later.  Defaults
89              to cluster.
90
91
92       -N, --node-slots number-of-node-slots
93              Valid  number  ranges  from  1 to 255. This number specifies the
94              maximum number of nodes that can concurrently mount  the  parti‐
95              tion.  If omitted, the number depends on volume size, for volume
96              size < 2G, it's 2, for 2G <= size < 10G, it's 4, for 10G <= size
97              <  1T,  it's 8, for other size, it's 16. The number of slots can
98              be later tuned up or down using tunefs.ocfs2.
99
100
101       -T filesystem-type
102              Specify how  the  filesystem  is  going  to  be  used,  so  that
103              mkfs.ocfs2 can chose optimal filesystem parameters for that use.
104              The supported filesystem types are:
105
106
107              mail   Appropriate for file systems that will host lots of small
108                     files.
109
110
111              datafiles
112                     Appropriate  for file systems that will host a relatively
113                     small number of very large files.
114
115
116              vmstore
117                     Appropriate for  file  systems  that  will  host  Virtual
118                     machine images.
119
120
121       --fs-features=[no]sparse...
122              Turn  specific file system features on or off. A comma separated
123              list of feature flags can be provided, and mkfs.ocfs2  will  try
124              to  create  the file system with those features set according to
125              the list. To turn a feature on, include it in the list. To  turn
126              a  feature  off, prepend no to the name. Choices here will over‐
127              ride individual features set via the --fs-feature-level  option.
128              Refer to the section titled feature compatibility before select‐
129              ing specific features. The following flags are supported:
130
131
132              backup-super
133                     mkfs.ocfs2, by default, makes up to 6  backup  copies  of
134                     the  super block at offsets 1G, 4G, 16G, 64G, 256G and 1T
135                     depending on the size of the volume.  This can be  useful
136                     in  disaster  recovery.  This feature is fully compatible
137                     with all versions of the file system and generally should
138                     not be disabled.
139
140
141              local  Create  the  file system as a local mount, so that it can
142                     be mounted without a cluster stack.
143
144
145              sparse Enable support for sparse files.  With  this,  OCFS2  can
146                     avoid  allocating  (and zeroing) data to fill holes. Turn
147                     this feature on if you can, otherwise  extends  and  some
148                     writes might be less performant.
149
150
151              unwritten
152                     Enable unwritten extents support. With this turned on, an
153                     application can request that a range of clusters be  pre-
154                     allocated  within  a  file. OCFS2 will mark those extents
155                     with a  special  flag  so  that  expensive  data  zeroing
156                     doesn't  have to be performed. Reads and writes to a pre-
157                     allocated region act as  reads  and  writes  to  a  hole,
158                     except  a write will not fail due to lack of data alloca‐
159                     tion. This feature requires sparse  file  support  to  be
160                     turned on.
161
162
163              inline-data
164                     Enable inline-data support. If this feature is turned on,
165                     OCFS2 will store small files and directories  inside  the
166                     inode block. Data is transparently moved out to an extent
167                     when it no longer fits inside the inode  block.  In  some
168                     cases, this can also make a positive impact on cold-cache
169                     directory and file operations.
170
171
172              extended-slotmap
173                     The slot-map is a hidden file on an  OCFS2  fs  which  is
174                     used  to  map mounted nodes to system file resources. The
175                     extended slot map allows a larger range of possible  node
176                     numbers, which is useful for userspace cluster stacks. If
177                     required, this feature  is  automatically  turned  on  by
178                     mkfs.ocfs2.
179
180
181              metaecc
182                     Enables  metadata  checksums. With this enabled, the file
183                     system computes and stores the checksums in all  metadata
184                     blocks.  It  also computes and stores an error correction
185                     code capable of fixing single bit errors.
186
187
188              refcount
189                     Enables creation of reference counted  trees.  With  this
190                     enabled,  the  file  system allows users to create inode-
191                     based snapshots and clones known as reflinks.
192
193
194              xattr  Enable extended attributes support.  With  this  enabled,
195                     users  can  attach name:value pairs to objects within the
196                     file system. In OCFS2, the names can be upto 255 bytes in
197                     length, terminated by the first NUL byte. While it is not
198                     required, printable names (ASCII)  are  recommended.  The
199                     values  can  be  upto  64KB  of  arbitrary  binary  data.
200                     Attributes can be attached to all types of inodes:  regu‐
201                     lar  files,  directories,  symbolic  links, device nodes,
202                     etc. This feature is required for users  wanting  to  use
203                     extended security facilities like POSIX ACLs or SELinux.
204
205
206              usrquota
207                     Enable  user  quota  support.  With this feature enabled,
208                     filesystem will track  amount  of  space  and  number  of
209                     inodes  (files,  directories,  symbolic  links) each user
210                     owns. It is then possible to limit the maximum amount  of
211                     space  or  inodes  user  can have. See a documentation of
212                     quota-tools package for more details.
213
214
215              grpquota
216                     Enable group quota support. With  this  feature  enabled,
217                     filesystem  will  track  amount  of  space  and number of
218                     inodes (files, directories, symbolic  links)  each  group
219                     owns.  It is then possible to limit the maximum amount of
220                     space or inodes user can have.  See  a  documentation  of
221                     quota-tools package for more details.
222
223
224              indexed-dirs
225                     Enable  directory  indexing  support.  With  this feature
226                     enabled, the file system creates indexed  tree  for  non-
227                     inline  directory  entries.  For large scale directories,
228                     directory entry lookup perfromance from the indexed  tree
229                     is faster then from the legacy directory blocks.
230
231
232              discontig-bg
233                     Enables  discontiguous  block  groups.  With this feature
234                     enabled, the file system is able to grow  the  inode  and
235                     the  extent  allocators  even when there is no contiguous
236                     free chunk available. It allows the file system  to  grow
237                     the allocators in smaller (discontiguous) chunks.
238
239
240              clusterinfo
241                     Enables  storing  the  cluster  stack  information in the
242                     superblock. This feature is needed to  support  userspace
243                     cluster  stacks and the global heartbeat mode in the o2cb
244                     cluster stack. If needed, this feature  is  automatically
245                     turned on by mkfs.ocfs2.
246
247
248       --fs-feature-level=feature-level
249              Choose  from  a set of pre-determined file-system features. This
250              option is designed to allow users to conveniently choose  a  set
251              of  file  system  features  which  fits their needs. There is no
252              downside to trying a set of features which your module might not
253              support  - if it won't mount the new file system simply reformat
254              at a lower level. Feature  levels  can  be  fine-tuned  via  the
255              --fs-features  option.  Currently,  there are 3 types of feature
256              levels:
257
258
259              max-compat
260                     Chooses fewer features but ensures that the  file  system
261                     can be mounted from older versions of the OCFS2 module.
262
263
264              default
265                     The default feature set tries to strike a balance between
266                     providing new features and maintaining compatibility with
267                     relatively recent versions of OCFS2. It currently enables
268                     sparse, unwritten, inline-data, xattr, indexed-dirs, dis‐
269                     contig-bg, refcount, extended-slotmap and clusterinfo.
270
271
272              max-features
273                     Choose  the  maximum  amount  of features available. This
274                     will typically provide the best performance from OCFS2 at
275                     the  expense  of creating a file system that is only com‐
276                     patible with very recent versions  of  the  OCFS2  kernel
277                     module.
278
279
280       --cluster-stack
281              Specify  the cluster stack. This option is normally not required
282              as mkfs.ocfs2 chooses the currently active cluster stack. It  is
283              required  only  if  the cluster stack is not online and the user
284              wishes to use a stack other than the default, o2cb.  Other  sup‐
285              ported cluster stacks are pcmk (Pacemaker) and cman (rgmanager).
286              Once set, OCFS2 will only  allow  mounting  the  volume  if  the
287              active  cluster stack and cluster name matches the one specified
288              on-disk.
289
290
291       --cluster-name
292              Specify the name of the cluster. This option is mandatory if the
293              user has specified a cluster-stack. This name is restricted to a
294              max of 16  characters.  Additionally,  the  o2cb  cluster  stack
295              allows only alpha-numeric characters.
296
297
298       --global-heartbeat
299              Enable the global heartbeat mode of the o2cb cluster stack. This
300              option is not required if the o2cb  cluster  stack  with  global
301              heartbeat  is online as mkfs.ocfs2 will detect the active stack.
302              However, if the cluster stack is not up,  then  this  option  is
303              required  alongwith  cluster-stack  and cluster-name.  For more,
304              refer to o2cb(7).
305
306
307       --no-backup-super
308              This option is deprecated,  please  use  --fs-features=nobackup-
309              super instead.
310
311
312       -n, --dry-run
313              Display  the heuristically determined values without overwriting
314              the existing file system.
315
316
317       -q, --quiet
318              Quiet mode.
319
320
321       -U uuid
322              Specify      a      custom      UUID      in      the      plain
323              (2A4D1C581FAA42A1A41D26EFC90C1315)         or        traditional
324              (2a4d1c58-1faa-42a1-a41d-26efc90c1315) format.  This  option  in
325              not  recommended  because  the  file  system  uses  the  UUID to
326              uniquely identify a file system. If more than  one  file  system
327              were  to  have  the  same  UUID, one is very likely to encounter
328              erratic behavior, if not, outright file system corruption.
329
330
331       -v, --verbose
332              Verbose mode.
333
334
335       -V, --version
336              Print version and exit.
337
338
339       blocks-count
340              Usually mkfs.ocfs2 automatically  determines  the  size  of  the
341              given  device  and  creates  a  file system that uses all of the
342              available space on the device.  This optional argument specifies
343              that  the  file  system  should only consume the given number of
344              file system blocks (see -b) on the device.
345
346

FEATURE COMPATIBILITY

348       This section lists the file system features that have been added to the
349       OCFS2  file system and the version that it first appeared in. The table
350       below lists the versions of the mainline Linux kernel and  ocfs2-tools.
351       Users  should  use  this information to enable only those features that
352       are available in the file system that they are using.  Before  enabling
353       new features, users are advised to review to the section titled feature
354       values.
355
356
357                ┌─────────────────┬────────────────┬─────────────────┐
358Feature          Kernel Version Tools Version   
359                ├─────────────────┼────────────────┼─────────────────┤
360local            │  Linux 2.6.20  │ ocfs2-tools 1.2 │
361                ├─────────────────┼────────────────┼─────────────────┤
362sparse           │  Linux 2.6.22  │ ocfs2-tools 1.4 │
363                ├─────────────────┼────────────────┼─────────────────┤
364unwritten        │  Linux 2.6.23  │ ocfs2-tools 1.4 │
365                ├─────────────────┼────────────────┼─────────────────┤
366inline-data      │  Linux 2.6.24  │ ocfs2-tools 1.4 │
367                ├─────────────────┼────────────────┼─────────────────┤
368extended-slotmap │  Linux 2.6.27  │ ocfs2-tools 1.6 │
369                ├─────────────────┼────────────────┼─────────────────┤
370metaecc          │  Linux 2.6.29  │ ocfs2-tools 1.6 │
371                ├─────────────────┼────────────────┼─────────────────┤
372grpquota         │  Linux 2.6.29  │ ocfs2-tools 1.6 │
373                ├─────────────────┼────────────────┼─────────────────┤
374usrquota         │  Linux 2.6.29  │ ocfs2-tools 1.6 │
375                ├─────────────────┼────────────────┼─────────────────┤
376xattr            │  Linux 2.6.29  │ ocfs2-tools 1.6 │
377                ├─────────────────┼────────────────┼─────────────────┤
378indexed-dirs     │  Linux 2.6.30  │ ocfs2-tools 1.6 │
379                ├─────────────────┼────────────────┼─────────────────┤
380refcount         │  Linux 2.6.32  │ ocfs2-tools 1.6 │
381                ├─────────────────┼────────────────┼─────────────────┤
382discontig-bg     │  Linux 2.6.35  │ ocfs2-tools 1.6 │
383                ├─────────────────┼────────────────┼─────────────────┤
384clusterinfo      │  Linux 2.6.37  │ ocfs2-tools 1.8 │
385                └─────────────────┴────────────────┴─────────────────┘
386
387       Users can query the features enabled in the file system as follows:
388
389       # tunefs.ocfs2 -Q "Label: %V\nFeatures: %H %O\n" /dev/sdg1
390       Label: apache_files_10
391       Features: sparse inline-data unwritten
392
393

FEATURE VALUES

395       This section lists the hex values that are  associated  with  the  file
396       system features.  This information is useful when debugging mount fail‐
397       ures that are due to feature incompatibility. When a user  attempts  to
398       mount  an OCFS2 volume that has features enabled that are not supported
399       by the running file system software, it will fail with an error like:
400
401       ERROR: couldn't mount because of unsupported optional features (200).
402
403       By referring to the table below, it  becomes  apparent  that  the  user
404       attempted  to  mount a volume with the xattr (extended attributes) fea‐
405       ture enabled with a version of the file system software  that  did  not
406       support  it. At this stage, the user has the option of either upgrading
407       the file system software, or,  disabling  that  on-disk  feature  using
408       tunefs.ocfs2.
409
410       Some features allow the file system to be mounted with an older version
411       of the software provided the mount is read-only. If a user attempts  to
412       mount  such  a  volume in a read-write mode, it will fail with an error
413       like:
414
415       ERROR: couldn't mount RDWR because of unsupported optional features (1).
416
417       This error indicates that the volume had the unwritten RO  compat  fea‐
418       ture enabled.  This volume can be mounted by an older file system soft‐
419       ware only in the read-only mode.  In this case, the user has the option
420       of  either  mounting the volume with the ro mount option, or, disabling
421       that on-disk feature using tunefs.ocfs2.
422
423
424                     ┌─────────────────┬───────────┬───────────┐
425FeatureCategoryHex value
426                     ├─────────────────┼───────────┼───────────┤
427local            │ Incompat  │     8     │
428                     ├─────────────────┼───────────┼───────────┤
429sparse           │ Incompat  │    10     │
430                     ├─────────────────┼───────────┼───────────┤
431inline-data      │ Incompat  │    40     │
432                     ├─────────────────┼───────────┼───────────┤
433extended-slotmap │ Incompat  │    100    │
434                     ├─────────────────┼───────────┼───────────┤
435xattr            │ Incompat  │    200    │
436                     ├─────────────────┼───────────┼───────────┤
437indexed-dirs     │ Incompat  │    400    │
438                     ├─────────────────┼───────────┼───────────┤
439metaecc          │ Incompat  │    800    │
440                     ├─────────────────┼───────────┼───────────┤
441refcount         │ Incompat  │   1000    │
442                     ├─────────────────┼───────────┼───────────┤
443discontig-bg     │ Incompat  │   2000    │
444                     ├─────────────────┼───────────┼───────────┤
445clusterinfo      │ Incompat  │   4000    │
446                     ├─────────────────┼───────────┼───────────┤
447unwritten        │ RO Compat │     1     │
448                     ├─────────────────┼───────────┼───────────┤
449usrquota         │ RO Compat │     2     │
450                     ├─────────────────┼───────────┼───────────┤
451grpquota         │ RO Compat │     4     │
452                     └─────────────────┴───────────┴───────────┘
453
454

SEE ALSO

456       debugfs.ocfs2(8) fsck.ocfs2(8) mount.ocfs2(8) mounted.ocfs2(8)  o2cb(7)
457       o2cluster(8) o2image(8) o2info(1) tunefs.ocfs2(8)
458
459

AUTHORS

461       Oracle Corporation
462
463
465       Copyright © 2004, 2012 Oracle. All rights reserved.
466
467
468
469Version 1.8.5                    January 2012                    mkfs.ocfs2(8)
Impressum