[Previous] [Contents] [Index] [Next]


Disk initialization (QNX Neutrino, QNX 4)


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


Use the int 13 extended loader for disks bigger than 8.4Gig.
-B filename
Use the 512-byte OS loader from this file instead of 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 nonpartitioned device, (e.g. floppy) the OS loader is the primary (and only) bootstrap loader.

To write only the loader (and not erase the disk), also specify the -b option.

Don't initialize the filesystem; just write the OS loader to disk. You can use this option with -B, -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 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 (used for diskboot auto-mounting). For more information, see the Controlling How Neutrino Starts chapter of the Neutrino User's Guide.
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 4 and QNX Neutrino. For example, under 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 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 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.


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

See also:

chkfsys, dcheck, diskboot, dloader, fdformat, fdisk

Controlling How Neutrino Starts, Backing Up and Recovering Data and Fine-Tuning Your System in the Neutrino User's Guide

[Previous] [Contents] [Index] [Next]