Comment 3 for bug 583530

Revision history for this message
GeekSmith (lixo-geeksmith) wrote :

I'm seeing this any time vmbuilder fails. If it fails more than a few times, I run out of loopback devices and can't build anything more. Here are the loopback devices it leaves for a VM with two hard disks:

I'm able to clean up the loopback devices manually, but it's quite a pain:
aaron.smith@asmith ~/dvp/vm % sudo losetup -a
/dev/loop0: [0801]:678634 (/tmp/tmpZjs7XP)
/dev/loop1: [0801]:678638 (/tmp/tmpFfS6q9)
aaron.smith@asmith ~/dvp/vm % sudo losetup -d /dev/loop0
loop: can't delete device /dev/loop0: Device or resource busy
aaron.smith@asmith ~/dvp/vm % sudo kpartx -d /dev/loop0
aaron.smith@asmith ~/dvp/vm % sudo losetup -d /dev/loop0
aaron.smith@asmith ~/dvp/vm % sudo losetup -a
/dev/loop1: [0801]:678638 (/tmp/tmpFfS6q9)

-- OK, one down. The last one is a litte more painful:
aaron.smith@asmith ~/dvp/vm % sudo dmsetup table
loop1p1: 0 15622984 linear 7:1 63
aaron.smith@asmith ~/dvp/vm % sudo kpartx -dv /dev/mapper/loop1p1
aaron.smith@asmith ~/dvp/vm % sudo losetup -d /dev/mapper/loop1p1
aaron.smith@asmith ~/dvp/vm % sudo losetup -a
aaron.smith@asmith ~/dvp/vm %

If a person is trying to automate creation of a VM in a build process, this becomes burdensome.