title: defragfs.ocfs2(8)

text:
# defragfs.ocfs2(8)

## NAME
defragfs.ocfs2 - online defragmenter for ocfs2 filesystem

## SYNOPSIS
defragfs.ocfs2 [-c] [-v] [-l] [-g] [-h][target]...

## DESCRIPTION
defragfs.ocfs2 reduces fragmentation of ocfs2 based file. The file targeted by defragfs.ocfs2 is created on ocfs2 filesystem The targeted file gets more contiguous blocks and improves the file access speed.

target is a regular file, a directory, or a device that is mounted as ocfs2 filesystem. If target is a directory, defragfs.ocfs2 reduces fragmentation of all files in it. If target is a device, defragfs.ocfs2 gets the mount point of it and reduces fragmentation of all files in this mount point.

## OPTIONS
-c

Print the numbers of files that should be processed

-v

verbose mode, the current fragmentation count and the ideal fragmentation count are printed for each file.

If this option is specified, target is never defragmented.

-l

defragfs.ocfs2 will run in low io mode, which means it will regularly yield cpu to allow other processes to run.

-g

defragfs.ocfs2 regularly records the current progress. So if it is interrupted, the next time you run defragfs.ocfs2 with this option, it will resume from the recorded progress. Note that if this option is specified, other options are ignored and replaced by those that were recorded.

-h

Print help info

## NOTES
defragfs.ocfs2 does not support files in lost+found directory. When target is a device or a mount point, defragfs.ocfs2 doesn't defragment files in mount point of other device.

It is completely not recommended to run against a file while it is actively in another application. Since the read/write of a file involves a dlm lock, this can result in a performance slowdown to both defragfs.ocfs2 and the application due to contention.

If the file system's free space is fragmented, or if there is insufficient free space available, defragfs.ocfs2 may not be able to improve the file's fragmentation.

Non-privileged users can execute defragfs.ocfs2 to their own file. Therefore, it is desirable to be executed by root user.

## AUTHOR
Written by Larry Chen <lchen@suse.com>


title: fsck.ocfs2(8)

summary: Check an OCFS2 file system.

text:
# fsck.ocfs2(8)

## NAME
fsck.ocfs2 - Check an OCFS2 file system.

## SYNOPSIS
fsck.ocfs2 [ -pafFGnuvVy ] [ -b superblock block ] [ -B block size ] device

## DESCRIPTION
fsck.ocfs2 is used to check an OCFS2 file system.

device is the file where the file system is stored (e.g. /dev/sda1). It will almost always be a device file but a regular file will work as well.

## OPTIONS
-a

This option does the same thing as the -p option. It is provided for backwards compatibility only: it is suggested that people use the -p option whenever possible.

-b superblock block

Normally, fsck.ocfs2 will read the superblock from the first block of the device. This option specifies an alternate block that the superblock should be read from. (Use -r instead of this option.)

-B blocksize

The block size, specified in bytes, can range from 512 to 4096. A value of 0, the default, is used to indicate that the blocksize should be automatically detected.

-D

Optimize directories in filesystem. This option causes fsck.ocfs2 to coalesce the directory entries in order to improve the filesystem performance.

-f

Force checking even if the file system is clean.

-F

By default fsck.ocfs2 will check with the cluster services to ensure that the volume is not in-use (mounted) on any node in the cluster before proceeding. -F skips this check and should only be used when it can be guaranteed that the volume is not mounted on any node in the cluster. WARNING: If the cluster check is disabled and the volume is mounted on one or more nodes, file system corruption is very likely. If unsure, do not use this option.

-G

Usually fsck.ocfs2 will silently assume inodes whose generation number does not match the generation number of the super block are unused inodes. This option causes fsck.ocfs2 to ask the user if these inodes should in fact be marked unused.

-n

Give the 'no' answer to all questions that fsck will ask. This guarantees that the file system will not be modified and the device will be opened read-only. The output of fsck.ocfs2 with this option can be redirected to produce a record of a file system's faults.

-p

Automatically repair ("preen") the file system. This option will cause fsck.ocfs2 to automatically fix any problem that can be safely corrected without human intervention. If there are problems that require intervention, the descriptions will be printed and fsck.ocfs2 will exit with the value 4 logically or'd into the exit code. (See the EXIT CODE section.) This option is normally used by the system's boot scripts.

-P

Show progress.

-r backup-number

mkfs.ocfs2 makes up to 6 backup copies of the superblock at offsets 1G, 4G, 16G, 64G, 256G and 1T depending on the size of the volume. Use this option to specify the backup, 1 thru 6, to use to recover the superblock.

-t

Show I/O statistics. If this option is specified twice, it shows the statistics on a pass by pass basis.

-y

Give the 'yes' answer to all questions that fsck will ask. This will repair all faults that fsck.ocfs2 finds but will not give the operator a chance to intervene if fsck.ocfs2 decides that it wants to drastically repair the file system.

-v

This option causes fsck.ocfs2 to produce a very large amount of debugging output.

-V

Print version information and exit.

## EXIT CODE
The exit code returned by fsck.ocfs2 is the sum of the following conditions:

0 - No errors

1 - File system errors corrected

2 - File system errors corrected, system should

be rebooted

4 - File system errors left uncorrected

8 - Operational error

16 - Usage or syntax error

32 - fsck.ocfs2 canceled by user request

128 - Shared library error

## SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2.checks(8) mkfs.ocfs2(8) mount.ocfs2(8) mounted.ocfs2(8) o2cluster(8) o2image(8) o2info(1) tunefs.ocfs2(8)

## AUTHORS
Oracle Corporation. This man page entry derives some text, especially the exit code summary, from e2fsck(8) by Theodore Y. Ts'o <tytso@mit.edu>.

## COPYRIGHT
Copyright © 2004, 2012 Oracle. All rights reserved.

branch: sisyphus


title: fsck.ocfs2.checks(8)

summary: Consistency checks that

text:
# fsck.ocfs2.checks(8)

## NAME
fsck.ocfs2.checks - Consistency checks that fsck.ocfs2(8) performs and its means for fixing inconsistencies.

## DESCRIPTION
fsck.ocfs2(8) is used to check an OCFS2 file system. It performs many consistency checks and will offer to fix faults that it finds. This man page lists the problems it may find and describes their fixes. The problems are indexed by the error number that fsck.ocfs2(8) emits when it describes the problem and asks if it should be fixed.

The prompts are constructed such that answering 'no' results in no changes to the file system. This may result in errors later on that stop fsck.ocfs2(8) from proceeding.

## CHECKS

### EB_BLKNO
Extent blocks contain a record of the disk block where they are located. An extent block was found at a block that didn't match its recorded location.

Answering yes will update the data structure in the extent block to reflect its real location on disk.

### EB_GEN
Extent blocks are created with a generation number to match the generation number of the volume at the time of creation. An extent block was found which contains a generation number that doesn't match.

Answering yes implies that the generation number is correct and that the extent block is from a previous file system. The extent block will be ignored and the file that contains it will lose the data it referenced.

### EB_GEN_FIX
Extent blocks are created with a generation number to match the generation number of the volume at the time of creation. An extent block was found which contains a generation number that doesn't match.

Answering yes implies that the generation number in the extent block is incorrect and that the extent block is valid. The generation number in the block is updated to match the generation number in the volume.

### EXTENT_MARKED_UNWRITTEN
An extent record has the UNWRITTEN flag set, but the filesystem feature set does not include unwritten extents.

Answering yes clears the UNWRITTEN flag. This is safe to do; as the feature is disabled anyway.

### EXTENT_MARKED_REFCOUNTED
An extent record has the REFCOUNTED flag set, but neither the filesystem nor the file has the REFCOUNTED flag set.

Answering yes clears the REFCOUNTED flag.

### EXTENT_BLKNO_UNALIGNED
The block that marks the start of an extent should always fall on the start of a cluster. An extent was found that starts part-way into a cluster.

Answering yes moves the start of the extent back to the start of the addressed cluster. This may add data to the middle of the file that contains this extent.

### EXTENT_CLUSTERS_OVERRUN
An extent was found which claims to contain clusters which are beyond the end of the volume.

Answering yes clamps the extent to the end of the volume. This may result in a reduced file size for the file that contains the extent, but it couldn't have addressed those final clusters anyway. One can imagine this problem arising if there are problems shrinking a volume.

### EXTENT_EB_INVALID
Deep extent trees are built by forming a tree out of extent blocks. An extent tree references an invalid extent block.

Answering yes stops the tree from referencing the invalid extent block. This may truncate data from the file which contains the tree.

### EXTENT_LIST_DEPTH
Extent lists contain a record of their depth in the tree. An extent list was found whose recorded depth doesn't match the position they have in the tree.

Answering yes updates the depth field in the list to match the tree on disk.

### EXTENT_LIST_COUNT
The number of entries in an extent list is bounded by either the size of the inode or the size of the block which contains it. An extent list was found which claims to have more entries than would fit in its container.

Answering yes updates the count field in the extent list to match the container. Answering no to this question may stop further fixes from being done because the count value can not be trusted.

### EXTENT_LIST_FREE
The number of free entries in an extent list must be less than the total number of entries in the list. A list was found which claims to have more free entries than possible entries.

Answering yes sets the number of free entries in the list equal to the total possible entries.

### EXTENT_BLKNO_RANGE
An extent record was found which references a block which can not be referenced by an extent. The referenced block is either very early in the volume, and thus reserved, or beyond the end of the volume.

Answering yes removes this extent record from the tree. This may remove data from the file which owns the tree but any such data was inaccessible.

### CHAIN_CPG
The bitmap inode indicates a different clusters per group than the group descriptor. This value is typically static and only modified by tunefs during volume resize and that too only on volumes having only one cluster group.

Answering yes updates the clusters per group on the bitmap inode to the corresponding value in the group descriptor.

### SUPERBLOCK_CLUSTERS
The super block indicates a different total clusters value than the global bitmap. This is only possible due to a failed volume resize operation.

Answering yes updates the total clusters in the super block to the value specified in the global bitmap.

### FIXED_CHAIN_CLUSTERS
The global bitmap inode was repaired, resulting in a change to the total cluster count of the filesystem.

Answering yes updates the total clusters in the super block to the value specified in the global bitmap.

