ISST_SAN:ls -l /dev/mapper/mpath output showing the deleted partitions even after the removal of partitions

Bug #1427333 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devmapper (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

== Comment: #0 - LEKSHMI C. PILLAI <email address hidden> - 2015-02-25 04:10:23 ==
Hi

On one of my Ubuntu 15.04 guest I was deleting partitions using fdisk.distrib command. Its deleting successfully,but ls -l /dev/mapper/ is still shoiwng the entry

After creation of 3 partitions on /dev/mapper/mpath30,o/p of
1)fdisk.distrib -l 2)kpartx 3)ls -l

1)root@zap06:/dev/mapper# fdisk.distrib -l /dev/mapper/mpath30-------------

Disk /dev/mapper/mpath30: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xeb2e9efb

Device Boot Start End Sectors Size Id Type
/dev/mapper/mpath30p1 2048 6293503 6291456 3G 83 Linux
/dev/mapper/mpath30p2 6293504 14682111 8388608 4G 83 Linux
/dev/mapper/mpath30p3 14682112 31457279 16775168 8G 83 Linux

2)root@zap06:/dev/mapper# kpartx -r /dev/mapper/mpath30----------------
mpath30p1 : 0 6291456 /dev/mapper/mpath30 2048
mpath30p2 : 0 8388608 /dev/mapper/mpath30 6293504
mpath30p3 : 0 16775168 /dev/mapper/mpath30 14682112
3)root@zap06:/dev/mapper# ls -l /dev/mapper/mpath30*
lrwxrwxrwx 1 root root 7 Feb 25 02:07 /dev/mapper/mpath30 -> ../dm-8
brw-rw---- 1 root disk 252, 70 Feb 25 02:04 /dev/mapper/mpath30-part1
brw-rw---- 1 root disk 252, 71 Feb 25 02:04 /dev/mapper/mpath30-part2
brw-rw---- 1 root disk 252, 72 Feb 25 02:04 /dev/mapper/mpath30-part3

After Deletion of 3rd partition,o/p from each of these

root@zap06:/dev/mapper# kpartx -r /dev/mapper/mpath30
mpath30p1 : 0 6291456 /dev/mapper/mpath30 2048
mpath30p2 : 0 8388608 /dev/mapper/mpath30 6293504
root@zap06:/dev/mapper# ls -l /dev/mapper/mpath30*
lrwxrwxrwx 1 root root 7 Feb 25 02:07 /dev/mapper/mpath30 -> ../dm-8
brw-rw---- 1 root disk 252, 70 Feb 25 02:04 /dev/mapper/mpath30-part1
brw-rw---- 1 root disk 252, 71 Feb 25 02:04 /dev/mapper/mpath30-part2
brw-rw---- 1 root disk 252, 72 Feb 25 02:04 /dev/mapper/mpath30-part3------>
root@zap06:/dev/mapper# fdisk.distrib -l /dev/mapper/mpath30

Disk /dev/mapper/mpath30: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xeb2e9efb

Device Boot Start End Sectors Size Id Type
/dev/mapper/mpath30p1 2048 6293503 6291456 3G 83 Linux
/dev/mapper/mpath30p2 6293504 14682111 8388608 4G 83 Linux

So I rebooted the machine
After reboot

root@zap06:/dev/mapper# kpartx -r /dev/mapper/mpath30
mpath30p1 : 0 6291456 /dev/mapper/mpath30 2048
mpath30p2 : 0 8388608 /dev/mapper/mpath30 6293504
root@zap06:/dev/mapper# ls -l /dev/mapper/mpath30*
lrwxrwxrwx 1 root root 8 Feb 25 08:22 /dev/mapper/mpath30 -> ../dm-13
brw-rw---- 1 root disk 252, 16 Feb 25 08:22 /dev/mapper/mpath30-part1
brw-rw---- 1 root disk 252, 17 Feb 25 08:22 /dev/mapper/mpath30-part2
root@zap06:/dev/mapper#

Again I created 2 more partitions on mpath30

