LVM Remove a Physical Volume: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 10: | Line 10: | ||
== Linux == | == Linux == | ||
=== Removal of a Physical Volume === | === Removal of a Physical Volume from LVM === | ||
# Removing a physical volume from a volume group: | # Removing a physical volume from a volume group: | ||
## Ensure the physical volume is not being used: | ## Ensure the physical volume is not being used: | ||
Line 20: | Line 20: | ||
## Remove the physical volume from LVM: | ## Remove the physical volume from LVM: | ||
### <tt>'''# pvremove /dev/XXX#'''</tt> | ### <tt>'''# pvremove /dev/XXX#'''</tt> | ||
=== Removal of the Physical Volume from the System === | |||
# Ensure all users are closed out of the device. | |||
# If the device is multipathed, note the multipath configuration for the device. | |||
## <tt>'''# multipath -l'''</tt> | |||
# Flush the I/O of the device. | |||
## <tt>'''# blockdev --flushbufs /dev/<device>'''</tt> | |||
# Remove any references to the device from <tt>'''/dev/disk/by-id'''</tt>. | |||
# Remove any references to the device from <tt>'''/dev/disk/by-path'''</tt>. | |||
# Remove any references to the device from <tt>'''/dev/disk/by-uuid'''</tt>. | |||
# Delete the device. | |||
## <tt>'''# rm /dev/<device>'''</tt> | |||
# Remove the device from the SCSI Subsystem. | |||
## <tt>'''# echo 1 > /sys/block/<device>/device/delete'''</tt> | |||
# If the device is multipathed remove the configuration for the device. | |||
## <tt>'''# multipath -f <mpath>'''</tt> | |||
== Further Reading == | == Further Reading == |
Revision as of 14:56, 17 November 2014
AIX
Removal of a Physical Volume
- # diag
- Select: Task Selection
- Select: Hot Plug Task
- Select: SCSI and SCSI Raid Hot Plug Manager
- Select: Replace/Remove a Device Attached to an SCSI Hot Swap Enclosure Device
- Select: Slot # of the physical volume you wish to remove.
- Follow the on-screen instructions to complete removal.
Linux
Removal of a Physical Volume from LVM
- Removing a physical volume from a volume group:
- Ensure the physical volume is not being used:
- # pvdisplay /dev/XXX#
- If physical volume contains any logical volumes, you will need to migrate the data off of the physical volume:
- # pvmove /dev/XXX#
- If physical volume is empty remove it from the volume group:
- # vgreduce GGGG /dev/XXX#
- Remove the physical volume from LVM:
- # pvremove /dev/XXX#
- Ensure the physical volume is not being used:
Removal of the Physical Volume from the System
- Ensure all users are closed out of the device.
- If the device is multipathed, note the multipath configuration for the device.
- # multipath -l
- Flush the I/O of the device.
- # blockdev --flushbufs /dev/<device>
- Remove any references to the device from /dev/disk/by-id.
- Remove any references to the device from /dev/disk/by-path.
- Remove any references to the device from /dev/disk/by-uuid.
- Delete the device.
- # rm /dev/<device>
- Remove the device from the SCSI Subsystem.
- # echo 1 > /sys/block/<device>/device/delete
- If the device is multipathed remove the configuration for the device.
- # multipath -f <mpath>