[Previous] [Contents] [Next]

dinit

Initialize a QNX filesystem (QNX)

Syntax:

dinit [-bhpqr] [-B filename|-O] [-L label|-l label]
      [-f bootfile] [-m message] drive

Options:

-b
Do not initialize the filesystem. Write OS loader (only) to disk.
-B filename
Use 512 byte OS loader from this file rather than the standard QNX OS 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 non-partitioned device (e.g. floppy) the OS loader will be the primary (and only) bootstrap loader. To write only the loader (and not wipe the filesystem clean) you must also specify the -b option.
-f bootfile
Preload .boot on the disk with the contents of the specified boot image.
-h
Initialize the hard disk. You can't initialize a hard disk unless you specify this option.
-l label
("el") Deprecated. Write volume label to disk after initializing.
-L label
Deprecated. Write only the volume label to disk.
-m message
Replace the message the OS displays when booting from disk with message.
-O
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 is old or new, and loads at 60h:00 or 80h:00 as appropriate. The start address for new images is 0h relative to the load address, while the start address for old images is 20h relative to the load address.
-p
Pause for a keystroke before continuing.
-q
Be quiet; don't echo or question.
-r
Write only the root block to disk.
drive
Drive on which the hard disk or diskette is to be initialized (e.g. /dev/fd0, /dev/hd0t77, etc.).

Description:

The dinit utility initializes a formatted diskette or hard disk so that it may be used as a QNX filesystem. The default values are determined from the current configuration of the specified drive.

If the disk is a hard disk, you need to specify the -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.

Once you initialize 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

To initialize a disk on another node, you must explicitly indicate the disk via a //node prefix.

Disk labeling (-l and -L options) is a deprecated feature. These options will be eliminated in a future release.

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 is the secondary (or partition) loader. If you feel the need to rewrite the loader without re-initializing the disk, you may 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 must include a trailing period. The OS will display the specified text up to the first period encountered. For example, if message is "Booting ...", the printed message will be:

     Booting .

Your new message may contain up to 30 characters plus the trailing period. You can specify the minimum message of "." by entering:

    -m.

Examples:

Initialize a hard disk:

    dinit -h /dev/hd0t77

Initialize a floppy disk:

    dinit /dev/fd0

Pause before initializing hard disk:

    dinit -hp /dev/hd0t77

Initialize floppy disk on node 3:

    dinit //3/dev/fd0

Files:

All files are lost on the specified disk, unless -b is used.

Exit status:

0
Successful.
>0
An error occurred.

Caveats:

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 drive

See also:

chkfsys, dcheck, fdformat, fdisk, mkdir


[Previous] [Contents] [Next]