### GROUP_UNEXPECTED_DESC
The group descriptors that make up the global bitmap chain allocator reside at predictable locations on disk. A group descriptor was found in the global bitmap allocator which isn't at one of these locations and so shouldn't be in the allocator.

Answering yes removes this descriptor from the global bitmap allocator.

### GROUP_EXPECTED_DESC
The group descriptors that make up the global bitmap chain allocator reside at predictable locations on disk. A group descriptor at one of these locations was not linked into the global bitmap allocator.

Answering yes will relink this group into the allocator.

### GROUP_GEN
A group descriptor was found with a generation number that doesn't match the generation number of the volume.

Answering yes sets the group descriptor's generation equal to the generation number in the volume.

### GROUP_PARENT
Group descriptors contain a pointer to the allocator inode which contains the chain they belong to. A group descriptor was found in an allocator inode that doesn't match the descriptor's parent pointer.

Answering yes updates the group descriptor's parent pointer to match the inode it resides in.

### GROUP_DUPLICATE
Group descriptors contain a pointer to the allocator inode which contains the chain they belong to. A group descriptor was found in two allocator inodes so it may be duplicated.

Answering yes removes the group descriptor from current allocator inode.

### GROUP_BLKNO
Group descriptors have a field which records their block location on disk. A group descriptor was found at a given location but is recorded as being located somewhere else.

Answering yes updates the group descriptor's recorded location to match where it actually is found on disk.

### GROUP_CHAIN
Group descriptors are found in a number of different singly-linked chains in an allocator inode. A group descriptor records the chain number that it is linked in. A group descriptor was found whose chain field doesn't match the chain it was found in.

Answering yes sets the group descriptor's chain field to match the chain it is found in.

### GROUP_FREE_BITS
A group descriptor records the number of bits in its bitmap that are free. A group descriptor was found which claims to have more free bits than are valid in its bitmap.

Answering yes decreases the number of recorded free bits so that it equals the total number of bits in the group descriptor's bitmap.

### GROUP_CHAIN_LOOP
A chain may loop if the next field of the group descriptor points to one of the previous group descriptors in the chain. This causes the ocfs2 code, both user space and kernel module to loop forever.

Answering yes breaks the loop at an optimum location so that all the existing group descriptors are in the chain. However, it cannot re-connect stray group descriptors and must rely on the rest of the fsck code to fix it.

### CHAIN_COUNT
The chain list embedded in an inode is limited by the block size and the number of bytes consumed by the rest of the inode. A chain list header was found which claimed that there are more entries in the list then could fit in the inode.

Answering yes resets the header's cl_count member to the maximum size allowed by the block size after accounting for the space consumed by the inode.

### CHAIN_NEXT_FREE
This is identical to CHAIN_COUNT except that it is testing and fixing the pointer to the next free list entry recorded in the cl_next_free_rec member instead of the total number of entries.

### CHAIN_EMPTY
Chain entries need to be packed such that there are no chains without descriptors found before the chain that is marked as free by the chain header. A chain without descriptors was found found before that chain that was marked free.

Answering yes will remove the unused chain and shift the remaining chains forward in the list.

### CHAIN_I_CLUSTERS
Chain allocator inodes have an i_clusters value that represents the number of clusters used by the allocator. An inode was found whose i_clusters value doesn't match the number of clusters its chains cover.

Answering yes updates i_clusters in the inode to reflect what was actually found by walking the chain.

### CHAIN_I_SIZE
Chain allocator inodes multiply the number of bytes per cluster by the their i_clusters value and store it in i_size. An inode was found which didn't have the correct value in its i_size.

Answering yes updates i_size to be the product of i_clusters and the cluster size. Nothing else uses this value, and previous versions of tools didn't calculate it properly, so don't be too worried if this error appears.

### CHAIN_GROUP_BITS
The inode that contains an embedded chain list has fields which record the total number of bits covered by the chain as well as the amount free. These fields didn't match what was found in the chain.

Answering yes updates the fields in the inode to reflect what was actually found by walking the chain.

### CHAIN_HEAD_LINK_RANGE
The header that starts a chain tried to reference a group descriptor at a block number that couldn't be valid.

Answering yes will clear the reference to this invalid block and truncate the chain that it started.

### CHAIN_LINK_GEN
A reference was made to a group descriptor whose generation number doesn't match the generation of the volume.

Answering yes to this question implies that the group descriptor is invalid and the chain is truncated at the point that it referred to this invalid group descriptor. Answering no to this question considers the group descriptor as valid and its generation may be fixed.

### CHAIN_LINK_MAGIC
Chains are built by chain headers and group descriptors which are linked together by block references. A reference was made to a group descriptor at a given block but a valid group descriptor signature wasn't found at that block.

Answering yes clears the reference to this invalid block and truncates the chain at the point of the reference.

### CHAIN_LINK_RANGE
Chains are built by chain headers and group descriptors which are linked together by block references. A reference a block was found which can't possibly be valid because it was either too small or extended beyond the volume.

Answering yes truncates the chain in question by zeroing the invalid block reference. This shortens the chain in question and could result in more fixes later if the part of the chain that couldn't be referenced was valid at some point.

### CHAIN_BITS
A chain's header contains members which record the total number of bits in the chain as well as the number of bits that are free. After walking through a chain it was found that the number of bits recorded in its header don't match what was found by totalling up the group descriptors.

Answering yes updates the c_total and c_free members of the header to reflect what was found in the group descriptors in the chain.

### DISCONTIG_BG_DEPTH
A discontiguous block group has an extent list which records all the clusters allocated to it. Discontiguous block groups only support extent lists with a tree depth of 0. A block group claims to have a tree depth greater than 0.

Answering yes will set the tree depth of the extent list to 0.

### DISCONTIG_BG_COUNT
A discontiguous block group has an extent list which records all the clusters allocated to it. A block group claims to have more records than can actually fit.

Answering yes will set the record count to the maximum possible.

### DISCONTIG_BG_REC_RANGE
Block groups set aside clusters to be used for metadata. A discontiguous block group claims to contain clusters beyond the end of the volume.

Answering yes will remove the block group.

### DISCONTIG_BG_CORRUPT_LEAVES
A discontiguous block group has an extent list which records all the clusters allocated to it. A group has more than one extent claiming to have an impossible number of clusters.

Answering yes will remove the block group.

### DISCONTIG_BG_CLUSTERS
Extent records in a discontiguous block group were found having more clusters allocated then a block group can have.

Answering yes will remove the block group.

### DISCONTIG_BG_LESS_CLUSTERS
Extent records in a discontiguous block group were found having less clusters allocated then a block group can have.

Answering yes will remove the block group.

### DISCONTIG_BG_NEXT_FREE_REC
A discontiguous block group has an extent list which records all the clusters allocated to it. A group was found with fewer filled in extents than it claims to have. The filled in extents describe a complete and correct group.

Answering yes will set the used extent count to the number of filled extents.

### DISCONTIG_BG_LIST_CORRUPT
A discontiguous block group has an extent list which records all the clusters allocated to it. The group claims to have more extents than is possible, and the existing extents contain errors.

Answering yes will remove the block group.

### DISCONTIG_BG_REC_CORRUPT
A discontiguous block group has a extent list which records all the clusters allocated to it. A group was found with one extent claiming too many clusters but the sum of the remaining extents are equal to the total clusters a group must have.

Answering yes will remove the block group.

### DISCONTIG_BG_LEAF_CLUSTERS
A discontiguous block group has a extent list which records all the clusters allocated to it. A group was found with one extent claiming too many clusters, but the remaining extents are correct.

Answering yes will set the number of the clusters on the broken extent to the difference between the total clusters a group must have and the sum of the remaining extents.

### INODE_ALLOC_REPAIR
The inode allocator did not accurately reflect the set of inodes that are free and in use in the volume.

Answering yes will update the inode allocator bitmaps. Each bit that doesn't match the state of its inode will be inverted.

### INODE_SUBALLOC
Each inode records the node whose allocator is responsible for the inode. An inode was found in a given node's allocator but the inode itself claimed to belong to a different node.

Answering yes will correct the inode to point to the node's allocator that it belongs to.

### LALLOC_SIZE
Each node has a local allocator contained in a block that is used to allocate clusters in batches. A node's local allocator claims to reflect more bytes than are possible for the volume's block size.

Answering yes decreases the local allocator's size to reflect the volume's block size.

### LALLOC_NZ_USED
A given node's local allocator isn't in use but it claims to have bits in use in its bitmap.

Answering yes zeros this used field.

### LALLOC_NZ_BM
A given node's local allocator isn't in use but it has a field which records the bitmap as starting at a non-zero cluster offset.

Answering yes zeros the bm_off field.

### LALLOC_BM_OVERRUN
Each local allocator contains a reference to the first cluster that its bitmap addresses. A given local allocator was found which references a starting cluster that is beyond the end of the volume.

Answering yes resets the given local allocator. No allocated data will be lost.

### LALLOC_BM_SIZE
The given local allocator claims to cover more bits than are possible for the size in bytes of its bitmap.

Answering yes decreases the number of bits the allocator covers to reflect the size in bytes of the bitmap and resets the allocator. No allocated data will be lost.

### LALLOC_BM_STRADDLE
The given local allocator claims to cover a region of clusters which extents beyond the end of the volume.

Answering yes resets the given local allocator. No allocated data will be lost.

### LALLOC_USED_OVERRUN
The given local allocator claims to have more bits in use than it has total bits in its bitmap.

Answering yes decreases the number of bits used so that it equals the total number of available bits.

### LALLOC_CLEAR
A local allocator inode was found to have problems. This gives the operator a chance to just reset the local allocator inode.

Answering yes clears the local allocator. No information is lost but the global bitmap allocator may need to be updated to reflect clusters that were reserved for the local allocator but were free.

### DEALLOC_COUNT
The given truncate log inode contains a count that is greater than the value that is possible given the size of the inode.

Answering yes resets the count value to the possible maximum.

### DEALLOC_USED
The given truncate log inode claims to have more records in use than it is possible to store in the inode.

Answering yes resets the record of the number used to the maximum value possible.

### TRUNCATE_REC_START_RANGE
A truncate record was found which claims to start at a cluster that is beyond the number of clusters in the volume.

Answering yes will clear the truncate record. This may result in previously freed space being marked as allocated. This will be fixed up later as the allocator is updated to match what is used by the file system.

### TRUNCATE_REC_WRAP
Clusters are recorded as 32bit values. A truncate record was found which claims to have enough clusters to cause this value to wrap. This could never be the case and is a sure sign of corruption.

Answering yes will clear the truncate record. This may result in previously freed space being marked as allocated. This will be fixed up later as the allocator is updated to match what is used by the file system.

### TRUNCATE_REC_RANGE
A truncate record was found which claims to reference a region of clusters which partially extends beyond the number of clusters in the volume.

Answering yes will clear the truncate record. This may result in previously freed space being marked as allocated. This will be fixed up later as the allocator is updated to match what is used by the file system.

### INODE_GEN
Inodes are created with a generation number to match the generation number of the volume at the time of creation. An Inode was found which contains a generation number that doesn't match.

Answering yes implies that the generation number is correct and that the inode is from a previous file system. The inode will be recorded as free.

### INODE_GEN_FIX
Inodes are created with a generation number to match the generation number of the volume at the time of creation. An inode was found which contains a generation number that doesn't match.

Answering yes implies that the generation number in the inode is incorrect and that the inode is valid. The generation number in the inode is updated to match the generation number in the volume.

### INODE_BLKNO
Inodes contain a field that must match the block that they reside in. An inode was found at a block that doesn't match the field in the inode.

Answering yes updates the field to match the inode's position on disk.

### ROOT_NOTDIR
The super block contains a reference to the inode that contains the root directory. This block was found to contain an inode that isn't a directory.

Answering yes clears this inode. The operator will be asked to recreate the root directory at a point in the near future.

### INODE_NZ_DTIME
Inodes contain a field describing the time at which they were deleted. This can not be set for an inode that is still in use. An inode was found which is in use but which contains a non-zero dtime.

Answering yes implies that the inode is still valid and resets its dtime to zero.

### LINK_FAST_DATA
The target name for a symbolic link is stored either as file contents for that inode or in the inode structure itself on disk. Only small destination names are stored in the inode structure. The i_blocks field of the inode indicates that the name is stored in the inode when it is zero. An inode was found that has both i_blocks set to zero and file contents.

Answering yes clears the inode and so deletes the link.

### LINK_NULLTERM
The targets of links on disk must be null terminated. A link was found whose target wasn't null terminated.

Answering yes clears the inode and so deletes the link.

### LINK_SIZE
The size of a link on disk must match the length of its target string. A link was found whose size does not.

Answering yes updates the link's size to reflect the length of its target string.

### LINK_BLOCKS
Links can not be sparse. There must be exactly as many blocks allocated as are needed to cover its size. A link was found which doesn't have enough blocks allocated to cover its size.

Answering yes clears the link's inode thus deleting the link.

### DIR_ZERO
Directories must at least contain a block that has the "." and ".." entries. A directory was found which doesn't contain any blocks.

Answering yes to this question clears the directory's inode thus deleting the directory.

### INODE_SIZE
Certain inodes record the size of the data they reference in an i_size field. This can be the number of bytes in a file, directory, or symlink target which are stored in data mapped by extents of clusters. This error occurs when the extent lists are walked and the amount of data found does not match what is stored in i_size.

Answering yes to this question updates the inode's i_size to match the amount of data referenced by the extent lists. It is vitally important that i_size matches the extent lists and so answering yes is strongly encouraged.

### INODE_SPARSE_SIZE
Certain inodes record the size of the data they reference in an i_size field. This can be the number of bytes in a file, directory, or symlink target which are stored in data mapped by extents of clusters. This error occurs when a sparse inode was found that had data allocated past its i_size.

Answering yes to this question will update the inode's i_size to cover all of its allocated storage. It is vitally important that i_size matches the extent lists and so answering yes is strongly encouraged.

### INODE_INLINE_SIZE
Inodes can only fit a certain amount of inline data. This inode has its data inline but claims an i_size larger than will actually fit.

Answering yes to this question updates the inode's i_size to the maximum available inline space.

### INODE_CLUSTERS
Inodes contain a record of how many clusters are allocated to them. An inode was found whose recorded number of clusters doesn't match the number of blocks that were found associated with the inode.

Answering yes resets the inode's number of clusters to reflect the number of blocks that were associated with the file.

### INODE_SPARSE_CLUSTERS
Inodes contain a record of how many clusters are allocated to them. An sparse inode was found whose recorded number of clusters doesn't match the number of blocks that were found associated with the inode.

Answering yes resets the inode's number of clusters to reflect the number of blocks that were associated with the file.

### INODE_INLINE_CLUSTERS
Inlined inode should not have allocated clusters. An inode who has inline data flag set was found with clusters allocated.

Answering yes resets the inode's number of clusters to zero.

### LALLOC_REPAIR
An active local allocator did not accurately reflect the set of clusters that are free and in use in its region.

Answering yes will update the local allocator bitmap. Each bit that doesn't match the use of its cluster will be inverted.

### LALLOC_USED
A local allocator records the number of bits that are used in its bitmap. An allocator was found whose used value doesn't reflect the number of bits that are set in its bitmap.

Answering yes sets the used value to match the number of bits set in the allocator's bitmap.

### CLUSTER_ALLOC_BIT
A specific cluster's use didn't match the setting of its bit in the cluster allocator.

Answering yes will invert the bit in the allocator to match the use of the cluster -- either allocated and in use or free.

### REFCOUNT_FLAG_INVALID
Refcount file can only exist in a volume with refcount supported, Fsck has found that a file in a non-refcount volume has refcount flag set.

Answering yes remove this flag from the file.

### REFCOUNT_LOC_INVALID
Refcount loc can only be valid if the file has refcount flag set. Fsck has found that a file has refcount loc while it doesn't have refcount flag set.

Answering yes reset refcount loc to zero for the file.

### RB_BLKNO
refcount blocks contain a record of the disk block where they are located. An refcount block was found at a block that didn't match its recorded location.

Answering yes will update the data structure in the refcount block to reflect its real location on disk.

### RB_GEN
Refcount blocks are created with a generation number to match the generation number of the volume at the time of creation. An refcount block was found which contains a generation number that doesn't match.

Answering yes implies that the generation number is correct and that the refcount block is from a previous file system. The refcount block will be removed and the file that uses it will lose the refcounted information, but it may be regenerated later.

### RB_GEN_FIX
Refcount blocks are created with a generation number to match the generation number of the volume at the time of creation. An refcount block was found which contains a generation number that doesn't match.

Answering yes implies that the generation number in the refcount block is incorrect and that the refcount block is valid. The generation number in the block is updated to match the generation number in the volume.

### RB_PARENT
refcount blocks contain a record of the parent this disk block belongs to. An refcount block was found storing a wrong parent location.

Answering yes will update the data structure in the refcount block to reflect its parent's real location on disk.

### REFCOUNT_LIST_COUNT
The number of entries in a refcount list is bounded by the size of the block which contains it. An refcount list was found which claims to have more entries than would fit in its container.

Answering yes updates the count field in the refcount list to match the container. Answering no to this question may stop further fixes from being done because the count value can not be trusted.

### REFCOUNT_LIST_USED
The number of free entries in a refcount list must be less than the total number of entries in the list. A list was found which claims to have more free entries than possible entries.

Answering yes sets the number of free entries in the list equal to the total possible entries.

### REFCOUNT_CLUSTER_RANGE
A refcount record was found which references a cluster which can not be referenced by a refcount. The referenced cluster is either very early in the volume, and thus reserved, or beyond the end of the volume.

Answering yes removes this refcount record from the tree.

### REFCOUNT_CLUSTER_COLLISION
A refcount record was found which references a cluster which has a collision with the previous valid refcount record.

Answering yes removes this refcount record from the tree.

### REFCOUNT_LIST_EMPTY
A refcount list was found which has no refcount record in it. It is normally caused by a corrupted refcount record.

Answering yes removes this refcount block from the tree. It will be re-generated in refcounted extent records handler if all the other information is sane.

### REFCOUNT_BLOCK_INVALID
Refcount block stores the refcount record for physical clusters of a file. It is found referring an invalid refcount block.

Answering yes remove this refcount block.

### REFCOUNT_CLUSTERS
Refcount tree contains a record of how many clusters are allocated to them. A tree was found whose recorded number of clusters doesn't match the number of blocks that were found associated with it.

Answering yes resets the number of clusters to reflect the real number of clusters that were associated with the tree.

### REFCOUNT_ROOT_BLOCK_INVALID
Root refcount block is the root of the refcount record for a file. It is found referring an invalid refcount block.

Answering yes remove this refcount block and clear refcount flag from this file.

### REFCOUNT_REC_REDUNDANT
Refcount record is used to store the refcount for physical clusters. Some refcount record is found to have no physical clusters corresponding to it.

Answering yes remove the refcount record.

### REFCOUNT_COUNT_INVALID
Refcount record is used to store the refcount for physical clusters. A record record is found whichs claims the wrong refcount for some physical clusters.

Answering yes update the corresponding refcount record.

### REFCOUNT_COUNT
Refcount tree contains a record of how many files referring to this tree. A tree was found whose recorded number of files doesn't match the real files referring to the tree.

Answering yes resets the number of files to reflect the real number of files that were associated with the tree.

### DUP_CLUSTERS_SYSFILE_CLONE
A system file inode claims clusters that are also claimed by another inode. ocfs2 does not allow this. System files may be cloned but may not be deleted. Allocation system files may not be cloned or deleted.

Answering yes will copy the data of this inode to newly allocated extents. This will break the claim on the overcommitted clusters.

### DUP_CLUSTERS_CLONE
An inode claims clusters that are also claimed by another inode. ocfs2 does not allow this.

Answering yes will copy the data of this inode to newly allocated extents. This will break the claim on the overcommitted clusters.

### DUP_CLUSTERS_DELETE
An inode claims clusters that are also claimed by another inode. ocfs2 does not allow this.

Answering yes will remove this inode, thus breaking its claim on the overcommitted clusters.

### DUP_CLUSTERS_ADD_REFCOUNT
An inode claims clusters that are also claimed by another inode. ocfs2 does not allow this.