These are the o/ps from kpartx,fdisk.distrib and ls -l
root@zap06:/dev/mapper# ls -l /dev/mapper/mpath30*
lrwxrwxrwx 1 root root 8 Feb 25 08:29 /dev/mapper/mpath30 -> ../dm-13
brw-rw---- 1 root disk 252, 16 Feb 25 08:22 /dev/mapper/mpath30-part1
brw-rw---- 1 root disk 252, 17 Feb 25 08:22 /dev/mapper/mpath30-part2
brw-rw---- 1 root disk 252, 69 Feb 25 08:29 /dev/mapper/mpath30-part3
brw-rw---- 1 root disk 252, 70 Feb 25 08:29 /dev/mapper/mpath30-part4
root@zap06:/dev/mapper# kpartx -r /dev/mapper/mpath30
mpath30p1 : 0 6291456 /dev/mapper/mpath30 2048
mpath30p2 : 0 8388608 /dev/mapper/mpath30 6293504
mpath30p3 : 0 4194304 /dev/mapper/mpath30 14682112
mpath30p4 : 0 12580864 /dev/mapper/mpath30 18876416
root@zap06:/dev/mapper# fdisk.distrib -l /dev/mapper/mpath30

Disk /dev/mapper/mpath30: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xeb2e9efb

Device Boot Start End Sectors Size Id Type
/dev/mapper/mpath30p1 2048 6293503 6291456 3G 83 Linux
/dev/mapper/mpath30p2 6293504 14682111 8388608 4G 83 Linux
/dev/mapper/mpath30p3 14682112 18876415 4194304 2G 83 Linux
/dev/mapper/mpath30p4 18876416 31457279 12580864 6G 83 Linux

root@zap06:/dev/mapper#

Now tried deletion of 4th and 3rd partitions

O/p of each command after dletion

root@zap06:/dev/mapper# fdisk.distrib -l /dev/mapper/mpath30

Disk /dev/mapper/mpath30: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xeb2e9efb

Device Boot Start End Sectors Size Id Type
/dev/mapper/mpath30p1 2048 6293503 6291456 3G 83 Linux
/dev/mapper/mpath30p2 6293504 14682111 8388608 4G 83 Linux

root@zap06:/dev/mapper# kpartx -r /dev/mapper/mpath30
mpath30p1 : 0 6291456 /dev/mapper/mpath30 2048
mpath30p2 : 0 8388608 /dev/mapper/mpath30 6293504
root@zap06:/dev/mapper# ls -l /dev/mapper/mpath30*
lrwxrwxrwx 1 root root 8 Feb 25 08:31 /dev/mapper/mpath30 -> ../dm-13
brw-rw---- 1 root disk 252, 16 Feb 25 08:22 /dev/mapper/mpath30-part1
brw-rw---- 1 root disk 252, 17 Feb 25 08:22 /dev/mapper/mpath30-part2
brw-rw---- 1 root disk 252, 69 Feb 25 08:29 /dev/mapper/mpath30-part3------>
brw-rw---- 1 root disk 252, 70 Feb 25 08:29 /dev/mapper/mpath30-part4------>
root@zap06:/dev/mapper#

And I tried creating filesystem on the dleeted partition.Its successfully created FS and i mounted it.I am totally confused with which is correct o/p and which is wrong?

root@zap06:/dev/mapper# mkfs.ext3 mpath30-part4
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done
Creating filesystem with 1572608 4k blocks and 393216 inodes
Filesystem UUID: 6fd9febb-1fc6-4816-96f4-a14d63f91f54
Superblock backups stored on blocks:
 32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

root@zap06:/dev/mapper#
root@zap06:/dev/mapper# mkdir /M304
root@zap06:/dev/mapper# kpartx -r /dev/mapper/mpath30
mpath30p1 : 0 6291456 /dev/mapper/mpath30 2048
mpath30p2 : 0 8388608 /dev/mapper/mpath30 6293504
root@zap06:/dev/mapper# fdisk.distrib -l /dev/mapper/mpath30

Disk /dev/mapper/mpath30: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xeb2e9efb

Device Boot Start End Sectors Size Id Type
/dev/mapper/mpath30p1 2048 6293503 6291456 3G 83 Linux
/dev/mapper/mpath30p2 6293504 14682111 8388608 4G 83 Linux

