![]() |
|
||||
LynxOS Installation Guide |
mkpart(1) man page
NAME
mkpart - An interactive utility to modify partitions
SYNOPSIS
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:
- a - set active partition, s partition-letter--Only the base partitions may be selected for booting. An extended partition cannot be made bootable.
- c - clear all in memory partitions
- d - delete a partition
This command deletes the partition letters specified.
- p - print partition information
- q - exit and do not save changes
- v - verbose, toggles the information level, off by default
- r - reload partitions from disk
- s - set partition.
- G - specify drive geometry--This command is rarely needed. In some cases a user may want to specify the physical geometry of the disk.
- command ? - Gives a mini help screen detailing how to use the command. For example, the command m ? gives help on the m command.
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:
The m command can be used to create partitions without excessive typing by:
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.
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.
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
creates a 400 megabyte extended partition. The extended partition contains partition pointers and partitions.
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
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.
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.
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:
- An extended partition containing logical partitions cannot be changed from an extended partition type.
- A PowerPC boot partition type cannot be changed.
- A bootable partition cannot have its type changed to an extended partition.
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
- hole - A set of contiguous blocks that had previously been allocated as a partition and is now available for use by the m command.
- partition jumbling - A side effect of deleting logical partitions. If a logical partition is deleted, then all logical partitions located after the deleted logical partition are assigned a new letter. This could adversely affect the disks that get automatically mounted in /etc/fstab. Partition jumbling never occurs for base partitions.
- extended partition - A partition, of type 5, that is used to provide more then four partitions. There are only four base partitions available in the 0 block of the disk, limiting the number of partitions available (without the extended partition) to four. The extended partition contains partition pointers and partitions that allow for more than four partitions.
- partition type - A number in the range 0-255 that is associated with a partition--Different partitions can be of different types.
- partition letter - A letter in the range a-zz. a, ab, cf, yy, b, and zz are examples of legal partition letters.
- logical partition - A partition located within the extended partition.
- partition pointer - information to locate the start and size of a partition.
- base partition - A partition pointed to by a partition pointer located in the 0 block of the disk. There are only four base partition pointers available, meaning that only four base partitions are available.
- 0 block - The first block for the given device--For example the 0 block of device /dev/rhd0 is the first block of the entire disk and is referred to as the 0 block of the disk, where the 0 block of /dev/rhd0a is the first block of partition a and is referred to as the 0 block of the partition.
- physical block - The number of bytes that make up a block on the device--This is usually 512 bytes for hard disks and 2048 bytes for
CD-ROM and MO drives.
- logical block - The number of bytes in each block of the file system--The logical blocks must be a multiple of the physical block of the device.
- start block - The physical starting block where the partition begins
- partition size - The number of contiguous physical blocks that are dedicated to the partition
- bootable partition - The partition that firmware boots from--This only applies to the x86 and PowerPC. x86 BIOS and PPCBug look for an active partition to boot.
- CHS - Cylinder head sector--This term is used to describe the geometry of the disk. The geometry of the disk is used by mkpart to calculate the number of blocks in a cylinder.
SEE ALSO
![]() LynuxWorks, Inc. 855 Branham Lane East San Jose, CA 95138 http://www.lynuxworks.com 1.800.255.5969 |
![]() |
![]() |
![]() |
![]() |