disk initialization (QNX)
dinit [-bhpqr] [-B filename|-O] [-L label|-l label] [-m message] drive
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
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.
A disk may be labeled with a user's specified label of up to 48 characters. You specify the label using the -l ("el") option. For example:
dinit -l "Transfer floppy" /dev/fd0
If you want to label a disk that has already been initialized with dinit, but you don't want to re-initialize it, you may use the -L option.
Labels are most useful on removable media (hard disk cartridges or floppy disks) for verifying that you have the correct disk in the drive. If the disk is already labeled, you won't be allowed to re-initialize the disk without specifying a matching label or first removing the label. The label may be removed by using -L with an empty string as follows:
dinit -L "" /dev/fd0
The fdformat utility will also check for already labeled diskettes in the same manner, preventing accidental reformatting of your floppies.
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.
All files are lost on the specified disk.
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