Power-Safe filesystem

QNX SDP8.0User's GuideUser

The Power-Safe filesystem, supported by the fs-qnx6.so shared object, is a reliable disk filesystem that can withstand power failures without losing or corrupting data.

Its features include the following:

  • 510-byte (UTF-8) filenames:

    You can't use the characters 0x00-0x1F, 0x7F, and 0xFF in filenames. In addition, / (0x2F) is the pathname separator, and can't be in a filename component. You can use spaces, but you have to quote them on the command line; you also have to quote any wildcard characters that the shell supports. For more information, see Quoting special characters in Using the Command Line.

  • copy-on-write (COW) updates that prevent the filesystem from becoming corrupted by a power failure while writing
  • a snapshot that captures a consistent view of the filesystem
  • encryption capabilities that let you encrypt all or parts the filesystem

For more information about the structure and features of this filesystem, see Power-Safe filesystem in the Filesystems chapter of the System Architecture guide.

CAUTION:
If the drive doesn't support synchronizing, fs-qnx6.so can't guarantee that the filesystem is power-safe. Before using this filesystem, make sure that your device meets the filesystem's requirements. For more information, see Required properties of the device in the entry for fs-qnx6.so in the Utilities Reference.
To create a Power-Safe filesystem, use the mkqnx6fs utility. For example:
mkqnx6fs /dev/hd0t76

You can use the mkqnx6fs options to specify the logical blocksize, endian layout, number of logical blocks, maximum number of inodes (and hence, files), and so on.

Once you've formatted the filesystem, simply mount it. For example:
mount -t qnx6 /dev/hd0t76 /mnt/psfs

By default, the Power-Safe filesystem creates sparse files when growing a file with ftruncate() or when writing at an offset that is beyond the end of a file. The filesystem counts sparse blocks against the total free space, so it isn't possible to overcommit the disk blocks. To maintain compatibility with versions of the filesystem prior to QNX Neutrino 7.1, use the nosparse mount option.

The Power-Safe filesystem now supports Unix domain sockets, which are created by some QNX OS components such as the io-sock network manager. But these sockets aren't supported by all versions of fs-qnx6.so. If you try to mount a filesystem that uses Unix domain sockets with a version of fs-qnx6.so earlier than QNX OS 8.0.3, the mount operation fails. To maintain compatibility with these earlier versions, delete all socket files before unmounting the filesystem on the target that's based on version 8.0.3 or higher.

Generally it's better to avoid using newer filesystem features if you might need to mount the filesystem on an earlier OS version. If you can't avoid using such features, be sure to perform the necessary workarounds described above. For more information about the options for the filesystem and the compatibility checking done while mounting an on-disk image based on it, see the fs-qnx6.so entry in the Utilities Reference.

To check the filesystem for consistency (which you aren't likely to need to do), use chkqnx6fs.

Note:
Don't run the filesystem checker unconditionally at boot. This is likely to fail in upgrade scenarios if the filesystem has been modified by a version of fs-qnx6.so that's newer than the chkqnx6fs utility version.
Page updated: