Commit 8b892c55 by Serge Hallyn Committed by Stéphane Graber

lxc-clone: change uuid on xfs

Otherwise after cloning an lvm+xfs container you can't run the original and clone at the same time. Based on a patch by Maurizio Sambati posted at https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1013549Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 60a742e0
...@@ -203,7 +203,13 @@ if [ -b $oldroot ]; then ...@@ -203,7 +203,13 @@ if [ -b $oldroot ]; then
if [ $lxc_size = "_unset" ]; then if [ $lxc_size = "_unset" ]; then
lxc_size=`lvdisplay $oldroot | grep Size | awk '{ print $3 $4 }'` lxc_size=`lvdisplay $oldroot | grep Size | awk '{ print $3 $4 }'`
fi fi
lvcreate -s -L $lxc_size -n ${lxc_lv_prefix}${lxc_new}_snapshot $oldroot newlv="${lxc_lv_prefix}${lxc_new}_snapshot"
lvcreate -s -L $lxc_size -n $newlv $oldroot
type xfs_admin > /dev/null 2>&1 && {
# change filesystem UUID if it is an xfs filesystem
xfs_admin -u /dev/$lxc_vg/$newlv && xfs_admin -U generate /dev/$lxc_vg/$newlv
}
if [ $container_running = "True" ]; then if [ $container_running = "True" ]; then
lxc-unfreeze -n $lxc_orig lxc-unfreeze -n $lxc_orig
frozen=0 frozen=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment