LVM Remove a Physical Volume: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 6: | Line 6: | ||
# Select: <tt>'''SCSI and SCSI Raid Hot Plug Manager'''</tt> | # Select: <tt>'''SCSI and SCSI Raid Hot Plug Manager'''</tt> | ||
# Select: <tt>'''Replace/Remove a Device Attached to an SCSI Hot Swap Enclosure Device'''</tt> | # Select: <tt>'''Replace/Remove a Device Attached to an SCSI Hot Swap Enclosure Device'''</tt> | ||
# Select: <tt>'''Slot #'''</tt> of the physical volume you wish to remove | # Select: <tt>'''Slot #'''</tt> of the physical volume you wish to remove | ||
# Follow the on-screen instructions to complete removal | # Follow the on-screen instructions to complete removal | ||
== Linux == | == Linux == | ||
Line 17: | Line 17: | ||
# If physical volume is empty remove it from the volume group | # If physical volume is empty remove it from the volume group | ||
#: <tt>'''# vgreduce <volume_group> /dev/<physical_volume#>'''</tt> | #: <tt>'''# vgreduce <volume_group> /dev/<physical_volume#>'''</tt> | ||
# Remove the physical volume from LVM | # Remove the physical volume from LVM | ||
#: <tt>'''# pvremove /dev/<physical_volume#>'''</tt> | #: <tt>'''# pvremove /dev/<physical_volume#>'''</tt> | ||
Revision as of 18:55, 1 March 2017
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
- Ensure the physical volume is not being used
- # pvdisplay /dev/<physical_volume#>
- If physical volume contains any logical volumes, you will need to migrate the data off of the physical volume
- # pvmove /dev/<physical_volume#>
- If physical volume is empty remove it from the volume group
- # vgreduce <volume_group> /dev/<physical_volume#>
- Remove the physical volume from LVM
- # pvremove /dev/<physical_volume#>
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>