Initialize a QNX filesystem (QNX)
dinit [-bhpqr] [-B filename|-O] [-L label|-l label] [-f bootfile] [-m message] drive
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.
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
All files are lost on the specified disk, unless -b is used.
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
chkfsys, dcheck, fdformat, fdisk, mkdir