Red Hat Bugzilla – Bug 1470562
Please provide a way to clone thin volumes
Last modified: 2017-07-13 04:24:45 EDT
Description of problem:
Sometimes, I want to clone thin logical volumes, to have two thin logical volumes be independent and not being able to merge them by accident.
For non-thin logical volumes, there is already an old open wishlist bug at https://bugzilla.redhat.com/show_bug.cgi?id=638188
For thin lvs, this can be done by the following commands:
lvcreate -n vm2 --snapshot /dev/vg/vm1
lvcreate -n vm1a --snapshot /dev/vg/vm1
lvrename /dev/vg/vm1a vm1
lvchange -kn /dev/vg/vm1
lvchange -kn /dev/vg/vm2
This long list of commands is probably way to error-prone to be practical, when the only effective difference to a plain lvcreate --snapshot is the missing origin link.
Providing a shortcut like the command below to that should not be hard to implement:
lvcreate -n vm2 --clone /dev/vg/vm1