[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1

lvm_deletepv Subroutine


Deletes a physical volume from a volume group.


Logical Volume Manager Library (liblvm.a)


#include <lvm.h>
int lvm_deletepv (PV_ID, VG_ID)
struct unique_id *VG_ID;
struct unique_id *PV_ID;


The lvm_deletepv subroutine deletes the physical volume specified by the PV_ID parameter from its volume group. The VG_ID parameter indicates the volume group that contains the physical volume to be deleted. The physical volume must not contain any partitions of a logical volume, or the LVM_PARTFND error code is returned. In this case, the user must delete logical volumes or relocate the partitions that reside on the physical volume. The volume group containing the physical volume to be deleted must be varied on or an error is returned.

Note: You must have root user authority to use this subroutine.


PV_ID Specifies the physical volume to be deleted.
VG_ID Specifies the volume group that contains the physical volume to be deleted.

Return Values

The lvm_deletepv subroutine returns one of the following values upon successful completion:

LVM_SUCCESS The physical volume was successfully deleted.
LVM_VGDELETED The physical volume was successfully deleted, and the volume group was also deleted because that physical volume was the last one in the volume group.

Error Codes

If the lvm_deletepv subroutine does not complete successfully, it returns one of the following values:

LVM_ALLOCERR A memory allocation error occurred.
LVM_BELOW_QRMCNT The physical volume could not be removed or deleted because there would no longer be a quorum of available physical volumes.
LVM_DALVOPN The descriptor area logical volume could not be opened.
LVM_FORCEOFF The volume group has been forcefully varied off due to a loss of quorum.
LVM_INVALID_PARAM An invalid parameter was passed into the routine.
LVM_INVCONFIG An error occurred while attempting to configure this volume group into the kernel. This error will normally result if the module ID is invalid, if the major number given is already in use, or if the volume group device could not be opened.
LVM_INV_DEVENT The physical volume specified has an invalid device entry and cannot be checked to determine if it is raw.
LVM_LVMRECERR The Logical Volume Manager record could not be read or written.
LVM_MAPFBSY The volume group is currently locked because system management on the volume group is being done by another process.
LVM_MAPFOPN The mapped file, which contains a copy of the volume group descriptor area used for making changes to the volume group, could not be opened.
LVM_MAPFRDWR An error occurred while trying to read or write the mapped file.
LVM_NOTCHARDEV The physical volume to be deleted does not have a raw device entry.
LVM_OFFLINE The volume group which contains the physical volume to be deleted is off-line and should be on-line.
LVM_PARTFND This routine cannot delete the specified physical volume because it contains physical partitions allocated to a logical volume.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The lvm_deletelv subroutine, lvm_migratepp subroutine, lvm_queryvg subroutine, lvm_reducelv subroutine, lvm_varyonvg subroutine.

List of Logical Volume Subroutines and Logical Volume Programming Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

[ Previous | Next | Contents | Glossary | Home | Search ]