How to delete partition created on device-mapper multipath device?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 6
  • device-mapper-multipath

Issue

  • Need to delete partition created on top of device-mapper-multipath device.

Resolution

  1. Verify no application or processes using this device with lsof. Also, if there is any important data present on the partition, then please make sure to take a backup of data before deleting partition using following steps:

  2. Delete partition mappings.

# kpartx -d -v <mpath name>
example:
# kpartx -d -v /dev/mapper/mpathb
  1. Delete partition created on top of mpath device
# fdisk /dev/mapper/mpathb
d - delete partition <select the partition>
w - save the changes
  1. Verify partition has been deleted using fdisk -l.
# fdisk /dev/mapper/mpathb -l
# dmsetup info -C | grep mpathb
SBR
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.