Answering yes will try to add a refcount record for all these inodes, so that they will share the cluster.

### DIRENT_DOTTY_DUP
There can be only one instance of both the "." and ".." entries in a directory. A directory entry was found which duplicated one of these entries.

Answering yes will remove the duplicate directory entry.

### DIRENT_NOT_DOTTY
The first and second directory entries in a directory must be "." and ".." respectively. One of these directory entries was found to not match these rules.

Answering yes will force the directory entry to be either "." or "..". This might consume otherwise valid entries and cause some files to appear in lost+found.

### DIRENT_DOT_INODE
The inode field of the "." directory entry must refer to the directory inode that contains the given directory block. A "." entry was found which doesn't do so.

Answering yes sets the directory entry's inode reference to the parent directory that contains the entry.

### DIRENT_DOT_EXCESS
A "." directory entry was found whose lengths exceeds the amount required for the single dot in the name.

Answering yes creates another empty directory entry in this excess space.

### DIRENT_ZERO
A directory entry was found with a zero length name.

Answering yes clears the directory entry so its space can be reused.

### DIRENT_NAME_CHARS
Directory entries can not contain either the NULL character (ASCII 0) or the forward slash (ASCII 47). A directory entry was found which contains either.

Answering yes will change each instance of these forbidden characters into a period (ASCII 46).

### DIRENT_INODE_RANGE
Each directory entry contains a inode field which the entry's name corresponds to. An entry was found which referenced an inode number that is invalid for the current volume.

Answering yes clears this entry so its space can be reused. If the entry once corresponded to a real inode and was corrupted this inode may appear in lost+found.

### DIRENT_INODE_FREE
Each directory entry contains a inode field which the entry's name corresponds to. An entry was found which referenced an inode number that isn't in use.

Answering yes clears this directory entry.

### DIRENT_TYPE
Each directory entry contains a field which describes the type of file that the entry refers to. An entry was found whose type doesn't match the inode it is referring to.

Answering yes resets the entry's type to match the target inode.

### DIR_PARENT_DUP
Each directory can only be pointed to by one directory entry in a parent directory. A directory entry was found which was the second entry to point to a given directory inode.

Answering yes clears this entry which was the second to refer to a given directory. This reflects the policy that hard links to directories are not allowed.

### DIRENT_DUPLICATE
File names within a directory must be unique. A file name occurred in more than one directory entry in a given directory.

Answering yes renames the duplicate entry to a name that doesn't collide with recent entries and is unlikely to collide with future entries in the directory.

### DIRENT_LENGTH
There are very few directory entry lengths that are valid. The lengths must be greater than the minimum required to record a single character directory, be rounded to 12 bytes, be within the amount of space remaining in a directory block, and be properly rounded for the size of the name of the directory entry. An entry was found which didn't meet these criteria.

Answering yes will try to repair the directory entry. This runs a very good chance of invalidating all the entries in the directory block. Orphaned inodes may appear in lost+found.

### DIR_TRAILER_INODE
A directory block trailer is a fake directory entry at the end of the block. The trailer has compatibility fields for when it is viewed as a directory entry. The inode field must be zero.

Answering yes will set the inode field to zero.

### DIR_TRAILER_NAME_LEN
A directory block trailer is a fake directory entry at the end of the block. The trailer has compatibility fields for when it is viewed as a directory entry. The name length field must be zero.

Answering yes will set the name length field to zero.

### DIR_TRAILER_REC_LEN
A directory block trailer is a fake directory entry at the end of the block. The trailer has compatibility fields for when it is viewed as a directory entry. The record length field must be equal to the size of the trailer.

Answering yes will set the record length field to the size of the trailer.

### DIR_TRAILER_BLKNO
A directory block trailer is a fake directory entry at the end of the block. The self-referential block number is incorrect.

Answering yes will set the block number to the correct block on disk.

### DIR_TRAILER_PARENT_INODE
A directory block trailer is a fake directory entry at the end of the block. It has a pointer to the directory inode it belongs to. This pointer is incorrect.

Answering yes will set the parent inode pointer to the inode referencing this directory block.

### ROOT_DIR_MISSING
The super block contains a reference to the inode that serves as the root directory. This reference points to an inode that isn't in use.

Answering yes will create a new inode and update the super block to refer to this inode as the root directory.

### LOSTFOUND_MISSING
The super block contains a reference to the inode that serves as the lost+found directory. This reference points to an inode that isn't in use.

Answering yes will create a new lost+found directory in the root directory.

### DIR_NOT_CONNECTED
Every directory in the file system should be reachable by a directory entry in its parent directory. This is verified by walking every directory in the system. A directory inode was found during this walk which doesn't have a parent directory entry.

Answering yes moves this directory entry into the lost+found directory and gives it a name based on its inode number.

### DIR_DOTDOT
A directory inode's ".." directory entry must refer to the parent directory. A directory was found whose ".." doesn't refer to its parent.

Answering yes will read the directory block for the given directory and update its ".." entry to reflect its parent.

### INODE_NOT_CONNECTED
Most all inodes in the system should be referenced by a directory entry. An inode was found which isn't referred to by any directory entry.

Answering yes moves this inode into the lost+found directory and gives it a name based on its inode number.

### INODE_COUNT
Each inode records the number of directory entries that refer to it. An inode was found whose recorded count doesn't match the number of entries that refer to it.

Answering yes sets the inode's count to match the number of referring directory entries.

### INODE_ORPHANED
While files are being deleted they are placed in an internal directory. If the machine crashes while this is taking place the files will be left in this directory. Fsck has found an inode in this directory and would like to finish the job of truncating and removing it.

Answering yes removes the file data associated with the inode and frees the inode.

### RECOVER_BACKUP_SUPERBLOCK
When fsck.ocfs2 successfully uses the specified backup superblock, it provides the user with this option to overwrite the existing superblock with that backup.

Answering yes will refresh the superblock from the backup. Answering no will only disable the copying of the backup superblock and will not effect the remaining fsck.ocfs2 processing.

### ORPHAN_DIR_MISSING
While files are being deleted they are placed in an internal directory, named orphan directory. If an orphan directory does not exist, an OCFS2 volume cannot be mounted successfully. Fsck has found the orphan directory is missing and would like to create it for future use.

Answering yes creates the orphan directory in the system directory.

### JOURNAL_FILE_INVALID
OCFS2 uses JDB for journalling and some journal files exist in the system directory. Fsck has found some journal files that are invalid.

Answering yes to this question will regenerate the invalid journal files.

### JOURNAL_UNKNOWN_FEATURE
Fsck has found some journal files with unknown features. Other journals on the filesystem have only known features, so this is likely a corruption. If you think your filesystem may be newer than this version of fsck.ocfs2, say N here and grab the latest version of fsck.ocfs2.

Answering yes resets the journal features to match other journals.

### JOURNAL_MISSING_FEATURE
Fsck has found some journal files have features that are not set on all journal files. All journals on filesystem should have the same set of features.

Answering yes will set all journals to the union of set features.

### JOURNAL_TOO_SMALL
Fsck has found some journal files are too small.

Answering yes extends these journals.

### RECOVER_CLUSTER_INFO
The currently active cluster stack is different than the one the filesystem is configured for. Thus, fsck.ocfs2 cannot determine whether the filesystem is mounted on an another node or not. The recommended solution is to exit and run fsck.ocfs2 on this device from a node that has the appropriate active cluster stack. However, you can proceed with the fsck if you are sure that the volume is not in use on any node.

Answering yes reconfigures the filesystem to use the current cluster stack. DANGER: YOU MUST BE ABSOLUTELY SURE THAT NO OTHER NODE IS USING THIS FILESYSTEM BEFORE CONTINUING. OTHERWISE, YOU CAN CORRUPT THE FILESYSTEM AND LOSE DATA.

### INLINE_DATA_FLAG_INVALID
Inline file can only exist in a volume with inline supported, Fsck has found that a file in a non-inline volume has inline flag set.

Answering yes remove this flag from the file.

### INLINE_DATA_COUNT_INVALID
For an inline file, there is a limit for id2.id_data.id_count. Fsck has found that this value isn't right.

Answering yes change this value to the right number.

### XATTR_BLOCK_INVALID
Extended attributes are stored off an extended attribute block referenced by the inode. This inode references an invalid extended attribute block.

Answering yes will remove this block.

### XATTR_COUNT_INVALID
The count of extended attributes in an inode, block, or bucket does not match the number of entries found by fsck.

Answering yes will change this to the correct count.

### XATTR_ENTRY_INVALID
An extended attribute entry points to already used space.

Answering yes will remove this entry.

### XATTR_NAME_OFFSET_INVALID
The name_offset field of an extended attribute entry is not correct. Without a correct name_offset field, the entry cannot be used.

Answering yes will remove this entry.

### XATTR_VALUE_INVALID
The value region of an extended attribute points to already used space.

Answering yes will remove this entry.

### XATTR_LOCATION_INVALID
The xe_local field and xe_value_size field of an extended attribute entry does not match. So the entry cannot be used.

Answering yes will remove this entry.

### XATTR_HASH_INVALID
Extended attributes use a hash of their name for lookup purposes. The name_hash of this extended attribute entry is not correct.

Answering yes will change this to the correct hash.

### XATTR_FREE_START_INVALID
Extended attributes use free_start to indicate the offset of the free space in inode, block, or bucket. The free_start field of this object is not correct.

Answering yes will change this to the correct offset.

### XATTR_VALUE_LEN_INVALID
Extended attributes use name_value_len to store the total length of all entry's name and value in inode, block or bucket. the name_value_len filed of this object is not correct.

Answering yes will change this to the correct value.

### XATTR_BUCKET_COUNT_INVALID
The count of extended attributes bucket pointed by one extent record does not match the number of buckets found by fsck.

Answering yes will change this to the correct count.

### QMAGIC_INVALID
The magic number in the header of quota file does not match the proper number.

Answering yes will make fsck use values in the quota file header anyway.

### QTREE_BLK_INVALID
Block with references to other blocks with quota data is corrupted.

Answering yes will make fsck use references in the block.

### DQBLK_INVALID
The structure with quota limits was found in a corrupted block.

Answering yes will use the values of limits for the user / group.

### DUP_DQBLK_INVALID
The structure with quota limits was found in a corrupted block and fsck has already found quota limits for this user / group.