root@zap06:/dev/mapper# mount /dev/mapper/mpath30-part4 /M304
root@zap06:/dev/mapper# echo $?
0
root@zap06:/dev/mapper# mount
/dev/sdp2 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,nodev,noexec,nosuid)
sysfs on /sys type sysfs (rw,nodev,noexec,nosuid)
none on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755,size=1024)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,nodev,noexec,nosuid,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,nodev,noexec,nosuid,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
cgmfs on /run/cgmanager/fs type tmpfs (rw,relatime,size=128k,mode=755)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw)
kte:/data on /data type nfs (rw,soft,nolock,vers=4,addr=10.33.11.31,clientaddr=9.3.123.72)
kte:/kte on /kte type nfs (rw,soft,nolock,vers=4,addr=10.33.11.31,clientaddr=9.3.123.72)
kte:/images on /images type nfs (rw,soft,nolock,vers=4,addr=10.33.11.31,clientaddr=9.3.123.72)
kte:/distros on /distros type nfs (rw,soft,nolock,vers=4,addr=10.33.11.31,clientaddr=9.3.123.72)
/dev/mapper/mpath30-part4 on /M304 type ext3 (rw)-------------------------FS mounted
root@zap06:/dev/mapper#
o/P

So after deletion while other tets are running,its difficult to reboot everytime system.Also the outputs are misleading

Thanks
Lekshmi

== Comment: #2 - David Heller <email address hidden> - 2015-02-25 15:36:26 ==
I'm not sure how it got into this state but yes, it does look like some device nodes were not cleaned up after the partitions were deleted. Currently the PT is empty:

root@zap06:~# kpartx -l /dev/mapper/mpath30

root@zap06:~# parted /dev/mapper/mpath30 print
Model: Linux device-mapper (multipath) (dm)
Disk /dev/mapper/mpath30: 16.1GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags

But there are some device nodes hanging around, and they seem to be holding the minor numbers corresponding to the deleted partitions:

root@zap06:~# ll /dev/mapper/mpath30*
lrwxrwxrwx 1 root root 8 Feb 25 19:52 /dev/mapper/mpath30 -> ../dm-13
brw-rw---- 1 root disk 252, 16 Feb 25 08:22 /dev/mapper/mpath30-part1
brw-rw---- 1 root disk 252, 17 Feb 25 08:22 /dev/mapper/mpath30-part2
brw-rw---- 1 root disk 252, 69 Feb 25 08:29 /dev/mapper/mpath30-part3
brw-rw---- 1 root disk 252, 70 Feb 25 08:52 /dev/mapper/mpath30-part4

root@zap06:~# ll /dev/disk/by-id/*mpath30*
lrwxrwxrwx 1 root root 11 Feb 25 19:52 /dev/disk/by-id/dm-name-mpath30 -> ../../dm-13
lrwxrwxrwx 1 root root 11 Feb 25 11:02 /dev/disk/by-id/dm-name-mpath30-part1 -> ../../dm-16
lrwxrwxrwx 1 root root 11 Feb 25 11:02 /dev/disk/by-id/dm-name-mpath30-part2 -> ../../dm-17
lrwxrwxrwx 1 root root 11 Feb 25 08:29 /dev/disk/by-id/dm-name-mpath30-part3 -> ../../dm-69
lrwxrwxrwx 1 root root 11 Feb 25 08:29 /dev/disk/by-id/dm-name-mpath30-part4 -> ../../dm-70
lrwxrwxrwx 1 root root 11 Feb 25 19:52 /dev/disk/by-id/raid-mpath30 -> ../../dm-13
lrwxrwxrwx 1 root root 11 Feb 25 11:02 /dev/disk/by-id/raid-mpath30-part1-part1 -> ../../dm-16
lrwxrwxrwx 1 root root 11 Feb 25 11:02 /dev/disk/by-id/raid-mpath30-part2-part2 -> ../../dm-17
lrwxrwxrwx 1 root root 11 Feb 25 08:29 /dev/disk/by-id/raid-mpath30-part3-part3 -> ../../dm-69
lrwxrwxrwx 1 root root 11 Feb 25 08:29 /dev/disk/by-id/raid-mpath30-part4-part4 -> ../../dm-70

root@zap06:~# ll /dev/dm-* | egrep "13|16|69|70"
brw-rw---- 1 root disk 252, 13 Feb 25 19:52 /dev/dm-13
brw-rw---- 1 root disk 252, 16 Feb 25 11:02 /dev/dm-16
brw-rw---- 1 root disk 252, 69 Feb 25 08:29 /dev/dm-69
brw-rw---- 1 root disk 252, 70 Feb 25 08:29 /dev/dm-70

Running partprobe should fix this, but it doesn't. Running with strace sheds a little light (full output attached):

