E.6 Partition Operations Mode

Use the partition mode command to activate (make bootable), add, or delete a partition on the device.

You can activate, add, or delete a partition by using either ZENworks Imaging Engine menu or the imaging maintenance mode prompt.

For more information, review the following sections:

E.6.1 Using the ZENworks Imaging Engine Menu to Partition

  1. Enter img to display the ZENworks Imaging Engine menu, then click Partitioning.

  2. Click Modify partitions to open the Partition Wizard.

  3. Select a partition.

  4. Select an option:

    Active: Select a partition that you want to activate (make bootable), then click Active.

    Add: Opens the Create New Partition window. Click a partition type, partition size, and cluster size, then click OK.

    Delete: Select a partition, then click Delete.

  5. When finished, click Done.

For more information, see the table in Section E.6.2, Using the Imaging Maintenance Mode Prompt to Partition.

E.6.2 Using the Imaging Maintenance Mode Prompt to Partition

You can use the following partition mode commands at the imaging maintenance mode prompt:

img -pa partition_number

img -pc partition_number -type=type [-size=size] [-cluster=cluster_size]

img -pd partition_number

img -pd -all

For more information, see:

Command Details

The following table lists the details of the commands used for creating and deleting an image partition:

Operation

Action

-pc partition_number type [size] [cluster=clusterSize] [-A] [-guid]

Creates a new partition, where:

  • partition_number is the number of the partition slot (as displayed by img dump) in which to create the partition

  • type is a keyword, a partition name or a numerical value for the partition type

    The valid keywords for the partition name are fat12, fat16, fat32, fat32x, ntfs, ext2, reiser, linuxswap, and extended. Ensure to specify the keywords in lowercase.

    The numeric value for the partition type can be 0x0C (hexadecimal) or 11 (decimal).

    If you are creating an extended partition, you can create a logical drive inside of the extended partition. (See the next table for an example.)

  • size is a valid size for the partition type.

    You must specify the size in MB or as a percentage of the total capacity of the drive. If you give a percentage, include the % symbol; otherwise, the value is considered the size in MB.

    If you omit this parameter, the largest valid size for the partition type is used, given the available unpartitioned space on the drive.

  • clusterSize is a size appropriate to the partition type and partition size.

    You must specify the size in MB or as a percentage of the total capacity of the drive. If you give a percentage, include the % symbol; otherwise, the value is considered the size in MB.

    If you omit this parameter, the imaging engine uses a reasonable cluster size for the specified partition type and size.

    NOTE:When you create a partition using command line to restore an image partition-wise, you need to get the cluster size from the image first and then pass it as a parameter. If the cluster size is not specified, the default cluster size would be considered, which might not be compatible with the image restored on the partition.

  • -A is a switch used to create an aligned partition with a start sector that is a multiple of 2048.

  • -guid is used while creating GPT type of partitions.

    You can run the img -pc 1 -type=NTFS -size=100 -guid=PartitionType command to create a GPT partition. The partition type attribute in this command can take values like MBD (Microsoft Disk Partition), MRP (Microsoft Reserved Partition), WRE (Windows Recovery Environment Partition), ESP (EFI System Partition).The above command will create a 100 MB partition with GUID partition type and initialize the partition with NTFS file system.

    Ensure that the following conditions are met for a successful partition creation:

    • If the partition type is ESP, then the -type command should be FAT32.

    • Size of MRP partitions depends on the size of the disk. For disk size less than 16 GB, the MRP partition is 32 MB, and for disk size more than 16 GB, the MRP partition is 128 MB.

    • If -guid is specified, either the Protective MBR should be present, or the MBR partition table should be empty.

 

The new partition is recognizable by other operating systems, but must be formatted or have a base image restored to it before you can store files in it.

If you use the legacy NTFS driver to create a partition on a device and no base image is restored in the partition, run the # mkntfs -fc 4096/dev/sdXn command to make the partition usable. In this command, sdX is the device node and n stands for the partition number in the device.

