Manage disk partitions
|You must be root to run this utility.|
fdisk [-fpz] [-B loader] drive [cmd [args]]
The fdisk utility lets you create and manage partitions on a hard disk. The partition information, which is kept in the disk's first physical block, matches that used by DOS.
|You can run fdisk only if you're root or have
read/write permissions for the block-special file concerned.
If you want your disk to contain both QNX 4 and DOS partitions, we recommend that you create the DOS partition first, using DOS commands.
On some platforms, fdisk supports an interactive mode.
|On some older machines,
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 that's 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.)
Before creating a QNX 4 partition for the first time, you must first start the hard disk driver:
You should then execute the fdisk command to partition your disk:
fdisk /dev/hd0 add
The QNX 4 filesystem doesn't automatically relearn any changes that you make to the partition table with fdisk. You must either slay and restart the filesystem/driver (devb-*) or use mount -e /dev/hd0 to recognize the new partitions and update the contents of /dev.
The fdisk utility supports the following commands directly from the command line:
If you specify the -c option, the -p option is ignored.
|Use this type:||For:|
|77, 78, or 79||QNX 4|
|7, 8, or 9||QNX 2.1|
|1, 4, 6, 11, or 12||DOS|
On some platforms, fdisk 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. QNZ ( 79) 0 678 679 10908072 5326 MB * 2. ______ (___) _______ _______ _______ _________ _____ 3. QNX ( 77) 1359 1825 467 7502355 3663 MB 4. ______ (___) _______ _______ _______ _________ _____ Choose a partition 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 Config: 255 Heads Size : 14323 Mbytes 63 Sectors/track Loader: QNX 1826 Cylinders 512 Block Size Last cylinder is 1825
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:
|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 (see below).|
|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, note the following:
Create a QNX 4 partition that 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 -t 77 -p 50
After changing any partition information, you must either slay and restart the filesystem/driver (devb-*) or use mount -e to make the filesystem reread the partition table.
Backing Up and Recovering Data in the Neutrino User's Guide