root@zap06:~# strace partprobe /dev/mapper/mpath30
execve("/sbin/partprobe", ["partprobe", "/dev/mapper/mpath30"], [/* 37 vars */]) = 0
brk(0) = 0x10009930000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
...
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
statfs("/sys/fs/selinux", 0x3fffc2e8fe70) = -1 ENOENT (No such file or directory)
statfs("/selinux", 0x3fffc2e8fe70) = -1 ENOENT (No such file or directory)
brk(0) = 0x10009930000
brk(0x10009960000) = 0x10009960000
open("/proc/filesystems", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fff788f0000
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tr"..., 1024) = 337
read(3, "", 1024) = 0
close(3) = 0
munmap(0x3fff788f0000, 4096) = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2919792, ...}) = 0
mmap(NULL, 2919792, PROT_READ, MAP_PRIVATE, 3, 0) = 0x3fff781b0000
close(3) = 0
semctl(0, 0, SEM_INFO, 0x3fffc2e8f878) = 0
open("/etc/udev/udev.conf", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=153, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fff788f0000
read(3, "# see udev.conf(5) for details\n#"..., 4096) = 153
read(3, "", 4096) = 0
close(3) = 0
munmap(0x3fff788f0000, 4096) = 0
access("/run/udev/control", F_OK) = 0
stat("/dev/mapper/mpath30", {st_mode=S_IFBLK|0660, st_rdev=makedev(252, 13), ...}) = 0
open("/proc/devices", O_RDONLY) = 3
read(3, "Character devices:\n 1 mem\n 4 /"..., 16384) = 469
read(3, "", 16384) = 0
close(3) = 0
uname({sys="Linux", node="zap06", ...}) = 0
stat("/dev/mapper/control", {st_mode=S_IFCHR|0600, st_rdev=makedev(10, 236), ...}) = 0
open("/dev/mapper/control", O_RDWR) = 3
open("/proc/devices", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fff788f0000
read(4, "Character devices:\n 1 mem\n 4 /"..., 1024) = 469
close(4) = 0
munmap(0x3fff788f0000, 4096) = 0
ioctl(3, DM_VERSION, 0x10009931350) = 0
ioctl(3, DM_TABLE_STATUS, 0x10009931280) = 0
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fff788f0000
read(4, "# Locale name alias data base.\n#"..., 4096) = 2570
read(4, "", 4096) = 0
close(4) = 0
munmap(0x3fff788f0000, 4096) = 0
...
stat("/dev/mapper/mpath30", {st_mode=S_IFBLK|0660, st_rdev=makedev(252, 13), ...}) = 0
open("/dev/mapper/mpath30", O_RDWR) = 4
ioctl(4, BLKFLSBUF, 0x3fffc2e8f8c8) = 0
ioctl(3, DM_DEV_STATUS, 0x10009935330) = 0
stat("/dev/mapper/mpath30p1", 0x3fffc2e8f1e8) = -1 ENOENT (No such file or directory)
open("/dev/mapper/mpath30p1", O_WRONLY) = -1 ENOENT (No such file or directory)
ioctl(3, DM_DEV_STATUS, 0x10009935330) = 0
stat("/dev/mapper/mpath30p2", 0x3fffc2e8f1e8) = -1 ENOENT (No such file or directory)
open("/dev/mapper/mpath30p2", O_WRONLY) = -1 ENOENT (No such file or directory)
ioctl(3, DM_DEV_STATUS, 0x10009935330) = 0
stat("/dev/mapper/mpath30p3", 0x3fffc2e8f1e8) = -1 ENOENT (No such file or directory)
open("/dev/mapper/mpath30p3", O_WRONLY) = -1 ENOENT (No such file or directory)
...
ioctl(3, DM_DEV_STATUS, 0x10009935330) = 0
stat("/dev/mapper/mpath30p63", 0x3fffc2e8f1e8) = -1 ENOENT (No such file or directory)
open("/dev/mapper/mpath30p63", O_WRONLY) = -1 ENOENT (No such file or directory)
stat("/dev/mapper/mpath30", {st_mode=S_IFBLK|0660, st_rdev=makedev(252, 13), ...}) = 0
uname({sys="Linux", node="zap06", ...}) = 0
ioctl(4, BLKSSZGET, 512) = 0
fadvise64(4, 0, 0, POSIX_FADV_RANDOM) = 0
fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(252, 13), ...}) = 0
uname({sys="Linux", node="zap06", ...}) = 0
ioctl(4, BLKGETSIZE64, 16106127360) = 0
open("/sys/dev/block/252:13", O_RDONLY|O_CLOEXEC) = 5
openat(5, "dm/uuid", O_RDONLY|O_CLOEXEC) = 6
fcntl(6, F_GETFL) = 0x10000 (flags O_RDONLY|0x10000)
fstat(6, {st_mode=S_IFREG|0444, st_size=65536, ...}) = 0
mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fff788f0000
lseek(6, 0, SEEK_CUR) = 0
read(6, "mpath-0QEMU\\x20\\x20\\x20\\x20QEMU\\"..., 65536) = 73
close(6) = 0
munmap(0x3fff788f0000, 65536) = 0
close(5) = 0
open("/sys/dev/block/252:13", O_RDONLY|O_CLOEXEC) = 5
newfstatat(5, "partition", 0x3fffc2e8e268, 0) = -1 ENOENT (No such file or directory)
openat(5, "dm/uuid", O_RDONLY|O_CLOEXEC) = 6
fcntl(6, F_GETFL) = 0x10000 (flags O_RDONLY|0x10000)
fstat(6, {st_mode=S_IFREG|0444, st_size=65536, ...}) = 0
mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fff788f0000
lseek(6, 0, SEEK_CUR) = 0
read(6, "mpath-0QEMU\\x20\\x20\\x20\\x20QEMU\\"..., 65536) = 73
close(6) = 0
munmap(0x3fff788f0000, 65536) = 0
close(5) = 0
ioctl(4, CDROM_GET_CAPABILITY or SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT, 0) = -1 EINVAL (Invalid argument)
ioctl(4, BLKALIGNOFF, 0) = 0
ioctl(4, BLKIOMIN, 512) = 0
ioctl(4, BLKIOOPT, 0) = 0
ioctl(4, BLKPBSZGET, 512) = 0
ioctl(4, BLKSSZGET, 512) = 0
ioctl(4, BLKGETSIZE64, 16106127360) = 0
ioctl(4, HDIO_GETGEO, {heads=0, sectors=0, cylinders=0, start=0}) = 0
fsync(4) = 0
close(4) = 0
open("/dev/mapper/mpath30", O_RDWR) = 4
ioctl(4, BLKFLSBUF, 0) = 0
ioctl(3, DM_DEV_STATUS, 0x10009935330) = 0
stat("/dev/mapper/mpath30p1", 0x3fffc2e8f478) = -1 ENOENT (No such file or directory)
open("/dev/mapper/mpath30p1", O_WRONLY) = -1 ENOENT (No such file or directory)
ioctl(3, DM_DEV_STATUS, 0x10009935330) = 0
stat("/dev/mapper/mpath30p2", 0x3fffc2e8f478) = -1 ENOENT (No such file or directory)
open("/dev/mapper/mpath30p2", O_WRONLY) = -1 ENOENT (No such file or directory)
...
ioctl(3, DM_DEV_STATUS, 0x10009935330) = 0
stat("/dev/mapper/mpath30p63", 0x3fffc2e8f478) = -1 ENOENT (No such file or directory)
open("/dev/mapper/mpath30p63", O_WRONLY) = -1 ENOENT (No such file or directory)
...