Answering yes will use new values of limits for the user / group.

### DUP_DQBLK_VALID
The structure with quota limits was found in a correct block but fsck has already found quota limits for this user / group.

Answering yes will use new values of limits for the user / group.

### IV_DX_TREE
A directory index was found on an inode but that feature is not enabled on the file system.

Answering yes will truncate the invalid index.

### DX_LOOKUP_FAILED
A directory entry is missing an entry in the directory index. The missing index entry will cause lookups on this name to fail.

Answering yes will rebuild the directory index, restoring the missing entry.

### NO_HOLES
A metadata structure encountered a hole where it should not. Examples of such structures are directories, refcount trees, dx_trees etc.

Answering yes will remove the hole by updating the offset to the expected value.

### EXTENT_OVERLAP
The extents of the file overlap, which means there could be two or more possible data for a particular offset for the file.

Answering yes will serialize the extents.

### DX_TREE_CORRUPT
The index tree of the directory is corrupt.

Answering yes will rebuild the directory index, in pass 2.

### DX_TREE_MISSING
The index of this directory is missing.

Answering yes will rebuild the directory index.

### BAD_CRC32
The metadata block has a bad CRC32, which means either the block or the crc32 field is corrupted.

Answering yes will recalculate the CRC32.

## SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2(8) mkfs.ocfs2(8) mount.ocfs2(8) mounted.ocfs2(8) o2cluster(8) o2image(8) o2info(1) tunefs.ocfs2(8)

## AUTHORS
Oracle Corporation.

## COPYRIGHT
Copyright © 2004, 2012 Oracle. All rights reserved.


title: mkfs.ocfs2(8)

summary: Creates an OCFS2 file system.

text:
# mkfs.ocfs2(8)

## NAME
mkfs.ocfs2 - Creates an OCFS2 file system.

## SYNOPSIS
mkfs.ocfs2 [-b block-size] [-C cluster-size] [-L volume-label] [-M mount-type] [-N number-of-nodes] [-J journal-options] [--fs-features=[no]sparse...] [--fs-feature-level=feature-level] [-T filesystem-type] [--cluster-stack=stackname] [--cluster-name=clustername] [--global-heartbeat] [--discard | --nodiscard] [-FqvV] device [blocks-count]

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

## OPTIONS
-b, --block-size block-size

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 -T option). A block size of 512 bytes is never recommended. Choose 1K, 2K or 4K.

-C, --cluster-size cluster-size

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 -T 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.

-F, --force

For existing OCFS2 volumes, mkfs.ocfs2 ensures the volume is not mounted on any node in the cluster before formatting. For that to work, mkfs.ocfs2 expects the cluster service to be online. Specify this option to disable this check.

-J, --journal-options options

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:

size=journal-size

Create a journal of size journal-size. Minimum size is 4M. If omitted, a value is heuristically determined based upon the file system size.

block32

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 OCFS2 volumes since the beginning. The journal is compatible with all versions of OCFS2. Prepending no is equivalent to the block64 journal option.

block64

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 OCFS2. It requires a new-enough filesystem driver that uses the new journalled block device, JBD2. Prepending no is equivalent to the block32 journal option.

-L, --label volume-label

Set the volume label for the file system. This is useful for mounting-by-label. Limit the label to under 64 bytes.

-M, --mount mount-type

Valid types are local and cluster. Local mount allows users to mount the volume without the cluster overhead and works only with OCFS2 bundled with Linux kernels 2.6.20 or later. Defaults to cluster.

-N, --node-slots number-of-node-slots

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 depends on volume size, for volume size < 2G, it's 2, for 2G <= size < 10G, it's 4, for 10G <= size < 1T, it's 8, for other size, it's 16. The number of slots can be later tuned up or down using tunefs.ocfs2.

-T filesystem-type

Specify how the filesystem is going to be used, so that mkfs.ocfs2 can chose optimal filesystem parameters for that use. The supported filesystem types are:

mail

Appropriate for file systems that will host lots of small files.

datafiles

Appropriate for file systems that will host a relatively small number of very large files.

vmstore

Appropriate for file systems that will host Virtual machine images.

--fs-features=[no]sparse...

Turn specific file system features on or off. A comma separated list of feature flags can be provided, and mkfs.ocfs2 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 no to the name. Choices here will override individual features set via the --fs-feature-level option. Refer to the section titled feature compatibility before selecting specific features. The following flags are supported:

backup-super

mkfs.ocfs2, 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.

local

Create the file system as a local mount, so that it can be mounted without a cluster stack.

sparse

Enable support for sparse files. With this, OCFS2 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.

unwritten

Enable unwritten extents support. With this turned on, an application can request that a range of clusters be pre-allocated within a file. OCFS2 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 sparse file support to be turned on.

inline-data

Enable inline-data support. If this feature is turned on, OCFS2 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.

extended-slotmap

The slot-map is a hidden file on an OCFS2 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. If required, this feature is automatically turned on by mkfs.ocfs2.

metaecc

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.

refcount

Enables creation of reference counted trees. With this enabled, the file system allows users to create inode-based snapshots and clones known as reflinks.

xattr

Enable extended attributes support. With this enabled, users can attach name:value pairs to objects within the file system. In OCFS2, the names can be up to 255 bytes in length, terminated by the first NUL byte. While it is not required, printable names (ASCII) are recommended. The values can be up to 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.

usrquota

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.

grpquota

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.

indexed-dirs

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 performance from the indexed tree is faster then from the legacy directory blocks.

discontig-bg

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.

clusterinfo

Enables storing the cluster stack information in the superblock. This feature is needed to support userspace cluster stacks and the global heartbeat mode in the o2cb cluster stack. If needed, this feature is automatically turned on by mkfs.ocfs2.

--fs-feature-level=feature-level

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 --fs-features option. Currently, there are 3 types of feature levels:

max-compat

Chooses fewer features but ensures that the file system can be mounted from older versions of the OCFS2 module.

default

The default feature set tries to strike a balance between providing new features and maintaining compatibility with relatively recent versions of OCFS2. It currently enables sparse, unwritten, inline-data, xattr, indexed-dirs, discontig-bg, refcount, extended-slotmap and clusterinfo.

max-features

Choose the maximum amount of features available. This will typically provide the best performance from OCFS2 at the expense of creating a file system that is only compatible with very recent versions of the OCFS2 kernel module.

--cluster-stack

Specify the cluster stack. This option is normally not required as mkfs.ocfs2 chooses the currently active cluster stack. It is required only if the cluster stack is not online and the user wishes to use a stack other than the default, o2cb. Other supported cluster stacks are pcmk (Pacemaker) and cman (rgmanager). Once set, OCFS2 will only allow mounting the volume if the active cluster stack and cluster name matches the one specified on-disk.

--cluster-name

Specify the name of the cluster. This option is mandatory if the user has specified a cluster-stack. This name is restricted to a max of 16 characters. Additionally, the o2cb cluster stack allows only alpha-numeric characters.

--global-heartbeat

Enable the global heartbeat mode of the o2cb cluster stack. This option is not required if the o2cb cluster stack with global heartbeat is online as mkfs.ocfs2 will detect the active stack. However, if the cluster stack is not up, then this option is required alongwith cluster-stack and cluster-name. For more, refer to o2cb(7).

--discard

Attempt to discard blocks at mkfs time (discarding blocks initially is useful on solid state devices and sparse / thin-provisioned storage). When the device advertises that discard also zeroes data (any subsequent read after the discard and before write returns zero), then mark all not-yet-zeroed blocks as zeroed. This significantly speeds up filesystem initialization. This is set as default.

--nodiscard

Do not attempt to discard blocks at mkfs time.

--no-backup-super

This option is deprecated, please use --fs-features=nobackup-super instead.

-n, --dry-run

Display the heuristically determined values without overwriting the existing file system.

-q, --quiet

Quiet mode.

-U uuid

Specify a custom UUID in the plain (2A4D1C581FAA42A1A41D26EFC90C1315) or traditional (2a4d1c58-1faa-42a1-a41d-26efc90c1315) format. This option in not recommended because the file system uses the UUID to uniquely identify a file system. If more than one file system were to have the same UUID, one is very likely to encounter erratic behavior, if not, outright file system corruption.

-v, --verbose

Verbose mode.

-V, --version

Print version and exit.

blocks-count

Usually mkfs.ocfs2 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 -b) on the device.

## FEATURE COMPATIBILITY
This section lists the file system features that have been added to the OCFS2 file system and the version that it first appeared in. The table below lists the versions of the mainline Linux kernel and ocfs2-tools. 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 feature values.

Feature

Kernel Version

Tools Version

local

Linux 2.6.20

ocfs2-tools 1.2

sparse

Linux 2.6.22

ocfs2-tools 1.4

unwritten

Linux 2.6.23

ocfs2-tools 1.4

inline-data

Linux 2.6.24

ocfs2-tools 1.4

extended-slotmap

Linux 2.6.27

ocfs2-tools 1.6

metaecc

Linux 2.6.29

ocfs2-tools 1.6

grpquota

Linux 2.6.29

ocfs2-tools 1.6

usrquota

Linux 2.6.29

ocfs2-tools 1.6

xattr

Linux 2.6.29

ocfs2-tools 1.6

indexed-dirs

Linux 2.6.30

ocfs2-tools 1.6

refcount

Linux 2.6.32

ocfs2-tools 1.6

discontig-bg

Linux 2.6.35

ocfs2-tools 1.6

clusterinfo

Linux 2.6.37

ocfs2-tools 1.8

Users can query the features enabled in the file system as follows:

```
# tunefs.ocfs2 -Q "Label: %V\nFeatures: %H %O\n" /dev/sdg1
Label: apache_files_10
Features: sparse inline-data unwritten
```

## 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 OCFS2 volume that has features enabled that are not supported by the running file system software, it will fail with an error like:

```
ERROR: couldn't mount because of unsupported optional features (200).
```

