Bug#659762: lvm2: LVM commands freeze after snapshot delete fails

Nikola Kotur nikola at kotur.org
Wed Mar 13 22:48:20 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This was almost a show-stopper for me.

If you want use LVM snapshots until this bug is fixed, there are only
two options.

1) Low level logical volume management

Remove the snapshot from the device mapper before actually removing it:

dmsetup remove YOUR_VG-snap1
dmsetup remove YOUR_VG-snap1-cow

Then you'll be able to lvremove it without making your server useless.
But this looks and feels dirty. Better to...

2) Use thin provisioning [1]

And get arbitrary depth of recursive snapshots for free :)

Seriously, this bug does not exist if you use thin provisioning. Try
this (if your kernel supports it):

Create thin pool first:

lvcreate --size 300M --type thin-pool --thinpool thin_pool YOUR_VG

Create volume:

lvcreate -V4G -T YOUR_VG/thin_pool --name lv1

Then create and and remove snapshot many times:

for i in {1..200000}; do lvcreate -L4G -n snap1
- --snapshot /dev/YOUR_VG/lv1 ; lvremove -f /dev/YOUR_VG/snap1 ; done

[1] -
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/device-mapper/thin-provisioning.txt?id=refs/tags/v3.9-rc2

- -- 
Nikola Kotur

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQIcBAEBAgAGBQJRQQI4AAoJEMOSYZrYwIE7PvgQAL1hZc5iFEOjwxvSSEddKSrA
G711GTXbEdFfmgxZLkmiP6eTswIk2sbJ5WY0xvnehjWEmaTeX8NK6kYDGDwMTT6M
AZdQ3USwcn/3EZDjEUXqvQSojKbI0tsTcanouccs/PQrByMiEM3HQsCDja/xikbv
6mB4yeQSXjSiSPSc8Nh2YijfPK+cAHg7ArZCQ4qpL8yoV8Db3sN5fkwGv97I3dBf
lW6izHKrHqNpDiOzAS6MOcURF1/h3mlW8bYgsSE22pfWLnFJcEXWeLzEmCXuI+e0
YbyVCgGlPKTO2vmdlKUozqR5hT6PyvPhKUy6vXXuXWPUQMr1sSMPGEtLM+yfKlOu
s7XJOvX2hMpH56e8cNEnsXZYRGWfFtFtBA0ZwAo6Z1t0Y83kA+uXyVJ4/emfo5Yv
SsdgB8Ou+G4DuRSjcDYSLH86qshSD6JjAVif48fYFtaoz2wiGrXdAeGYf0xDGYtJ
zauZfn/HCfm4iMUJOuGfHtxZnQJKPENpwN/jnvyqsEdvHcInyrD4AZ5fz2a1F2nb
zm03EFl9meQ5cOI4wWlLZ2vw8oMS+kp8vQTcJrwD5cFw6Oza9ziC7VzaxF+nrPFO
LZ8tD83gHW/PStApP7VYzs08r4v1rO5opfEWJa3u+0OBHKcSRW3v2VPgkJYxdasr
/Sbb9Kjg6Rv/nyiSY6la
=ZpzP
-----END PGP SIGNATURE-----


More information about the pkg-lvm-maintainers mailing list