This looks like the naming inconsistency (mpathXpX vs. mpathX-partX) seen in other bugs. partprobe is looking for mpathXpX, which don't exist. Now, if it were looking for that *in addition to* the -partX names, these would probably be benign operations. But it does not seem to be looking for -partX names at all, looking at the full trace (attached).

Finally, here is udevadm output from the "partprobe" operation, which seems to show it operating only on the mpath30 device, and not any of the partition devices. The expectation is, it would find and delete those device nodes here:

root@zap06:~# udevadm monitor -p
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[42248.218780] change /devices/virtual/block/dm-13 (block)
ACTION=change
DEVNAME=/dev/dm-13
DEVPATH=/devices/virtual/block/dm-13
DEVTYPE=disk
MAJOR=252
MINOR=13
SEQNUM=5073
SUBSYSTEM=block

UDEV [42248.257687] change /devices/virtual/block/dm-13 (block)
ACTION=change
DEVLINKS=/dev/disk/by-id/dm-name-mpath30 /dev/disk/by-id/dm-uuid-mpath-0QEMU\x20\x20\x20\x20QEMU\x20HARDDISK\x20\x20\x20drive-scsi0-0-8-0 /dev/disk/by-id/raid-mpath30 /dev/mapper/mpath30
DEVNAME=/dev/dm-13
DEVPATH=/devices/virtual/block/dm-13
DEVTYPE=disk
DM_NAME=mpath30
DM_STATE=ACTIVE
DM_SUSPENDED=0
DM_TABLE_STATE=LIVE
DM_TYPE=raid
DM_UDEV_PRIMARY_SOURCE_FLAG=1
DM_UDEV_RULES=1
DM_UUID=mpath-0QEMU QEMU HARDDISK drive-scsi0-0-8-0
ID_PART_TABLE_TYPE=dos
ID_PART_TABLE_UUID=b4a0cad2
MAJOR=252
MINOR=13
SEQNUM=5073
SUBSYSTEM=block
USEC_INITIALIZED=17066
nomdmonddf=1
nomdmonisw=1

