LVM Remove a Physical Volume: Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
Line 39: Line 39:
== Further Reading ==
== Further Reading ==
# [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp IBM pSeries and AIX Information Center]
# [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp IBM pSeries and AIX Information Center]
# [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/removing_devices.html Removing a Storage Device]
# [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/removing_devices.html Red Hat Removing a Storage Device]


[[Category:AIX]]
[[Category:AIX]]
[[Category:Linux]]
[[Category:Linux]]

Revision as of 15:12, 17 November 2014

AIX

Removal of a Physical Volume

  1. # diag
  2. Select: Task Selection
  3. Select: Hot Plug Task
  4. Select: SCSI and SCSI Raid Hot Plug Manager
  5. Select: Replace/Remove a Device Attached to an SCSI Hot Swap Enclosure Device
  6. Select: Slot # of the physical volume you wish to remove.
  7. Follow the on-screen instructions to complete removal.

Linux

Removal of a Physical Volume from LVM

  1. Removing a physical volume from a volume group:
    1. Ensure the physical volume is not being used:
      1. # pvdisplay /dev/XXX#
    2. If physical volume contains any logical volumes, you will need to migrate the data off of the physical volume:
      1. # pvmove /dev/XXX#
    3. If physical volume is empty remove it from the volume group:
      1. # vgreduce GGGG /dev/XXX#
    4. Remove the physical volume from LVM:
      1. # pvremove /dev/XXX#

Removal of the Physical Volume from the System

  1. Ensure all users are closed out of the device.
  2. If the device is multipathed, note the multipath configuration for the device.
    1. # multipath -l
  3. Flush the I/O of the device.
    1. # blockdev --flushbufs /dev/<device>
  4. Remove any references to the device from /dev/disk/by-id.
  5. Remove any references to the device from /dev/disk/by-path.
  6. Remove any references to the device from /dev/disk/by-uuid.
  7. Delete the device.
    1. # rm /dev/<device>
  8. Remove the device from the SCSI Subsystem.
    1. # echo 1 > /sys/block/<device>/device/delete
  9. If the device is multipathed remove the configuration for the device.
    1. # multipath -f <mpath>

Further Reading

  1. IBM pSeries and AIX Information Center
  2. Red Hat Removing a Storage Device