Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Disk writes and the /dev directory
Ref. No. QNX.000004448
Category(ies) Utilities, Configuration
Issue If we power down during a boot we sometimes irreparably damage the root file system.  The only writing to disk that occurs during boot seems to be the creation of the /dev directory.

It is impossible to guarantee that a power down will not occur during boot in our application.

Is it possible to mount the /dev directory on a different partition other than the root?  The /dev directory and all its entries seem to be created at boot time.  How much control do we have to move it, or limit the entries?
Solution The entries to Dev may be controlled by using the -n/-N options.  Typing 'use Dev' shows:

Dev [-n devices]  &

Options:
-n devices      Maximum number of devices to support (default: 64).
-N prefix      Name to register in the pathname space (default: /dev)
Examples:
Dev &          - Start Dev using defaults.
Dev -n 100 &    - Allow 100 devices.
Version: 423G

The /dev directory is not actually on disk, it is in the namespace only (in memory).  Therefor a shutdown during a /dev creation at boot time will not damage the file system.  For more information, read Chapter 4 I/O Namespace in the QNX OS System Architecture manual.

Running 'chkfsys' in your sysinit.node file DOES read/write to disk, and can cause problems if a powerdown occurs while chkfsys is running.  Have a look at the documentation for this utility in the QNX OS Utilities A to M manual.