kpartx 0.7.4-2ubuntu1 in bionic does not remove loop devices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
multipath-tools (Ubuntu) |
Fix Released
|
Critical
|
Julian Andres Klode |
Bug Description
We're seeing a problem now when running livecd-rootfs in bionic with kpartx from 0.7.4-2ubuntu1. The issue appears to be the result in a change in kpartx, as a result, the /dev/loop devices are not getting deleted. The best data I have from this so far is a comparison between old and current build logs. The old logs showed:
++ kpartx -v -d binary/
+ kpartx_stdout='del devmap : loop0p15
del devmap : loop0p14
del devmap : loop0p1
loop deleted : /dev/loop0'
+ echo 'del devmap : loop0p15
del devmap : loop0p14
del devmap : loop0p1
loop deleted : /dev/loop0'
Thew new logs show:
++ kpartx -v -d binary/
+ kpartx_stdout=
+ echo ''
The code being run is from the 'functions' in lp:livecd-rootfs. In the current runs, kpartx_stdout is an empty string:
clean_loops() {
local kpartx_ret
local kpartx_stdout
if [ -n "${backing_img}" ]; then
# sync before removing loop to avoid "Device or resource busy" errors
sync
echo "$kpartx_stdout"
if [ -n "$kpartx_ret" ]; then
if echo "$kpartx_stdout" | grep -q "loop deleted"; then
else
fi
fi
unset backing_img
fi
if [ -z "${rootfs_
return 0
fi
unset loop_device
unset loop_raw
unset rootfs_dev_mapper
}
I am doing some further debugging on this and am trying to reproduce this outside of launchpad. I am not able to post a full build log. But I can probably post a longer 'sanitized' bit.
summary: |
- kpartx output has changed in 0.7.4-2ubuntu1 package + kpartx 0.7.4-2ubuntu1 in bionic can't remove loop devices |
summary: |
- kpartx 0.7.4-2ubuntu1 in bionic can't remove loop devices + kpartx 0.7.4-2ubuntu1 in bionic does not remove loop devices |
description: | updated |
Changed in multipath-tools (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Critical |
assignee: | nobody → Julian Andres Klode (juliank) |
tags: | added: id-5a74d37c8d7c3685c37e0584 |
tags: | added: id-5a73df16c347ab07bfffa3d7 |
I have a more concise method for showing this problem. When I try to mount the partitions in an img file with kpartx 0.7.4-2ubuntu1, it silently fails:
# First, fetch an image /cloud- images. ubuntu. com/bionic/ 20180124/ bionic- server- cloudimg- amd64.img server- cloudimg- amd64.img server- cloudimg- amd64.img
$ wget https:/
...
$ sudo kpartx -v -l bionic-
loop deleted : /dev/loop0
$ sudo kpartx -v -s -a bionic-
$ ll /dev/mapper/
total 0
drwxr-xr-x 2 root root 60 Feb 2 20:03 ./
drwxr-xr-x 16 root root 3580 Feb 2 20:03 ../
crw------- 1 root root 10, 236 Feb 2 20:03 control
The same works with 0.6.4-5ubuntu1 (and it can even delete the loop device):
$ sudo kpartx -v -l bionic- server- cloudimg- amd64.img server- cloudimg- amd64.img
loop0p1 : 0 598525 /dev/loop0 3
loop deleted : /dev/loop0
$ sudo kpartx -v -s -a bionic-
add map loop0p1 (253:0): 0 598525 linear 7:0 3
$ ll /dev/mapper
total 0
drwxr-xr-x 2 root root 80 Feb 2 20:08 ./
drwxr-xr-x 16 root root 3600 Feb 2 20:08 ../
crw------- 1 root root 10, 236 Feb 2 20:04 control
lrwxrwxrwx 1 root root 7 Feb 2 20:08 loop0p1 -> ../dm-0
$ sudo kpartx -v -d bionic- server- cloudimg- amd64.img
del devmap : loop0p1
loop deleted : /dev/loop0
$ ll /dev/mapper
total 0
drwxr-xr-x 2 root root 60 Feb 2 20:13 ./
drwxr-xr-x 16 root root 3580 Feb 2 20:13 ../
crw------- 1 root root 10, 236 Feb 2 20:04 control