device mappings for partitions not removed after build using --raw, leading to filesystem corruption
SRU Request for Lucid
[Impact] This bug occurs systematically when the --raw option is used to create a VM. This results in file system data corruption messages in the VM created.
[Development/Stable Fix] Fixed in 0.12.4+
[ Louis Bouchard ]
* Remove dev maps created by parted. (LP: #531599)
[Test Case] section with detailed instructions how to reproduce the bug. These should allow someone who is not familiar with the affected package to reproduce the bug and verify that the updated package fixes the problem.
On an unmodified system with an existging 8Gb LVM volume named /dev/sysvg/
ubuntu-vm-builder kvm natty --lang=en_US --hostname=testvm --rootsize=8000 --mem=10240 --cpus=2 --rootpass=X --arch=amd64 --libvirt=
On an unmodified system, once completed, the dmsetup list command will show the following :
$ dmsetup ls
sysvg-testvmvol1p1 (252, 2)
sysvg-testvmvol1 (252, 1)
sysvg-testvmvol (252, 0)
The sysvg-testvmvol1p1 table should not be there
[Regression Potential] This fix needs to be backported to the LTS version to avoid potential file system corruption.
I've tried to install a vm using an LVM logical volume with --raw. The problem was that I used a too small logical volume.
vmbuilder told me:
2010-03-03 21:33:59,923 INFO : Adding partition table to disk image: /dev/mapper/
2010-03-03 21:34:00,007 INFO : Adding type 1 partition to disk image: /dev/mapper/
2010-03-03 21:34:00,879 INFO : Adding type 3 partition to disk image: /dev/mapper/
2010-03-03 21:34:00,890 INFO :  ../../libparted
2010-03-03 21:34:00,892 INFO : Cleaning up
Traceback (most recent call last):
raise VMBuilderException, "Process (%s) returned %d. stdout: %s, stderr: %s" % (args.__repr__(), status, stdout, stderr)
, stderr:  ../../libparted
While this is a lot of noise, telling me 'location 1032 is outside of the device...' made me recognize my mistake.
The problem is that I wasn't able to just remove the logical volume, create a bigger one and start again:
sudo lvremove /dev/mapper/
Can't remove open logical volume "test-disk"
The reason is that there's another device map set up by vmbuilder: /dev/mapper/
This is because the first (root) partition did fit on the logical volume, but only the second (swap) one not.
I had to drop the device mapping using
sudo dmsetup remove /dev/mapper/
This would allow me to lvremove the logical volume now.
I would expect that vmbuilder cleans up on exceptions like this and remove the device mappings for the inner partitions.
- Serge Hallyn: Resubmit on 2011-12-22
- Scott Moser: Pending requested 2011-12-21
- Diff: 6519 lines (+6029/-0) 91 files modified (has conflicts)
|Soren Hansen (soren) wrote : Re: [Bug 531599] [NEW] tricky leftovers when using a too small --raw device||#1|
|Changed in vm-builder (Ubuntu):|
|status:||Incomplete → Confirmed|
|no longer affects:||vmbuilder|