chkqnx6fs

Updated: April 19, 2023

Check an entire Power-Safe filesystem for consistency (QNX Neutrino)

Note: You must be logged in as root to run this utility.

Syntax:

chkqnx6fs [-fpsvWwx] [-S block_number] host

Runs on:

QNX Neutrino

Options:

-f
Fix the filesystem unconditionally. The default is to check only.
-p
Proceed even if one superblock is damaged. This option lets chkqnx6fs repair a corrupted superblock.
-S block_number
Force the display of superblock 0 or 1 (implies -s and -vv).
-s
Display header information from the superblock. The number of -v options controls which fields chkqnx6fs displays.
Note: If you specify -s, chkqnx6fs locates and verifies the active superblock, but doesn't check the filesystem itself.
-v
Increase output verbosity. You can specify multiple -v options.
-W
Fail on the first warning.
-w
Don't display warnings.
-x
For expandable filesystems, expand the filesystem to fit the partition it is installed on. For more information, see the description below.
host
The host of the filesystem. You can specify this as a block-special device or partition (e.g., /dev/hd0t76), as a regular file, or as the root directory of a mounted fs-qnx6 filesystem (which will be resolved to the real host device).

Description:

The chkqnx6fs utility performs a consistency check on a Power-Safe (fs-qnx6) filesystem. The check is conducted in these passes:

  1. Locate and verify superblocks and select the newest stable one.
  2. Traverse the bitmap file and inodes file. For information about these files, see the Power-Safe filesystem chapter in the QNX Neutrino System Architecture Guide.
  3. Recursively walk the directory hierarchy from the root.

You should run chkqnx6fs only on an unmounted filesystem.

Note: You shouldn't actually need to use chkqnx6fs in a production system (e.g., in a boot script). The design of the fs-qnx6 filesystem should (in the absence of software bugs, physical bad blocks, or malicious data modification on the raw device) make any such check unnecessary.

For expandable filesystems, chkqnx6fs also allows you to expand the filesystem (using -x) to fit the partition it is installed on. This allows you to create and maintain a filesystem with a consistent set of files and directories that works on systems with differently sized partitions (or anticipate a future system with a larger partition).

For the -x option to work, you must first use one of the following methods to create an expandable filesystem:
  • mkqnx6fs with the -x option to make the filesystem expandable and the -n option to specify the number of blocks. Copy the partition to a file (for example, using dd) that you can transfer to the destination partition (a filesystem image).
  • mkqnx6fsimg with the max_sectors attribute that indicates the maximum size of storage medium that the filesystem supports.
With the expandable filesystem image installed on the destination partition, execute chkqnx6fs -x to expand the filesystem to exactly fit the partition.

Summary of filesystem commands

The following table shows the shared objects and related commands for the filesystems:

Partition type Filesystem Shared object Initialize with: Check with:
1, 4, or 6 DOS fs-dos.so mkdosfs chkdosfs
7 Windows NTa fs-nt.so N/A N/A
11, 12, or 14 FAT32 fs-dos.so mkdosfs chkdosfs
77, 78, or 79 QNX 4 N/A N/A N/A
131 Linux (Ext2) fs-ext2.so N/A N/A
175 Apple Macintosh HFS or HFS Plusa fs-mac.so N/A N/A
177, 178, or 179 Power-Safe fs-qnx6.so mkqnx6fs chkqnx6fsb
185 QNX Trusted Disk fs-qtd.so mkqfs N/A

a Read-only.

b Not usually necessary.

For more information, see the Filesystems chapter of the System Architecture guide.

Examples:

# chkqnx6fs -v /dev/hd0t76
** Prelude: read and verify superblocks **
** Pass 1 : verify bitmap and inodes **
** Pass 2 : verify directory hierarchy **
** Summary: 20216/8040524 blocks, 142/62816 inodes **

Exit status:

0
The filesystem is consistent/stable.
1
An error occurred checking the filesystem (descriptive messages are written to stderr).