These observations are from CentOS 6.3, 6.4 and 6.5. I have a multipath device with a single partition:
# ls -l /dev/mapper/
total 0
crw-rw---- 1 admin root 10, 57 Dec 22 12:52 control
lrwxrwxrwx 1 admin root 7 Dec 24 12:22 mpatha -> ../dm-0
lrwxrwxrwx 1 admin root 7 Dec 24 12:22 mpathap1 -> ../dm-1
# kpartx -l /dev/mapper/mpatha
mpatha1 : 0 5368719293 /dev/mapper/mpatha 34
Then, parted is used to remove the partition:
# parted /dev/mapper/mpatha
GNU Parted 1.7.1
Using /dev/dm-0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit GB
(parted) p
Disk /dev/dm-0: 2749GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 0.00GB 2749GB 2749GB ext3 primary
(parted) rm 1
(parted) q
Information: Don't forget to update /etc/fstab, if necessary.
However, the device special file /dev/mapper/mpathap1
does not get automatically removed. Running ls -l /dev/mapper/
produces exactly the same output as shown above, while kpartx -l /dev/mapper/mpatha
, exits normally ($? = 0) without printing anything.
My question is related to this one. However, there the issue was with no device special file being created in /dev/
while mine is about removal and that too on multipath devices. I am doing certain operations in a script and have already instrumented checks on whether expected device files actually get created or removed and if not then I call kpartx -a -p p <device>
(took that hint from /lib/udev/rules.d/40-multipath.rules
) or kpartx -d <device>
as the case may be. But I have not yet had a satisfying understanding.
When in general, creating partitions on an extra local disk or a portable hard disk using parted works perfectly fine why should anything more be required to be done on disks coming from a SAN? Any information will be appreciated. Thanks!