Commit 2130af26 by Serge Hallyn

lxc-clone: use hardlink detection in rsync

Otherwise busybox clones have been reported to explode from 2M to 440M. Reported-by: 's avatarRene K. Mueller <spiritdude@gmail.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarMichael H. Warfield <mhw@WittsEnd.com> Acked-by: 's avatarDwight Engen <dwight.engen@oracle.com>
parent 6902a6c6
......@@ -225,7 +225,7 @@ if [ -b $oldroot ]; then
mkfs -t $fstype /dev/$lxc_vg/${lxc_lv_prefix}$lxc_new
mount /dev/$lxc_vg/${lxc_lv_prefix}$lxc_new $rootfs || { echo "$(basename $0): failed to mount new rootfs" >&2; false; }
mounted=1
rsync -ax ${rootfs}_snapshot/ ${rootfs}/ || { echo "$(basename $0): copying data to new lv failed" >&2; false; }
rsync -Hax ${rootfs}_snapshot/ ${rootfs}/ || { echo "$(basename $0): copying data to new lv failed" >&2; false; }
umount ${rootfs}_snapshot
rmdir ${rootfs}_snapshot
lvremove -f $lxc_vg/${lxc_lv_prefix}${lxc_new}_snapshot
......@@ -252,7 +252,7 @@ else
frozen=1
fi
mkdir -p $rootfs/
rsync -ax $oldroot/ $rootfs/
rsync -Hax $oldroot/ $rootfs/
echo "lxc.rootfs = $rootfs" >> $lxc_path/$lxc_new/config
if [ $container_running = "True" ]; then
lxc-unfreeze -n $lxc_orig
......
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