diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-06-03 14:02:54 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-06-03 14:02:54 -0300 |
commit | 14be54ae3b7f33a684d969bac74fe7aaf4c15100 (patch) | |
tree | c91270d312daaa79ee717789734e49f460420564 | |
parent | 107d51ec43ea123c098fca09175a5c2fa2476a67 (diff) | |
download | kvmx-14be54ae3b7f33a684d969bac74fe7aaf4c15100.tar.gz kvmx-14be54ae3b7f33a684d969bac74fe7aaf4c15100.tar.bz2 |
Copy guest images as sparse files
-rwxr-xr-x | kvmx | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -274,9 +274,10 @@ function kvmx_up { echo "Copying base image $baseimage to $image..." if which rsync &> /dev/null; then - rsync -ah --progress $baseimage $image + rsync -ah --sparse --progress $baseimage $image else - cp $baseimage $image + # See https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/ + cp --sparse=always $baseimage $image fi if [ -e "$basekey" ]; then @@ -735,9 +736,9 @@ function kvmx_clone { # Copy image and configuration echo "Copying basebox..." if which rsync &> /dev/null; then - rsync -ah --progress `dirname $image`/ $FOLDER/ + rsync -ah --sparse --progress `dirname $image`/ $FOLDER/ else - cp -r `dirname $image` $FOLDER/ + cp -r --sparse=always `dirname $image` $FOLDER/ fi # Remove old state folder |