By referring to the table below, it becomes apparent that the user attempted to mount a volume with the xattr (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 tunefs.ocfs2.

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:

```
ERROR: couldn't mount RDWR because of unsupported optional features (1).
```

This error indicates that the volume had the unwritten 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 ro mount option, or, disabling that on-disk feature using tunefs.ocfs2.

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

clusterinfo

Incompat

4000

unwritten

RO Compat

1

usrquota

RO Compat

2

grpquota

RO Compat

4

## SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2(8) mount.ocfs2(8) mounted.ocfs2(8) o2cb(7) o2cluster(8) o2image(8) o2info(1) tunefs.ocfs2(8)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2004, 2012 Oracle. All rights reserved.


title: mount.ocfs2(8)

summary: mount an OCFS2 filesystem

text:
# mount.ocfs2(8)

## NAME
mount.ocfs2 - mount an OCFS2 filesystem

## SYNOPSIS
mount.ocfs2 [-vn] [-o options] device dir

## DESCRIPTION
mount.ocfs2 mounts an OCFS2 filesystem at dir. It is usually invoked indirectly by the mount(8) command.

## OPTIONS
_netdev

Indicates that the file system resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system). mount.ocfs2(8) transparently appends this option during mount. However, users mounting the volume via /etc/fstab must explicitly specify this mount option to delay the system from mounting the volume until after the network has been enabled.

noatime

The file system will not update access time.

relatime

The file system will update atime only if the on-disk atime is older than mtime or ctime. This is the default mode.

strictatime,atime_quantum=nrsec

The file system will always perform atime updates, but the minimum update interval is specified by atime_quantum which defaults to 60 secs. Set it to zero to always update atime. These two options need work together.

[no]acl

Enables / disables POSIX ACLs (access control lists) support. It is enabled by default.

[no]user_xattr

Enables / disables extended user attributes. It is enabled by default.

commit=nrsec

Sync all data and metadata every nrsec seconds. The default value is 5 seconds. Zero means default.

data=[ordered|writeback]

Specifies the handling of file data during metadata journalling.

ordered

This is the default mode. Data is flushed to disk before the corresponding meta-data is committed to the journal.

writeback

Data ordering is not preserved - data may be flushed to disk after the corresponding meta-data is committed to the journal. This is rumored to be the higher-throughput option. While it guarantees internal file system integrity, it can allow old data to appear in files after a crash and journal recovery.

errors=[remount-ro|errors=panic|errors=continue]

Specifies the behavior when an on-disk corruption is encountered.

remount-ro

This is the default mode. The file system is remounted read-only.

panic

The system is halted via panic.

continue

Ignore errors. Just log error message, return error code to the calling process and continue.

localflocks

This disables cluster-aware flock(2).

coherency=[full|coherency]

Specifies the extent of coherency for the cached file data across the cluster. This mount option works with Linux kernel 2.6.37 and later.

full

This is the default mode. The file system ensures the cached file data is coherent across the cluster for all IO modes.

buffered

The file system only ensures the cached file data coherency for buffered mode IOs. It does not perform IO serialization for direct IOs. This allows multiple nodes to perform concurrent direct IOs to the same file. This is the recommended mode for volumes hosting database files.

resv_level=level

Specifies the level of allocation reservation for files. The higher the value, the more aggressive it is. Valid values are between 0 (reservation off) to 8 (maximum space for reservation). It defaults to 2. This mount option works with Linux kernel 2.6.35 and later.

dir_resv_level=level

By default, directory reservation scales with file reserveration. Users should rarely need to change this value. If the file allocation reservation is turned off, this option will have no effect. This mount option works with Linux kernel 2.6.35 and later.

inode64

Indicates that the file system can create inodes at any location in the volume, including those which will result in inode numbers greater than 4 billion.

nocluster

This option allows users to mount a clustered volume without configuring the cluster stack. However, you must be aware that you can only mount the file system from one node at the same time, otherwise, the file system may be damaged. Please use it with caution.

[no]intr

Specifies whether a signal can interrupt IOs. It is disabled by default.

ro

Mount the file system read-only.

rw

Mount the file system read-write.

## NOTES
To mount and umount a OCFS2 volume, do:

```
# mount /dev/sda1 /mount/path

 ...
# umount /mount/path
```

Users mounting a clustered volume should be aware of the following:

1. The cluster stack must to be online for a clustered mount to succeed.

2. The clustered mount operation is not instantaneous; it must wait for the node to join the DLM domain.

3. Likewise, clustered umount is also not instantaneous; it involves migrating all mastered lock-resources to the other nodes in the cluster.

If the mount fails, detailed errors can be found via dmesg(8). These might include incorrect cluster configuration (say, a missing node or incorrect IP address) or a firewall interfering with o2cb network traffic. Check the configuration as listed in o2cb(7) or the man page of the active cluster stack.

To auto-mount volumes on startup, the file system tools include an ocfs2 init service. This runs after the o2cb init service has started the cluster. The ocfs2 init service mounts all OCFS2 volumes listed in /etc/fstab.

```
# chkconfig --add o2cb
o2cb 0:off 1:off 2:on 3:on 4:off 5:on 6:off
$ chkconfig --add ocfs2
o2cb 0:off 1:off 2:on 3:on 4:off 5:on 6:off
$ cat /etc/fstab

 ...
/dev/sda1     /u01     ocfs2     _netdev,defaults     0  0

 ...
```

## SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2(8) mkfs.ocfs2(8) mounted.ocfs2(8) o2cb(7) o2cluster(8) o2image(8) o2info(1) tunefs.ocfs2(8)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2004, 2012 Oracle. All rights reserved.


title: mounted.ocfs2(8)

summary: Detects all OCFS2 volumes on a system.

text:
# mounted.ocfs2(8)

## NAME
mounted.ocfs2 - Detects all OCFS2 volumes on a system.

## SYNOPSIS
mounted.ocfs2 [-d] [-f] [device]

## DESCRIPTION
mounted.ocfs2 is used to detect OCFS2 volume(s) on a system. When run without specifying a device, it scans all the partitions listed in /proc/partitions.

## OPTIONS
-d

Lists the OCFS2 volumes along with their labels and uuids. It also lists the cluster stack, cluster name and the cluster flags. The possible cluster stacks are o2cb, pcmk and cman. None indicates a local mount or a non-clustered volume. A G cluster flag indicates global-heartbeat for the o2cb cluster stack.

-f

Lists the OCFS2 volumes along with the list of nodes that have mounted the volume.

## NOTES
As this utility gathers information without taking any cluster locks, the information listed in the full detect mode could be stale. This is only problematic for volumes that were not cleanly umounted by the last node. Such volumes will show up mounted (as per this utility) on one or more nodes but are in fact not mounted on any node. Such volumes are awaiting slot-recovery which is auto-performed on the next mount (or file system check).

## EXAMPLES
To view the list of OCFS2 volumes, do:

```
# mounted.ocfs2 -d
Device     Stack  Cluster     F  UUID                              Label
/dev/sdc1  None                  23878C320CF3478095D1318CB5C99EED  localmount
/dev/sdd1  o2cb   webcluster  G  8AB016CD59FC4327A2CDAB69F08518E3  webvol
/dev/sdg1  o2cb   webcluster  G  77D95EF51C0149D2823674FCC162CF8B  logsvol
/dev/sdh1  o2cb   webcluster  G  BBA1DBD0F73F449384CE75197D9B7098  scratch
/dev/sdk1  o2cb   webcluster  G  DCDA2845177F4D59A0F2DCD8DE507CC3  hb1
```

To view the list of nodes that have potentially (see notes) mounted the OCFS2 volumes, do:

```
# mounted.ocfs2 -f
Device     Stack  Cluster     F  Nodes
/dev/sdc1  None
/dev/sdd1  o2cb   webcluster  G  node1, node3, node10
/dev/sdg1  o2cb   webcluster  G  node1, node3, node10
/dev/sdh1  o2cb   webcluster  G  Not mounted
/dev/sdk1  o2cb   webcluster  G  node1, node3, node10
```

## SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2(8) mkfs.ocfs2(8) mount.ocfs2(8) o2cluster(8) o2image(8) o2info(1) tunefs.ocfs2(8)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2004, 2012 Oracle. All rights reserved.


title: o2cb(8)

text:
# o2cb(8)

## NAME
o2cb - Cluster registration utility for the O2CB cluster stack.

## SYNOPSIS
o2cb [--config-file=path] [-h|--help] [-v|--verbose] [-V|--version] COMMAND [ARGS]

## DESCRIPTION
o2cb(8) is used to add, remove and list the information in the O2CB cluster configuration file. This utility is also used to register and unregister the cluster, as well as start and stop global heartbeat.

The default location of the configuration file, /etc/ocfs2/cluster.conf, can be overridden using the --config-file option.

## OPTIONS
--config-file config-file

Specify a path to the configuration file. If not provided, it will use the default path of /etc/ocfs2/cluster.conf.

-v, --verbose

Verbose mode.

-h, --help

Help.

-V, --version

Show version and exit.

## O2CB COMMANDS
add-cluster cluster-name

Adds a cluster to the configuration file. The O2CB configuration file can hold multiple clusters. However, only one cluster can be active at any time.

remove-cluster cluster-name

Removes a cluster from the configuration file. This command removes all the nodes and heartbeat regions assigned to the cluster.

add-node cluster-name node-name [--ip ip-address] [--port port] [--number node-number]

Adds a node to the cluster in the configuration file. It accepts three optional arguments. If not provided, the ip-address defaults to the one assigned to the node-name, port to 7777, and node-number to the lowest unused node number.

remove-node cluster-name node-name

Removes a node from the cluster in the configuration file.

add-heartbeat cluster-name [uuid|device]

Adds a heartbeat region to the cluster in the configuration file.

remove-heartbeat cluster-name [uuid|device]

Removes a heartbeat region from the cluster in the configuration file.

heartbeat-mode cluster-name [local|global]

Sets the heartbeat mode for the cluster in the configuration file.

list-clusters

Lists all the cluster names in the configuration file.

list-cluster cluster-name --oneline

Lists all the nodes and heartbeat regions associated with the cluster in the configuration file.

list-nodes cluster-name --oneline

Lists all the nodes associated with the cluster in the configuration file.

list-heartbeats cluster-name --oneline

Lists all the heartbeat regions associated with the cluster in the configuration file.

register-cluster cluster-name

Registers the cluster listed in the configuration file with configfs. If called when the cluster is already registered, it will update configfs with the current configuration.

unregister-cluster cluster-name

Unregisters the cluster from configfs.