KERNEL[42248.272300] change /devices/virtual/block/dm-13 (block)
ACTION=change
DEVNAME=/dev/dm-13
DEVPATH=/devices/virtual/block/dm-13
DEVTYPE=disk
MAJOR=252
MINOR=13
SEQNUM=5074
SUBSYSTEM=block

UDEV [42248.297519] change /devices/virtual/block/dm-13 (block)
ACTION=change
DEVLINKS=/dev/disk/by-id/dm-name-mpath30 /dev/disk/by-id/dm-uuid-mpath-0QEMU\x20\x20\x20\x20QEMU\x20HARDDISK\x20\x20\x20drive-scsi0-0-8-0 /dev/disk/by-id/raid-mpath30 /dev/mapper/mpath30
DEVNAME=/dev/dm-13
DEVPATH=/devices/virtual/block/dm-13
DEVTYPE=disk
DM_NAME=mpath30
DM_STATE=ACTIVE
DM_SUSPENDED=0
DM_TABLE_STATE=LIVE
DM_TYPE=raid
DM_UDEV_PRIMARY_SOURCE_FLAG=1
DM_UDEV_RULES=1
DM_UUID=mpath-0QEMU QEMU HARDDISK drive-scsi0-0-8-0
ID_PART_TABLE_TYPE=dos
ID_PART_TABLE_UUID=b4a0cad2
MAJOR=252
MINOR=13
SEQNUM=5074
SUBSYSTEM=block
USEC_INITIALIZED=17066
nomdmonddf=1
nomdmonisw=1

Revision history for this message
bugproxy (bugproxy) wrote : Full strace output from partprobe

Default Comment by Bridge

tags: added: architecture-ppc64le bugnameltc-122053 severity-critical targetmilestone-inin---
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1427333/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
bugproxy (bugproxy)
tags: added: targetmilestone-inin1504
removed: targetmilestone-inin---
Dave Heller (hellerda)
affects: ubuntu → udev (Ubuntu)
Martin Pitt (pitti)
affects: udev (Ubuntu) → devmapper (Ubuntu)
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

@pitti,

I believe the following clarifies things, but it'd be better to get an opinion from someone who knows better of multipath than I do.

>>

Hi Lekshmi,

Unfortunately, this is the way it works with multipath devices. Not a bug.
The changes to the partition table are not automatically reflected in /dev/mapper.

You must request/inform the OS/kernel of such changes.

You can do this in 2 ways:
1) kpartx
2) partprobe

For 1) kpartx,
$ sudo kpartx -d -p -part /dev/mapper/mpathX
$ sudo kpartx -a -p -part /dev/mapper/mpathX

See the kpartx manpage for more details [1] (man kpartx).

For 2) partprobe

David is correct on the assumption about mpathXpY and mpathX-partY.
partprobe is based on parted, which hardcodes the 'p' partition separator for device-mapper based devices (e.g., multipath).
So, it will try with the sys/function calls with 'p' disk-partition separator, but won't find any device, because the '-part' one is used.

I'll check whether the partprobe code may get a patch easily, but if I'm not mistaken, it will boil down to their very general functions of device-mapper on linux, which hard-codes p.
(so it's not just 'try p and -part'). Hopefully I may be wrong; will check..

In short, please use kpartx. It's how it's done.
If you can make that work in any other distro, I'd be glad to know and check what's done.

Best regards

[1] http://manpages.ubuntu.com/manpages/trusty/man8/kpartx.8.html

Luciano Chavez (lnx1138)
Changed in devmapper (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.