Removing and Replacing a Fixed Disk


About This Document
    Related Documentation
Removing a Physical Volume from a Volume Group
How to Proceed if the Volume Group Has Just One Disk
Deallocating Physical Partitions from the Disk
Deleting the Disk from the Volume Group
Removing the Disk Definition from the System
Adding a New Drive to an Existing Volume Group
Recommended Fixes

About This Document

This document describes the procedures to remove and replace a fixed disk in a volume group. These procedures to NOT apply in following environments:

  1. The disk is in a shared volume group. This would apply to environments that use HACMP, RVSD, or other management software. Please refer to the documentation for that product for correct disk replacement procedures.
  2. The disk is in rootvg and the disk contains any one of the following logical volumes, and those logical volumes are NOT mirrored:
  3.                hd2, hd3, hd4, hd6, hd9var, hd8

    In this case, you would need to replace the disk and restore from a system backup specifying the correct disks to restore.

  4. The system is a /usr, dataless, or diskless client.

This document applies to AIX Versions 3.2 and 4.

Please read the entire document before proceeding and ensure all relevant fixes mentioned in this document or otherwise are installed prior to using these procedures.

Related Documentation

For more in-depth coverage of this subject, the following IBM publications are recommended:

The AIX and RS/6000 product documentation library is also available at the following URL:

In addition, similar documents can be accessed through the following URL:

Removing a Physical Volume from a Volume Group

The basic steps to replacing a disk drive are as follows:

  1. Deallocate all the physical partitions associated with the physical volume in the associated volume group.
  2. Remove the physical volume from the volume group.
  3. Remove the definition for the disk from the device configuration database.

These steps are outlined in more detail in subsequent sections.

If there is just one disk in the volume group, proceed to the next section entitled "How to Proceed if the Volume Group Has Just One Disk." Otherwise, proceed to the section entitled "Deallocating Physical Partitions From the Disk."

How to Proceed if the Volume Group Has Just One Disk

If the drive to be replaced is the only drive in the volume group, then remove the volume group definition with:

   exportvg VGname 
At this point, remove the disk definition using the rmdev command. Details on this are included in the section in this document entitled "Removing the Disk Definition From the System."

Deallocating Physical Partitions from the Disk

Every physical partition (PP) on the disk allocated to any LV (including file systems or paging spaces) must be deallocated, either by moving the contents of those PPs to another disk or by removing them.

To determine what logical volumes have PPs allocated to that disk, run:

   lspv -l hdisk# 

If the hdisk name no longer exists, and the disk is identifiable only by its 16-digit PVID (you might see this from the output of lsvg -p VGname), substitute the PVID for the disk name. For example:

   lspv -l 0123456789abcdef 

You may receive the following error:

   0516-320 : Physical volume 00001165a97b10c6 is not assigned to 
   a volume group. 

If so, run the following command:

   putlvodm -p `getlvodm -v VGname` PVID 

VGname refers to your volume group, PVID refers to the 16-digit physical volume identifier, and the characters around the getlvodm command are grave marks (the backwards single quote mark). The lspv -l <PVID> command should now run successfully.

If another disk in the volume group has space to contain the partitions on this disk, and the disk to be replaced hasn't failed, the migratepv command may be used to move the used PPs on this disk. See the man page for the migratepv command on the steps to do this.

If the partitions cannot be migrated, they must be removed. The output of the lspv -l hdisk# (or lspv -l <PVID>) command indicates what logical volumes will be affected. Run the following command on each LV:

   lslv LVname 

The COPIES field shows if the LV is mirrored. If so, remove the failed copy with:

   rmlvcopy LVname 1 hdisk# 

hdisk# refers to ALL the disks in the copy that contains the failed disk (a list of drives can be specified with a space in between each). Use the lslv -m LVname command to see what other disks may need to be listed in the rmlvcopy command. If the disk PVID was previously used with the lspv command, specify that PVID in the list of disks given to the rmlvcopy command. At AIX Version 4.2.1 or higher, the unmirrorvg command may be used in lieu of the rmlvcopy command. See the man pages for rmlvcopy and unmirrorvg, or other documentation, for additional information.

