TOC PREV NEXT INDEX

LynxOS Installation Guide


mkpart(1) man page

NAME

mkpart - An interactive utility to modify partitions

SYNOPSIS

mkpart <device_name>

DESCRIPTION

mkpart is an interactive utility that modifies the partitions of a disk. mkpart works with all types of hard disks and devices that emulate hard disks (flash, magneto optical drives, ram disks, etc.).

mkpart works on devices with non-512 byte block sizes: it determines the physical block size of the device and gets the data to the right spot on the device. Beware though, as booting of greater than 512 byte physical devices with BIOS on the x86 is likely to fail.

mkpart does not work on read-only devices, for good reason. The argument to mkpart is the raw device that corresponds to the whole disk. e.g., /dev/rhd0, /dev/rsd2940.0, /dev/rsd3.

The commands available for mkpart are:

d <partition_letter>

This command deletes the partition letters specified.

m size
s <partition_letter> <partition_type>

A partition is a contiguous set of blocks that is pointed to by the partition pointer. The mkpart utility manipulates the partition pointers. The partition pointers can be located in block 0 of the disk or within an extended partition.

The m command is used to create a base partition pointer or a logical partition pointer. The size of the partition with the m command is always given in megabytes. The partition's actual size is rounded up to the next cylinder boundary so the size of a partition might not exactly be the size given.

For example, to make a 100 megabyte base partition:

m 100

The m command can be used to create partitions without excessive typing by:

m 10 20 30 40

This will create four base partitions of 10, 20, 30 and 40 megabytes, assuming that you have four free base partitions, and 100 megabytes available on the device. If you want to use the last available chunk of space on the device then the all size can be used for the last partition size given.

m 10 20 30

all creates a 10, 20 and 30 megabyte partition, and a fourth partition with the remaining space available. Since partitions are rounded up to cylinder boundaries there can be disks that have less than a cylinder's worth of blocks left. This space cannot be claimed by mkpart and goes unused. This is typically less then 1 MB, though.

The default partition type is 64. This indicates a LynxOS partition. To create a partition of a different type use the / option with the m command.

m 100/20

This creates a 100 megabyte partition of type 20.

If you want more than four partitions, then an extended partition must be used. One of the base partition pointers must be an extended partition type. The extended partition type is 5. The command

m 400/5

creates a 400 megabyte extended partition. The extended partition contains partition pointers and partitions.

Note: If the extended partition is written to as a block or raw device, the logical partitions within the extended partitions are lost.

Once the extended partition has been created, the l option of the m command can be used. This creates a logical partition within the extended partition. Given an extended partition, the command

m l 30 40 50

creates three logical partitions of 30, 40 and 50 megabytes within the extended partition. Logical partitions can be of various types as well; just specify the partition-type option after the size to override the default type.

Note: DOS® fdisk does not display non-DOS logical partition types. You can either guess the correct DOS logical partition type for logical partitions intended to be used by DOS or just create all extended partitions with DOS fdisk. Then run mkpart and change the logical partition types to LynxOS types for use with LynxOS.

The base partitions are named a, b, c and d. The extended partitions start with letter e and proceed through letter o. Partition o is the limit because there are 4 bits available in the minor number allocated to the partitions. This means there are 14 usable (mountable) partitions. 0 is allocated to the entire disk and one of the base partitions is used up by pointing to an extended partition, leaving 14.

For all partition types except type 65, a size must be specified. A type 65 partition is reserved to represent a PowerPC boot partition. The first partition created must be type 65 in order for the disk to be able to boot on the PowerPC. m /65 creates a 0 length type 65 partition. This partition uses up a base partition pointer.

Note: If makeboot is run on a PowerPC, this partition becomes non-zero in size. This is alright. What happens is that makeboot modifies the type 65 partition to point to a contiguous file that looks like a bootable partition. This contiguous file is located within another partition.

Upon executing the exit command, mkpart modifies the 0 block of each partition displayed by mkpart. So experimenting and exiting with mkpart results in various blocks on the device being written.

The d command is used to delete partitions. Just type d partition_letter to delete the partition. To delete lots of partitions at once, specify more partition letters after the d command. When deleting logical partitions beware of partition jumbling. When logical partitions are created physical space is reserved. This space could contain important data like file systems and cannot be moved around. When a logical partition is deleted the physical space pointed to by the logical partition pointer is still there but it is available for use by the m command. This space is referred to as a hole. Adjacent holes are automatically coalesced.

The s command is used to change the partition type. There are various reasonable restrictions placed on the s command, such as:

When mkpart is first run, it reads the labels on the disk and loads the internal partition tables with that data. After some modification it may be desirable to reload this information. The r command accomplishes this. Quitting and then restarting mkpart accomplishes the same thing.

The c command clears the internal partition tables. Think of it as a fresh start command.

When verbose mode is enabled, the starting block, end block, and number of blocks allocated for the partition are also displayed.

The p command prints the partition information. With extended partitions the number of lines can be excessive, so the p command takes an optional integer argument that can limit the number of lines displayed, e.g., p 20 prints twenty lines of information.

The a command is used to set an active partition. Only the x86 and PowerPC platforms need to have an active partition for booting. The makeboot command for the x86 and PowerPC also set the active partition when they are run. This command is most useful when booting another operating system on a different partition.

Definitions

SEE ALSO

Utility Program - setactive(1)



LynuxWorks, Inc.
855 Branham Lane East
San Jose, CA 95138
http://www.lynuxworks.com
1.800.255.5969
TOC PREV NEXT INDEX