[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 2


efdisk Command

Purpose

Views, creates or deletes physical disk partitions. (Itanium-based platform only)

Syntax

efdisk [ Flags ] hdisk_device_file

Description

The efdisk command is the partition manager for AIX on Itanium-based platforms. This command will manage the partitions on a physical disk. The command is directed at a logical disk hdiskx. The efdisk command provides options to:

  1. Display partition information about a disk.
  2. Initialize partition information on a disk. This operation writes new partition information on a disk. This operation is sometimes called partitioning a disk.
  3. Interactively add and delete partitions on a disk.
  4. Batch mode add or delete partitions on a disk. (Option used by AIX install.)
  5. Query partition status of a disk. (Option used by AIX install.)

The command opens the /dev/hdiskx_all special file associated with the requested logical disk name and displays the existing partition information, prior to waiting for user input.

The hdisk_device_file parameter specifies the disk the efdisk command is to process. The disk can be specified by its logical hdiskx name (for example hdisk0) or its special file name /dev/hdiskx_all. The command opens the specified disk's special file name /dev/hdiskx_all and operate on that disk

Note: Disk partitioning changes made by running the efdisk command become effective after the affected device has been reconfigured, or once the system has been rebooted. Reconfiguration of the disk can be performed by running the rmdev -l hdiskx command followed by the mkdev -l hdiskx command.

Flags


-p . Displays partition information for the disk.
-q Queries partition data for the disk.
-b Specifies batch mode operation.
-c Applies the changes to the disk in batch mode.
-f Directive_File Specifies the batch mode directives file.
-s Initializes the disk with Default (GPT style) partition tables.
-e Initializes the disk with GPT style partition tables.
-l Initializes the disk with LEGACY (DOS style) partition tables.

Examples

Interactive Mode

  1. To start efdisk in its interactive mode, type:
    efdisk hdisk3
    

    or

    efdisk /dev/hdisk3_all
    

    In interactive mode, the command first checks the validity of the partition information on the disk and displays the existing partition information. You are then presented with options to add or delete partitions, display detailed partition information, write changes and exit, and to quit without writing changes. Additional menus and options are presented when adding or deleting partitions. The changes requested are not written to the disk until the you specify the write changes to disk and exit option.

Batch Mode

The efdisk command provides a batch mode for use during AIX install or when it is desirable to partition multiple disks from a script file. An additional batch interactive mode is provided where the interactive partitioning menus are displayed to the user and the user's actions are written to a batch mode directive file in order to defer the actual disk modification to a later time.

  1. To display normal interactive partitioning menus, using the -b (batch) flag in conjunction with the -f flag, and all operator directed actions be written as directives to the partition directive file (specified by -f) without committing changes to the disk, type:
    efdisk -b -f /tmp/partinfo.hdisk3 hdisk3
    
  2. To indicate that the file be used as an input directive file and the changes described in the file be committed to the specified disk without user interaction, type:
     efdisk -c -f /tmp/partinfo.hdisk3 hdisk3
    

    The batch directive file has the following syntax:

    Command syntax:

    add index direction size type name

    where:

    index Specifies the index for new partition. The value is either an integer starting at 0 or* character indicating to use next available partition index
    direction Specifies the allocation direction:
    • f or F indicates allocate forward from lowest available free logical block address.
    • b or B indicates allocate backward from highest available free logical block address.
    size Specifies the size for the new partition. An integer number indicates number of bytes to allocate for the new partition. A *, r, or R character indicates to allocate all of the space in the largest available free space area found on the disk.
    type Specifies a partition type for the new partition
    • physvol indicates physical volume partition type.
    • system indicates system partition type.

    Other customer defined partition types can be defined in the /etc/diskpartitions file.

    name Specifies the name for the new partition. A quoted string up to 35 characters long

    For example:

    add, *, b, 52428800, system, "System Partition" 
    

    Add a 50 megabyte system partition with the first available partition index at the highest available logical block address on the disk

    add, *, f, r, physvol, "Physical Volume Partition"
    

    Add a physical volume partition with the first available partition index into the largest free space area on the disk starting at the lowest available logical block address.

    delete index type

    index Specifies the index for partition to be deleted. Value is either an integer starting at 0 or * character indicates to delete all partitions matching the type parameter.
    type Specifies the type of partition to be deleted
    • physvol indicates physical volume partition type.
    • system indicates system partition type.

    Other customer defined partition types can be defined in the /etc/diskpartitions file. An * character indicates any partition type

    For example:

    delete 1, physvol
    

    Deletes partition 1 if it is a physical volume.

    delete *, physvol
    

    Deletes all physical volume partitions on disk.

    delete 1, *
    

    Deletes partition 1 of any partition type.

    delete *, *
    

    Deletes all partitions on the disk.

    delnotsys
    

    Deletes all non-system partitions from disk. This command does not have any parameters/options.

Displaying partition information

  1. To display all partition information on the specified disk, type:
    efdisk -p hdisk0
    

    This command begins by displaying information about the disk such as its size, number of blocks, blocksize, and its GUID (Guaranteed Unique Identifier). If the disk has valid partition tables, the command then displays if the disk is formatted with LEGACY or EFI style partition tables. It then displays information about allocated partitions and free space on the disk. The partitions are displayed in logical block address order starting at the lowest address on the disk. The following information is displayed for allocated partitions: partition index, partition type, partition type GUID, partition GUID, starting LBA, ending LBA, number of blocks, partition size, and if EFI partitioned the partition name.

Custom partition types

The efdisk commands functionality can be extended to support custom partition types on GPT partitioned disks. An operator can define custom partition types in the /etc/diskpartitions configuration file. When /etc/diskpartitions contains valid custom partition type entries, the efdisk command allows the user to create partitions of the type described by the entry.

Following is the format of custom partition type entries in the /etc/diskpartitions file:

GUID DESCRIPTION TYPE

where:

GUID The partition's type GUID. These have the form:
12345678-1234-1234-1234-123456789abc
 

They must have the exact form shown, 36 characters, hex digits in the grouping shown, separated by - character.

DESCRIPTION A quoted (") string describing the partition. The string may be up to 35 characters.
TYPE A string containing a short name for the partition. The string may be up to 7 characters. Lines beginning with '#' character are comment lines

For example:

c2d426f8-1d34-183c-1234-1330d61872b9 "Data Base Partition" db
 
 
2372dc84-3ff3-2736-29a1-2562a5b7ff00 "Special Partition" special
 

Files


/etc/diskpartitions Optional custom partition type definition file

Related Information

The eformat command.

EFI Disk Partitioning Overview inAIX 5L Version 5.1 Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]