Initialize a disk for use as a QNX 4 filesystem (QNX)


dinit [-8bpqr] [-F|h] [-B filename|-O] [-d drive_number]
      [-f bootfile] [-i blocks] [-L label|-l label]
      [-m message] [-N] [-R] [-r] [-S size] drive

Runs on:

QNX Neutrino, Linux, Microsoft Windows


Use the int 13 extended loader for disks bigger than 8.4 GB.
-B filename
Use the 512-byte OS loader from this file instead of the standard QNX Neutrino RTOS loader. Note that on a partitioned hard disk, the OS loader is the second loader, not the primary bootstrap loader, which is written to the first block of the hard disk by the fdisk utility. On a nonpartitioned device, (e.g., floppy) the OS loader is the primary (and only) bootstrap loader.
Don't initialize the filesystem; just write the OS loader to disk. You can use this option with -m or -O.
-d drive_number
The BIOS drive number to use for booting the second stage loader (diskpc2). This enables you to set up the loader to boot when the drive is configured as either a primary or secondary drive. Common values for drive_number are: 00 for the first floppy drive, 80 for the first hard drive, and 81 for the second hard drive.

This option is required for booting from secondary hard drives (if you specify an explicit drive number, it overrides -F or -h).

Initialize a floppy or LS120 disk.
-f bootfile
Write the specified operating system boot image to the /.boot file on the newly initialized disk.
-H or -h
Initialize a hard or compact flash disk. You can't initialize a hard disk unless you specify this option.
-i blocks
The initial size, in blocks, of the .inodes file. The default is 16. You don't usually have to change this setting; for more information, see Fine-Tuning Your System in the QNX Neutrino User's Guide.
-l label
("el") Write the given volume label to disk after initializing.
-L label
Write only the given volume label to disk. You can remove a label by using the -L option with an empty string. For example:
dinit -L "" /dev/fd0
-m message
Replace the message the OS displays when booting from disk with message.
Don't create support for long filenames (more than 48 characters) on this new filesystem.

To add support for long filenames to an existing QNX 4 filesystem, log in as root and create an empty, read-only (permissions 0444) file named .longfilenames in the root directory of the filesystem.

Use the old QNX bootstrap loader. The old loader loads at (real mode) 0x60:0, always. The newer loader looks for a signature byte in the beginning of the OS image to determine if it's old or new, and loads at 0x60:00 or 0x80:00 as appropriate. The start address for new images is 0x0 relative to the load address, while the start address for old images is 0x20 relative to the load address.
Pause for a keystroke before continuing.
Be quiet; don't echo or question.
Create a .diskroot file in the root directory.
Write only the root block to disk; see "Caveats," below.
-S size
When used on a file, grow it to this size, which can include a suffix of k, m, or g.
The drive on which to initialize the hard disk or diskette (e.g., /dev/fd0, /dev/hd0t77).
Note: Device names under Windows differ from those under QNX operating systems. For example, under QNX Neutrino:
dinit -f hello.ifs /dev/fd0

Under Windows:

dinit -f hello.ifs a:


The dinit utility initializes a formatted diskette or hard disk so that you can use it as a QNX 4 filesystem, using fs-qnx4.so. The default values are determined from the current configuration of the specified drive.

Note: We recommend that you use dinit to initialize the QNX 4 filesystem, and dloader to make it bootable. The dinit bootloader options are for backwards compatibility reasons, but aren't generally used anymore.

If the disk is a hard disk, you need to specify the -h or -H (hard) option. This option helps protect you against typing errors that might cause dinit to initialize your hard disk. To initialize a hard disk, you must be the superuser.

After initializing a hard disk with dinit, you should use the dcheck utility to remove any bad blocks from the disk allocation bitmap. For example:

dinit -h /dev/hd0t77
dcheck -m /dev/hd0t77

When dinit initializes a disk, it writes a loader in the first block. If the disk is a floppy diskette, the loader is the bootstrap loader, else it's the secondary (or partition) loader. If you need to rewrite the loader without reinitializing the disk, specify the -b option.

The -m option lets you change the message the OS displays when booting from disk. Normally, the message is:

Press ESC to boot alternate OS.

Your new message may contain up to 30 characters plus the trailing period. You can specify the minimum message of "." by specifying -m. for the option.

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 fs-qnx4.so dinit chkfsys
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
  Read-only compressed (RCFS) fs-rcfs.so mkrcfs N/A

a Read-only.

b Not usually necessary.

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


Initialize a hard disk:

dinit -h /dev/hd0t77

Initialize a floppy disk:

dinit /dev/fd0

Pause before initializing hard disk:

dinit -hp /dev/hd0t77

Exit status:

An error occurred.


Don't use the -r option unless you know exactly what you're doing. You use the -r option only after a disaster has destroyed the first few blocks of your disk (e.g., a power failure occurred while the disk was being updated). In order for any damage to be repaired, you must follow dinit -r with this command:

chkfsys mountpoint