If the LV is NOT mirrored, the ENTIRE logical volume must be removed, even if just one physical partition resides on the drive to be replaced and can't be migrated to another disk. If the unmirrored LV is a JFS file system, unmount the file system and remove it:

   umount /fsname 
   rmfs /fsname 

If the unmirrored LV is a paging space, see if it is active with:

   lsps -a 

If it is active, set it to be inactive on the next reboot with:

   chps -a n LVname 

After you reboot, remove it with:

   rmps LVname 

Remove any other unmirrored logical volume with the following command:

   rmlv LVname 

NOTE: If the LV is serving as a dump device, the dump pointer must first be reassigned. The same is true if the LV was mirrored and the copy is being removed. Check the dump pointers with:

   sysdumpdev -l 

Reassign the dump pointers with:

   sysdumpdev -Pp /dev/sysdumpnull (for the primary device) 
   sysdumpdev -Ps /dev/sysdumpnull (for the secondary device) 

The pointers can be reassigned to the appropriate logical volume after it is recreated.

Deleting the Disk from the Volume Group

Using either the PVID or the hdisk name (depending on which was used when running lspv -l hdisk# in the preceding discussion), run one of the following:

   reducevg -f VGname hdisk# 
   reducevg -f VGname <PVID> 

If you used the PVID value and if the reducevg command complains that the PVID is not in the device configuration database, run the following command to see if the disk was indeed successfully removed:

   lsvg -p VGname 

If the PVID or disk is not listed at this point, then ignore the errors from the reducevg command.

Removing the Disk Definition from the System

Remove the hdisk with:

   rmdev -dl hdisk# 

If the disk was an SSA disk, delete the pdisk with:

   rmdev -dl pdisk# 

If the disk was an SSA disk, determine which pdisk number corresponds to the hdisk. One way to do so is with the following commands:

   lsdev -Cc disk -F name' 'connwhere 
   lsdev -Cc pdisk -F name' 'connwhere 

See which SSA disk serial number coincides with the hdisk to remove. If the hdisk does NOT appear, or if the user has been working with a PVID value up to this point, the pdisk whose serial number does NOT coincide with any of the hdisks is likely to be the disk to remove. Other SSA commands might provide additional information; consult the SSA documentation.

If you have been working with a PVID value rather than with an hdisk name, ensure that the PVID is removed from the ODM via the following command, where the 32-digit value supplied consists of the PVID plus 16 zeros. For example:

   odmdelete -q value=0073659c2c6d26f10000000000000000 -o CuAt 

To PHYSICALLY remove the hard disk, consult the documentation for that device, or the hardware service organization for the vendor.

Adding a New Drive to an Existing Volume Group

Once the new drive has been configured, you can ensure that a proper PVID has been written to the drive by running:

   chdev -l hdisk# -a pv=clear 
   chdev -l hdisk# -a pv=yes 

NOTE: On SSA drives, the first chdev command may be omitted.

Add the drive to the volume group with:

   extendvg VGname hdisk# 

You can also use the mkvg command to create a new volume group on the new drive.

New logical volumes, paging spaces, file systems, or logical volume copies can be re-added via the mklv, mkps, crfs, mklvcopy, or mirrorvg commands, respectively, or by using SMIT.

Recommended Fixes

NOTE: In AIX Version 4, use the command instfix -ik <APAR> to determine if a particular fix is installed.

APAR          Description                             AIX Level
IX76798       INVALID PVID 0000000000000000 IN VGDA   AIX 4.1
IX76683       INVALID PVID 0000000000000000 IN VGDA   AIX 4.2 

Removing and Replacing a Fixed Disk: replace.disk.all.krn ITEM: FAX
Dated: 99/02/23~00:00 Category: krn
This HTML file was generated 99/06/24~12:42:01
Comments or suggestions?
Contact us