Create QNX disk partition (QNX)
fdisk [-fpz] [-B loader] drive [cmd]
Commands:
add [-f slot] {QNX|type} {ALL|HALF|QUARTER|TENTH|size}
boot [QNX|QNX2|DOS|OS2|type|slot]
info
loader
show
query [QNX|QNX2|DOS|OS2|FREE|TOTAL|type|slot]
Where:
type | For |
---|---|
t77, t78, or t79 | QNX 4 |
t7, t8, or t9 | QNX 2.1 |
t1, t4, t5, or t6 | DOS |
Refer to the description for more details on partition specifiers.
The fdisk utility lets you partition a hard disk. The partition information matches that used by DOS. The information is kept on the first physical block on the disk.
The fdisk utility can be run only by root or users with read/write permissions for the block special file concerned. If you want your disk to contain both QNX and DOS partitions, we recommend that you create the DOS partition first, using DOS commands. |
You can boot only from OS images that are loaded from within the first 1024 cylinders of the disk. This means that while you may be able to initially install and boot from a partition which extends past the 1024th cylinder, it will someday fail when you go to update the boot image because the location of some of its blocks may change. When this happens you will have a system which is no longer bootable. Avoid this problem by creating a separate partition to boot from that lies entirely within the first 1024 cylinders of the hard drive, and use a second partition to access the additional space on the drive. (The boot partition may be quite small -- just a few megabytes will suffice.) |
To create a QNX partition for the first time, you must first start the Filesystem Manager and the hard disk driver. For example:
Fsys & disktrap start
You should then execute the fdisk command:
fdisk /dev/hd0
to partition your disk.
QNX doesn't automatically mount any partition. Once you've created the partition, you should mount the disk using this partition (see mount).
It's important to realize that fdisk only displays and updates the partition information on the disk. It doesn't directly affect your access to the drive (see mount).
The fdisk utility is a fullscreen, interactive program that's fairly self-explanatory. When you invoke fdisk, you'll see a screen similar to this one (assuming your disk is already partitioned):
FDISK Ignore Next Prev 1 2 3 4 Change Delete Boot Unboot Restore Loader Save Quit __OS__ Start End _______Number_____ Size Boot name type Cylinder Cylinder Cylinders Blocks 1. DOS ( 4) 0 159 160 39165 19 MB 2. QNX2.x ( 7) 160 419 260 63700 31 MB 3. QNX ( 77) 420 854 435 106575 52 MB * 4. ------ (---) ----- ----- ----- ------- ----- Choose one of the partitions, by: typing the partition number OR moving the pointer with the UP/DOWN arrows; then, choose one of the actions on the top line of the screen. Drive : /dev/hd0 Size : 102 Mbytes Config: 7 Heads Loader: QNX 35 Sectors/cyl 855 Cylinders Last cylinder is 854
You'll see the available commands displayed at the top of the screen. To select a command, either type its first letter or move the cursor to the command (with the arrow keys) and press Enter.
The commands are:
Command: | Action: |
---|---|
Next | Move the pointer to the next entry. |
Prev | Move the pointer to the previous entry. |
1, 2, 3, or 4 | Move the pointer to the indicated entry. |
Change | Change the selected partition. |
Delete | Delete the selected partition. |
Boot | Turn on the boot flag for the selected partition. |
Unboot | Turn off the boot flag for the selected partition. |
Restore | Restore the previous non-QNX bootstrap loader. |
Loader | Change the bootstrap loader to the QNX loader. |
Save | Save all changes and quit. |
Quit | Quit without saving changes. |
If you're changing a partition entry, you'll be required to enter the partition type number and the start and end cylinders. The other information will be calculated for you by fdisk.
Note that partition types 78 and 79 (which will appear on the interactive display as partition names QNY, QNZ, respectively) are the suggested OS types to use for second and third QNX 4 partitions.
The fdisk utility can also be run as a non-interactive utility using command-line options. This is useful for designing a custom installation procedure.
The command-mode syntax is:
fdisk supports the following commands directly from the command-line:
Using the -f (force) option deletes any existing partition in the specified partition number of the partition table. All allocated blocks are freed for reuse before attempting to allocate the requested space. Also, add will normally use the first available partition number, but the -f option will force it to use slot, the specified number.
ttype | For |
---|---|
t77, t78, or t79 | QNX 4 |
t7, t8, or t9 | QNX 2.1 |
t1, t4, t5, or t6 | DOS |
Interactively create or edit the partition table of /dev/hd0:
fdisk /dev/hd0
Create a QNX partition which occupies half the disk, or the largest available space if there isn't a space big enough for a new partition that occupies half the disk:
fdisk /dev/hd0 add qnx HALF
The drive specified on the command line must name a block special file.
When no cmd is specified on the command line, fdisk is an intensely interactive fullscreen program using the standard input and standard output. The standard error is used for diagnostic messages upon severe errors (in non-interactive mode) and for ASCII BEL characters in interactive mode used to notify the user that something invalid has been entered into a field.
After changing any partition that is mounted, you must either umount and then re-mount the changed partition or simply reboot. If you don't take these steps, you could damage the filesystem on the new partition.