mkqnx6fs
Format a Power-Safe (fs-qnx6) filesystem (QNX)
Syntax:
mkqnx6fs [-Bqx] [-b blocksize] [-g groups] [-I checksum] [-i inodes]
[-n blocks] [-O options] [-o options] [-R mode[:uid[:gid]]]
[-r percent] [-T type] [-u uuid] [-v vol_name]
host_path
Runs on:
QNX OS
Options:
- -B
- Write the fs-qnx6 filesystem boot loader (ipl-diskpc2-fsq6) only. When you use this option, the utility does not reformat the filesystem or modify it in any other way. The ipl-diskpc2-fsq6 boot loader requires an x86 CSM BIOS.
- -b blocksize
- Set the logical blocksize of the filesystem.
You can specify the size in bytes or in kibibytes (with a suffix of lowercase k),
as follows:
Bytes Kibibytes 512 — 1024 1k 2048 2k 4096 4k 8192 8k 16384 16k 32768 32k The default is 4096 bytes; 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.
- -g groups
- Set the number of allocation groups to subdivide the filesystem. Valid values are in the range 1–64. If you do not specify this option, a value in the range 4–16 is selected automatically based on the filesystem size. An allocation group is a logical concept, not a physical segregation.
- -I checksum
- The checksum used to protect inodes. Supported checksum types:
- crc32 — POSIX CRC32 cksum in inodes.
- f32 — Fletcher-32 cksum in inodes.
By default, no inode checksums are used.
- -i inodes
- Set the number of inodes in the filesystem. Each unique file or directory requires an inode.
The inodes value is rounded up to the nearest multiple of the number of inodes that fit within a filesystem block.
You can specify a suffix of k, for kibiinodes (1024 = 2^10), or m, for mebiinodes (1048576 = 2^20). The case of the letter is ignored.
- -n blocks
- Set the number of logical blocks in the filesystem.
Space is first allocated to the bitmap file and inodes file, so the total size of the resultant
filesystem is slightly larger than the blocks value multiplied by the
-b blocksize value. For information about these files,
see the
Power-Safe filesystem
chapter in the QNX OS System Architecture Guide.You can specify a suffix of k, for kibiblocks (1024 = 2^10), or m, for mebiblocks (1048576 = 2^20). The case of the letter is ignored.
If you don't define this option, by default, mkqnx6fs makes the filesystem fully occupy the specified host_path if it's a physical device. In this case, mkqnx6fs looks at the device, determines its size, and uses all available space.
The only difference when -n is used is that the bitmap file and inodes file will be sized to hold metadata for blocks number of blocks instead of metadata for only as many blocks that can fit into host_path along with those files (meaning potentially less user-accessible space is available when -n is used). But in either case, the overall filesystem size will be exactly the same.
When host_path is a device and you set the -n option along with the -x option, mkqnx6fs creates an expandable filesystem, which is a filesystem with a maximum storage capacity that can exceed the size of the physical device (e.g., disk partition) on which it is currently stored.
Note:It's possible to boot from an expandable filesystem that doesn't entirely fill the device partition that hosts it. The image will expand to fill the partition upon first boot.If host_path is a regular file, this file will be resized to what is appropriate for the specified number of blocks. If you want to fill an existing partition with this file, use the following formula to calculate the value of blocks:- If blocksize is less than or equals 4096:
((partition size - 16384) rounded down to a multiple of 4096) / blocksize - If blocksize is greater than 4096:
((partition size - (12288 + abs(blocksize - 12288) + blocksize) rounded down to a multiple of 4096) / blocksize
- If blocksize is less than or equals 4096:
- -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:
- icheck — perform integrity checks on the inodes.
- lfncksum — enable a cksum algorithm on long filenames (longer than 27 characters), which greatly improves their lookup performance.
The default is -o+lfncksum.
- -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 host_path is a block-special device or is currently mounted.
- -R mode[:uid[:gid]]
- Define the access permissions and, optionally, the user and group membership for the
root directory (i.e., the filesystem mountpoint).
The mode can be a standard POSIX permissions mask (an octal string) or a string
that's accepted by chmod.
The user ID (uid) and group ID (gid) values must be numeric.
This option achieves the same effect as running chmod on the root directory of an already mounted filesystem, but avoids the need to manually invoke chmod or to have a read-write mount.
- -r percent
- Set the percentage of filesystem space to reserve for operations that temporarily need more space (e.g., overwrite of existing data, deletion of files). The default is 3%.
- -T type
- Set the expected usage type of the filesystem. Valid values are
desktop,runtime, andmedia. 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.
- -x
- Create a filesystem that can expand to fit a partition.
This option is effective only when host_path is a physical device and
the -n option is used. In this case,
the -n setting determines the maximum filesystem size.
You can thereby populate a smaller filesystem image and then transfer it to a device with a larger partition, where the filesystem can be expanded to fit. This strategy avoids the need to transfer and write unused filesystem space. For information on expanding a filesystem to fit the partition it is installed on, see the chkqnx6fs -x option.
- host_path
- The host path of the new filesystem.
Note:The mkqnx6fs utility must have write permission to this path for the command to succeed.
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 the host path is a regular file, then it must exist before you run the mkqnx6fs command. For example, you can run the touch utility to create the regular file first.
Description:
The mkqnx6fs utility creates a fresh Power-Safe (fs-qnx6) filesystem at the location specified by host_path (typically a hard disk partition, although you can create an image inside a regular file). The attributes of the filesystem are determined by the defined options.
For details on all filesystems that QNX OS supports, including their drivers and tool set, 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).