-pd partition_number

Deletes the partition from slot number partition_number. Use img dump to get the slot number.

NOTE:If you are deleting an Extended partition, ensure that you delete it sequentially from the first partition.

-pd -all

Deletes all non-protected partitions.

-pa partition_number

On a MBR disk: Activates (make bootable) the partition in slot number partition_number.

Use the img dump command to get the slot number.

Examples

Table E-14 Partition Mode Examples

Example

Explanation

  • img -pc 1 -type=ext2 or img -pc1 -type=ext2
  • img -pc 1 -type=ext2 -size=1000 or img -pc1 -type=ext2 -size=1000

Creates the ext2 partition in slot 1 using all of the available unpartitioned space on the drive.

img -pc 5 -type=reiser -size=5671

Creates a Reiser partition in slot 5 using 5,671 MB on the drive.

img ‑pd 3 or img -pd3

Deletes the partition from slot 3.

img -pc 2 -type=extended -size=2500

img -pc 2 -type=reiser -size=500

Creates an extended partition with a 2500 ext2 logical drive and a 500 MB Reiser logical drive.

img -pa 1 or img -pa1

Creates a active partition in slot 1.

E.6.3 Using the WinPE Maintenance Mode Prompt to Partition

You can use the following partition commands at the WinPE maintenance mode prompt:

img -pc partition_number -type=type [-size=size] [-cluster=cluster_size]

img -pc partition_number -type=type [-size=size] [-cluster=cluster_size]-guid=guid

img -pa partition_number

img -pd partition_number

img -pd -all

For more information, see:

Command Details

Operation

Action

-pc partition_number -type [-size] [-cluster=clusterSize] [-guid]

Creates a new partition, where:

  • partition_number is the number of the partition slot (as displayed by img -p) in which the partition is created.

  • type is a keyword, a partition name or a numerical value for the partition type.

    The valid keywords for the partition name are FAT32, NTFS, and extended. Ensure that you specify the keywords in lowercase.

    If you are creating an extended partition, you can create a logical drive inside of the extended partition. (See the below table for an example.)

  • size is a valid size for the partition type.

    You can specify the size in MB, or as a percentage of the total capacity of the drive. If you are specifying the size in percentage, then include the percent (%) symbol, else the size value is considered in MB.

    If you omit this parameter, the largest valid size for the partition type is used, given the available unpartitioned space on the drive.

  • clusterSize is a size appropriate to the partition type and partition size.

    If you omit this parameter, the largest valid size for the partition type is used, given the available unpartitioned type and size on the drive.

  • guid (Global Unique Identifier): guid is a unique identifier assigned to every GPT partition, it can be MBD (Microsoft Basic Data Partition), MRP (Microsoft Reserved Partition), WRE (Windows Recovery Environment Partition), and ESP (EFI System Partition).

-pd partition_number

Deletes the partition from slot number partition_number. Use img -p to get the slot number.

-pd -all

Deletes all non-protected partitions.

-pa partition_number

Activates (make bootable) the partition in the slot. Use img -p to get the slot number.

Examples

Table E-15 Partition Mode Examples

Example

Explanation

  • img -pc 1 -type=fat32 -size=1024

Creates the FAT32 partition in slot 1 of size 1024 MB on the MBR disk.

  • img -pc 1 -type=ntfs -size=1024 -guid=MBD

Creates the NTFS partition in slot 1 of size 1024 MB on the GPT disk.

img -pc 2 -type=ntfs

Creates a NTFS partition in slot 2 using all the available unpartitioned space on the drive.

img ‑pd 3 or img -pd3

Deletes the partition from slot 3.

img -pc 2 -type=extended -size=2500 or img -pc 2 -type=ext -size=2500

img -pc 2 -type=ntfs -size=500

Creates an extended partition of size 2500 MB, and a 500 MB NTFS logical drive within the extended partition.

img -pa 1

Activates the partition in slot 1.