start-heartbeat cluster-name

Starts global heartbeat on all regions for the cluster as listed in the configuration file. If repeated, it will start heartbeat on new regions and stop on regions since removed. It will silently exit if global heartbeat has not been enabled.

stop-heartbeat cluster-name

Stops global heartbeat on all regions for the cluster. It will silently exit if global heartbeat has not been enabled.

cluster-status [cluster-name]

Shows whether the given cluster is offline or online. If no cluster is provided, it shows the currently active cluster, if any.

## EXAMPLE
To create a cluster, mycluster having two nodes, node1 and node2, do:

```
$ o2cb add-cluster mycluster
$ o2cb add-node mycluster node1 --ip 10.10.10.1
$ o2cb add-node mycluster node2 --ip 10.10.10.2
```

To specify a global heartbeat device, /dev/sda1, do:

```
$ o2cb add-heartbeat mycluster /dev/sda1
```

To enable global heartbeat, do:

```
$ o2cb heartbeat-mode mycluster global
```

## SEE ALSO
o2cb(7) o2cb.sysconfig(5) ocfs2.cluster.conf(5)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2010, 2012 Oracle. All rights reserved.


title: o2cb_ctl(8)

text:
# o2cb_ctl(8)

## NAME
o2cb_ctl - Control program for the O2CB cluster service.

## SYNOPSIS
o2cb_ctl -C -n object -t type [-i] [-a attribute ]

o2cb_ctl -D -n object [-u]

o2cb_ctl -I [-o-z] -l manager> [-n object>] [-t type] [-a attribute]

o2cb_ctl -H [-n object] [-t type>] [-a attribute>]

o2cb_ctl -h

o2cb_ctl -V

## DESCRIPTION
o2cb_ctl is the control program for the O2CB cluster service. Users are not advised to use this program directly but instead use the O2CB init service and/or ocfs2console.

## OPTIONS
-C

Create an object in the OCFS2 Cluster Configuration.

-D

Delete an object from the existing OCFS2 Cluster Configuration.

-I

Print information about the OCFS2 Cluster Configuration.

-H

Change an object or objects in the existing OCFS2 Cluster Configuration.

-h

Displays help and exit.

-V

Print version and exit.

## OTHER OPTIONS
-a <attribute>

With -C, <attribute> is in format "parameter=value", where the parameter is a valid parameter that can be set in the file /etc/ocfs2/cluster.conf. With -I, <attribute> may be "parameter", indicating an attribute to be listed in the output, or it may be "parameter==value", indicating that only objects matching "parameter=value" are to be displayed.

-i

Valid only with -C. When creating something (node or cluster), it will also install it in the live cluster. If the parameter is not specified, then only update the /etc/ocfs2/cluster.conf.

-n object

object is usually the node name or cluster name. In the /etc/ocfs2/cluster.conf file, it would be the value of the name parameter for any of the sections (cluster or node).

-o

Valid only with -I. Using this parameter, if one asks o2cb_ctl to list all nodes, it will output it in a format suitable for shell parsing.

-t type

type can be cluster, node or heartbeat.

-u

Valid only with -D. When deleting something (node or cluster), it will also remove it from the live cluster. If the parameter is not specified, then only update the /etc/ocfs2/cluster.conf.

-z

Valid only with -I. This is the default. If one asks o2cb_ctl to list all nodes, it will give a verbose listing.

## EXAMPLES
Add node5 to an offline cluster:

$ o2cb_ctl -C -n node5 -t node -a number=5

-a ip_address=192.168.0.5 -a ip_port=7777

-a cluster=mycluster

Add node10 to an online cluster:

$ o2cb_ctl -C -i -n node10 -t node -a number=10

-a ip_address=192.168.1.10 -a ip_port=7777

-a cluster=mycluster

Note the -i argument.

Query the IP address of node5:

$ o2cb_ctl -I -n node5 -a ip_address

Change the IP address of node5:

$ o2cb_ctl -H -n node5 -a ip_address=192.168.1.5

## SEE ALSO
mkfs.ocfs2(8) fsck.ocfs2(8) tunefs.ocfs2(8) mounted.ocfs2(8) o2cb(7)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2004, 2010 Oracle. All rights reserved.


title: o2cluster(8)

text:
# o2cluster(8)

## NAME
o2cluster - Change cluster stack stamped on an OCFS2 file system.

## SYNOPSIS
o2cluster [-o|--show-ondisk] [-r|--show-running] [-u|--update[=<clusterstack>]] [-hvVyn] [device]

## DESCRIPTION
o2cluster is used to change the cluster stack stamped on an OCFS2 file system. It also used to list the active cluster stack and the one stamped on-disk. This utility does not expect the cluster to be online. It only updates the file system if it is reasonably assured that it is not in-use on any other node. Clean journals implies the file system is not in-use. This utility aborts if it detects even one dirty journal.

Before using this utility, the user should use other means to ensure that the volume is not in-use, and more importantly, not about to be put in-use. While clean journals implies the file system is not in-use, there is a tiny window after the check and before the update during which another node could mount the file system using the older cluster stack.

If a dirty journal is detected, it implies one of two scenarios. Either the file system is mounted on another node, or, the last node to have it mounted, crashed. There is no way, short of joining the cluster, that the utility can use to differentiate between the two. Considering this utility is targeted to be used in scenarios when the user is looking to change the on-disk cluster stack, it becomes a chicken-and-egg problem.

If one were to run into this scenario, the user should manually re-confirm that the file system is not in-use on another node and then run fsck.ocfs2(8). It will update the on-disk cluster stack to the active cluster stack, and, do a complete file system check.

## SPECIFYING CLUSTER STACK
The cluster stack can be specified in one of two forms. The first as default, denoting the original classic o2cb cluster stack with local heartbeat. The second as a triplet with the stack name, the cluster name and the cluster flags separated by commas. Like o2cb,mycluster,global.

The valid stack names are o2cb, pcmk, and cman.

The cluster name can be up to 16 characters. The o2cb stack further restricts the names to contain only alphanumeric characters.

The valid flags for the o2cb stack are local and global, denoting the two heartbeat modes. The only valid flag for the other stacks is none.

## OPTIONS
-o|--show-ondisk

Shows the cluster stack stamped on-disk.

-r|--show-running

Shows the active cluster stack.

-u|--update[=<clusterstack>]

Updates the on-disk cluster stack with the one provided. If no cluster stack is provided, the utility detects the active cluster stack and stamps it on-disk.

-v, --verbose

Verbose mode.

-V, --version

Show version and exit.

-y, --yes

Always answer Yes in interactive command line.

-n, --no

Always answer No in interactive command line.

## EXAMPLES

```
# o2cluster -r
o2cb,myactivecluster,global
# o2cluster -o /dev/sda1
o2cb,mycluster,global
# o2cluster --update=o2cb,yourcluster,global /dev/sdb1
Changing the clusterstack from o2cb,mycluster,global to o2cb,yourcluster,global. Continue? y
Updated successfully.
```

## SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2(8) fsck.ocfs2.checks(8) mkfs.ocfs2(8) mount.ocfs2(8) mounted.ocfs2(8) o2image(8) o2info(1) tunefs.ocfs2(8)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2011, 2012 Oracle. All rights reserved.


title: o2hbmonitor(8)

text:
# o2hbmonitor(8)

## NAME
o2hbmonitor - Monitors disk heartbeat in the O2CB cluster stack

## SYNOPSIS
o2hbmonitor [-w percent] [-ivV]

## DESCRIPTION
o2hbmonitor is a utility to monitor the disk heartbeat in the o2cb cluster stack. It tracks the time elapsed since the last heartbeat and logs messages once it exceeds the warn threshold.

By default, it runs as a daemon and logs messages to the system logger. It can be started at any time and stopped using kill(1). It does not affect the functioning of the heartbeat thread. It is typically automatically started during cluster online and stopped during cluster offline by the o2cb init script.

This utility expects the debugfs file system to be mounted at /sys/kernel/debug.

## OPTIONS
-w percent

Warn threshold percent. It is the percentage of the idle threshold. It defaults to 50%.

-i

Interactive mode. It works as a daemon by default. This mode is typically only used for debugging.

-v

Verbose mode. It logs messages only to the system logger by default. In this mode it also logs the messages to stdout.

-V

Displays version.

## NOTES
This utility works with Linux kernel 2.6.37 and later.

## SEE ALSO
o2cb(7)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2010, 2012 Oracle. All rights reserved.


title: o2image(8)

text:
# o2image(8)

## NAME
o2image - Copy or restore OCFS2 file system meta-data

## SYNOPSIS
o2image [-r] [-I] device image-file

## DESCRIPTION
o2image copies the OCFS2 file system meta-data from the device to the specified image-file. This image file contains the file system skeleton that includes the inodes, directory names and file names. It does not include any file data.

This image file can be useful to debug certain problems that are not reproducible otherwise. Like on-disk corruptions. It could also be used to analyse the file system layout in an aging file system with an eye towards improving performance.

As the image-file contains a copy of all the meta-data blocks, it can be a large file. By default, it is created in a packed format, in which all meta-data blocks are written back-to-back. With the -r option, the user could choose to have the file in the raw (or sparse) format, in which the blocks are written to the same offset as they are on the device.

debugfs.ocfs2 understands both formats.

o2image also has the option, -I, to restore the meta-data from the image file onto the device. This option will rarely be useful to end-users and has been written specifically for developers and testers.

## OPTIONS
-r

Copies the meta-data to the image-file in the raw format. Use this option only if the destination file system supports sparse files. If unsure, do not use this option and let the tool create the image-file in the packed format.

-I

Restores meta-data from the image-file onto the device. CAUTION: This option could corrupt the file system.

-i

Interactive mode - before writing out the image file print it's size and ask whether to proceed. This setting only applies when '-I' is not specified. It can be useful when the file system holding the image is low on disk space and the user might need to free up space once the target image size is calculated.

## EXAMPLES
Copies metadata blocks from /dev/sda1 device to sda1.out file.

```
# o2image /dev/sda1 sda1.out
```

Copies meta-data blocks from sda1.out onto the /dev/sda1 device. As this command over-writes an existing volume, please use with CAUTION.

```
# o2image -I /dev/sda1 sda1.out
```

## SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2(8) fsck.ocfs2.checks(8) mkfs.ocfs2(8) mount.ocfs2(8) mounted.ocfs2(8) o2cluster(8) o2info(1) tunefs.ocfs2(8)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2007, 2012 Oracle. All rights reserved.


title: ocfs2_hb_ctl(8)

text:
# ocfs2_hb_ctl(8)

## NAME
ocfs2_hb_ctl - Starts and stops the O2CB local heartbeat on a given device.

## SYNOPSIS
ocfs2_hb_ctl -S -d device service

ocfs2_hb_ctl -S -u uuid service

ocfs2_hb_ctl -K -d device service

ocfs2_hb_ctl -K -u uuid service

ocfs2_hb_ctl -I -d device

ocfs2_hb_ctl -I -u uuid

ocfs2_hb_ctl -P -d device [-n io_priority]

ocfs2_hb_ctl -P -u uuid [-n io_priority]

ocfs2_hb_ctl -h

## DESCRIPTION
ocfs2_hb_ctl starts and stops local heartbeat on a OCFS2 device. Users are strongly urged not to use this tool directly. It is automatically invoked by mount.ocfs2(8) and other tools that require heartbeat notifications.

This utility only operates in the local heartbeat mode. It fails silently when run in global heartbeat mode. More information on the heartbeat modes can be found in o2cb(7).

The tools accepts devices to be specified by its name or its uuid. Service denotes the application that is requesting the heartbeat notification.

## OPTIONS
-S

Starts the heartbeat.

-K

Stops the heartbeat.

-I

Prints the heartbeat reference counts for that heartbeat region.

-d

Specify region by device name.

-u

Specify region by device uuid.

-n

Adjust IO priority for the heartbeat thread. This option calls the ionice tool to set its IO scheduling class to realtime with scheduling class data as provided. This option is usable only with the O2CB cluster stack.

-h

Displays help and exit.

## SEE ALSO
mount.ocfs2(8) o2cb(7) o2cb(8) o2cb.sysconfig(5) ocfs2.cluster.conf(5) o2cluster(8)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2004, 2012 Oracle. All rights reserved.


title: tunefs.ocfs2(8)

summary: Change OCFS2 file system parameters.

text:
# tunefs.ocfs2(8)

## NAME
tunefs.ocfs2 - Change OCFS2 file system parameters.

## SYNOPSIS
tunefs.ocfs2 [--cloned-volume[=new-label] [--fs-features=list-of-features] [-J journal-options] [-L volume-label] [-N number-of-node-slots] [-Q query-format] [-ipqnSUvVy] [--backup-super] [--list-sparse] device [blocks-count]

## DESCRIPTION
tunefs.ocfs2(8) is used to adjust OCFS2 file system parameters on disk. The tool expects the cluster to be online as it needs to take the appropriate cluster locks to write safely to disk.

## OPTIONS
--cloned-volume[=new-label]

Change the volume UUID (auto-generated) and the label, if provided, of a cloned OCFS2 volume. This option does not perform volume cloning. It only changes the UUID and label on a cloned volume so that it can be mounted on the node that has the original volume mounted.

--fs-features=[no]sparse...

Turn specific file system features on or off. tunefs.ocfs2(8) will attempt to enable or disable the feature list provided. To enable a feature, include it in the list. To disable a feature, prepend no to the name. For a list of feature names, refer to mkfs.ocfs2(8).

-J, --journal-options options

Modify the journal using options specified on the command-line. Journal options are comma separated, and may take an argument using the equals ('=') sign. For a list of possible options, refer to mkfs.ocfs2(8).

-L, --label volume-label

Change the volume label of the file system. Limit the label to under 64 bytes.

-N, --node-slots number-of-node-slots

Valid number ranges from 1 to 255. This number specifies the maximum number of nodes that can concurrently mount the partition. Use this to increase or decrease the number of node slots. One reason to decrease could be to release the space consumed by the journals for those slots.

-S, --volume-size

Grow the size of the OCFS2 file system. If blocks-count is not specified, tunefs.ocfs2(8) extends the volume to the current size of the device.

-Q, --query query-format

Query the file system for its attributes like block size, label, etc. Query formats are modified versions of the standard printf(3) formatting. The format is made up of static strings (which may include standard C character escapes for newlines, tabs, and other special characters) and printf(3) type formatters. The list of type specifiers is as follows:

B Block size in bytes

T Cluster size in bytes

N Number of node slots

R Root directory block number

Y System directory block number

P First cluster group block number

V Volume label

U Volume uuid

M Compat flags

H Incompat flags

O RO Compat flags

-q, --quiet

Quiet mode.

-U, --uuid-reset[=new-uuid]

Reset the volume UUID of the file system. If not provided, the utility will auto generate it. For custom UUID, specify in either the plain (2A4D1C581FAA42A1A41D26EFC90C1315) or the traditional (2a4d1c58-1faa-42a1-a41d-26efc90c1315) format. Users specifying custom UUIDs must be careful to ensure that no two volumes have the same UUID. If more than one file system were to have the same UUID, one is very likely to encounter erratic behavior, if not, outright file system corruption.

-v, --verbose

Verbose mode.

-V, --version

Show version and exit.

-y, --yes

Always answer Yes in interactive command line.

-n, --no

Always answer No in interactive command line.

--backup-super

Backs up the superblock to fixed offsets (1G, 4G, 16G, 64G, 256G and 1T) on disk. This option is useful for users to backup the superblock on volumes that the user either explicitly disallowed while formatting, or, used a version of mkfs.ocfs2(8) (1.2.2 or older) that did not provide this facility.

--list-sparse

Lists the files having holes. This option is useful when disabling the sparse feature.

--update-cluster-stack

Updating on-disk cluster information to match the running cluster. Users looking to update the on-disk cluster stack without starting the new cluster should use the o2cluster(8) utility.

blocks-count

During resize, tunefs.ocfs2(8) automatically determines the size of the given device and grows the file system such that it uses all of the available space on the device. This optional argument specifies that the file system should be extended to consume only the given number of file system blocks on the device.

## EXAMPLES

```
# tunefs.ocfs2 -Q "UUID = %U\nNumSlots = %N\n" /dev/sda1
UUID = CBB8D5E0C169497C8B52A0FD555C7A3E
NumSlots = 4
```

## SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2(8) fsck.ocfs2.checks(8) mkfs.ocfs2(8) mount.ocfs2(8) mounted.ocfs2(8) o2cluster(8) o2image(8) o2info(1)

## AUTHORS
Oracle Corporation

## COPYRIGHT
Copyright © 2004, 2012 Oracle. All rights reserved.


occtl

package: ocserv

title: occtl(8)

summary: OpenConnect VPN server control tool

text:
# occtl(8)

## NAME
occtl - OpenConnect VPN server control tool

## SYNOPSIS
occtl [OPTIONS...] [COMMAND]

## DESCRIPTION
This a control tool that can be used to send commands to ocserv. When called without any arguments the tool can be used interactively, where each command is entered on a command prompt; alternatively the tool can be called with the command specified as parameter. In the latter case the tool´s exit code will reflect the successful execution of the command.

## OPTIONS
-s, --socket-file=FILE

Specify the server´s occtl socket file. This option is only needed if you have multiple servers.

-j, --json

Output will be JSON formatted. This option can only be used with non-interactive output, e.g., ´occtl --json show users´.

-n, --no-pager

No pager will be used over output data.

--debug

Provide more verbose information in some commands.

-h, --help

Display usage information and exit.

-v, --version

Output version of program and exit.

## EXIT STATUS
0

Successful program execution.

1

The operation failed or the command syntax was not valid.

## IMPLEMENTATION NOTES
This tool uses unix domain sockets to connect to ocserv.

## EXAMPLES
The tool can be run interactively when run with no arguments. When arguments are given they are interpreted as commands. For example:

```
$ occtl show users
```

Any command line arguments to be used as options must precede the command (if any), as shown below.

```
$ occtl --json show users
```

## AUTHORS
Written by Nikos Mavrogiannopoulos. Many people have contributed to it.

## REPORTING BUGS
Issue tracker: https://gitlab.com/openconnect/ocserv/-/issues

## COPYRIGHT
Copyright (C) 2013-2024 Nikos Mavrogiannopoulos and others, all rights reserved. This program is released under the terms of the GNU General Public License, version 2.

## SEE ALSO
ocserv(8), ocpasswd(8)


ocpasswd

title: ocpasswd(8)

summary: OpenConnect server password utility

text:
# ocpasswd(8)

## NAME
ocpasswd - OpenConnect server password utility

## SYNOPSIS
ocpasswd [ -flag [value] | --option-name[[=| ]value] ]... username

## DESCRIPTION
This program is openconnect password (ocpasswd) utility. It allows the generation and handling of a ´plain´ password file used by ocserv.

## OPTIONS
-c, --passwd=FILE

Specify the password file to use. Only useful when not using the default location. The default is /etc/ocserv/ocpasswd.

-g, --group

Specify the user´s group name. Note that groups of one character such as ´*´ and ´x´, are ignored.

-d, --delete

Deletes the specified user from the password file.

-l, --lock

Prevents the specified user from logging in by locking its password.

-u, --unlock

Re-enables login for the specified user by unlocking its password.

-h, --help

Display usage information and exit.

-v, --version

Output version of program and exit.

## EXIT STATUS
0

Successful program execution.

1

The operation failed or the command syntax was not valid.

## FILES
The password format of ocpasswd is as follows.

```
username:groupname:encoded-password
```

The crypt(3) encoding is used for the encoded-password.

## EXAMPLES

### Adding a user

```
$ ocpasswd -c ocpasswd my_username
```

### Locking a user

```
$ ocpasswd -c ocpasswd -l my_username
```

### Unlocking a user

```
$ ocpasswd -c ocpasswd -u my_username
```

## AUTHORS
Written by Nikos Mavrogiannopoulos. Many people have contributed to it.

## REPORTING BUGS
Issue tracker: https://gitlab.com/openconnect/ocserv/-/issues

## COPYRIGHT
Copyright (C) 2013-2024 Nikos Mavrogiannopoulos and others, all rights reserved. This program is released under the terms of the GNU General Public License, version 2.

## SEE ALSO
ocserv(8), occtl(8)