dinit
![]() |
![]() |
![]() |
![]() |
dinit
Initialize a disk for use as a QNX 4 filesystem (QNX Neutrino, QNX 4)
Syntax:
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:
All supported hosts.
Options:
- -8
- 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.
- -b
- 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).
- -F
- 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.
- -N
- 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.
- -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'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.
- -p
- Pause for a keystroke before continuing.
- -q
- Be quiet; don't echo or question.
- -R
- 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.
- -r
- 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.
- drive
- The drive on which to initialize the hard disk or diskette
(e.g. /dev/fd0, /dev/hd0t77).

Device names under Windows differ from those under QNX 4 and QNX Neutrino. For example, under Neutrino: dinit -f hello.ifs /dev/fd0Under Windows:
dinit -f hello.ifs a:
Description:
The dinit utility initializes a formatted diskette or hard disk so that you can use it as a QNX 4 filesystem. The default values are determined from the current configuration of the specified drive.
![]() |
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.
To initialize a Power-Safe (fs-qnx6.so) filesystem, use mkqnx6fs. |
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.
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
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 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]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
