mkqnx6fs

Format a Power-Safe filesystem (QNX Neutrino)

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

Syntax:

mkqnx6fs [-Bdq] [-b blocksize] [-g groups]
         [-i inodes] [-n blocks] [-O options] [-o options]
         [-r percent] [-T type] [-u uuid] [-v vol_name] host

Runs on:

QNX Neutrino

Options:

-B
Write the fs-qnx6 filesystem boot loader only (ipl-diskpc2-fsq6). When you use this option, the utility does not reformat the filesystem or modify it in any other way. The boot loader that the utility writes is valid only for x86 targets (32- or 64-bit architecture).
-b blocksize
Set the logical blocksize of the filesystem. You can specify the size in bytes or in kilobytes, as follows:
Bytes Kilobytes
512
1024 1k
2048 2k
4096 4k

The default is 4096; the case of the “k” is ignored. Varying the blocksize can control various types of fragmentation as well as determine the maximum file size supported.

-d
Use a B-tree structure for the root and .boot directories. This can help speed up the handling of filenames that are longer than 27 bytes.
-g groups
Set the number of allocation groups to subdivide the filesystem; by default a value (from 1 to 16) is selected based on filesystem size. An allocation group is a logical concept, not a physical segregation.
-i inodes
Set the maximum number of inodes in the filesystem. Each unique file or directory requires an inode.
-n blocks
Set the number of logical blocks in the filesystem. This is the total size of the filesystem, from which space is first allocated to the system bitmap and inodes files (so the number of user-accessible blocks will be slightly less than the specified value).

By default, mkqnx6fs makes the filesystem fully occupy the specified host (e.g., it determines the number of blocks from the size of the disk partition).

If you want to fill an existing partition from a host file, use the following formula to calculate the value of blocks:

((the partition size (sectors) rounded down to a multiple of 8) - 32) / (block size / sector size)

For example, if the partition size is 1028099 sectors, round down to 1028096 (a multiple of 8), the default block size is 1024, and the sector size is 512, then the value for blocks is calculated as follows:

(1028096 - 32) / (1024 / 512) = 514032
CAUTION:
If you don't round down the partition size to a multiple of 8, the filesystem won't be mountable.
-O options
(“Oh”) Set(+) or unset(-) boot options:
  • quiet — stop the boot loader from doing any output, disable the boot image selection menu, and silently boot the default image.
  • cls — clear the screen first (in case the BIOS didn't do it earlier, and there isn't enough room for the menu).

The default is -O-quiet,-cls.

You can use this option with -B to just update the loader and options.

-o options
Set(+) or unset(-) filesystem options:
  • lfncksum — enable a cksum algorithm on long filenames (longer than 27 characters), which greatly improves their lookup performance.

The default is -o+lfncksum.

CAUTION:
This default is incompatible with the 6.4.0 version of the Power-Safe filesystem. If you wish to format a filesystem that can be mounted read-write by 6.4.0, you must specify -o-lfncksum; otherwise it will allow only read-only mounting.
-q
Operate quietly; don't prompt for confirmation and don't display the resulting configuration of the new filesystem. Without this option, mkqnx6fs will confirm that you meant to format if the host is a block-special device or is currently mounted.
-r percent
Set the percentage of the filesystem to reserve to prevent it from becoming completely full. In general, filesystem performace degrades when the disk is nearly full; this option just makes ENOSPC happen prematurely to stop this. The default is 3%.
-T type
Set the expected usage type of the filesystem; valid values are desktop, runtime, and media. This type is used to pick the appropriate blocksize, number of allocation groups, and number of inodes. It's a hint that's intended to replace explicit -b, -g, -i, and -r values.
-u uuid
Specify a 128-bit UUID for the filesystem, in the UUID “8-4-4-4-12” format. If you don't specify a UUID, mkqnx6fs generates a random, time-based (version 4 UUID) value.
-v vol_name
Specify a volume name of up to 16 characters.
Note: You can't specify both the -u and -v options.
host
The host of the new 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). If you specify the host using a regular file, that regular file must exist before you run the mkqnx6fs command. For example, you can run the touch utility to create the regular file before you run the command.

Description:

The mkqnx6fs utility creates a fresh fs-qnx6 filesystem on the specified host (typically a hard disk partition, although you can create an image inside a regular file).

The integer fields of the filesystem are maintained as either all little-endian or all big-endian, as dictated by the -e option. Thus no CPU architecture pays a byte-swapping penalty for local disks. The filesystem detects the endian-ness and swaps if necessary, so you can move a disk across platforms (with a slight penalty in performance).

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

a Read-only.

b Not usually necessary.

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

Examples:

# mkqnx6fs /dev/hd0t177
All files on /dev/hd0t177 will be lost!
Confirm filesystem re-format (y) or (n): y
Format fs-qnx6: 8040524 blocks, 62816 inodes, 8 groups

Exit status:

0
The filesystem was formatted successfully.
1
An error occurred (a descriptive message is written to stderr).