diff --git a/core/backup.py b/core/backup.py index 7852c278..6b20212c 100644 --- a/core/backup.py +++ b/core/backup.py @@ -1992,7 +1992,7 @@ def backup_restore_do(restore_info, backup_dir) # We prefer to use Linux's cp, because it nicely handles sparse files - cp_retcode = subprocess.call(["cp", "-rp", backup_src_dir, dst_dir]) + cp_retcode = subprocess.call(["cp", "-rp", "--reflink=auto", backup_src_dir, dst_dir]) if cp_retcode != 0: raise QubesException( "*** Error while copying file {0} to {1}".format(backup_src_dir, @@ -2224,7 +2224,7 @@ def backup_restore_do(restore_info, home_dir + '/' + restore_home_backupdir + '/' + f) if format_version == 1: subprocess.call( - ["cp", "-nrp", backup_dom0_home_dir + '/' + f, home_file]) + ["cp", "-nrp", "--reflink=auto", backup_dom0_home_dir + '/' + f, home_file]) elif format_version >= 2: shutil.move(backup_dom0_home_dir + '/' + f, home_file) retcode = subprocess.call(['sudo', 'chown', '-R', local_user, home_dir]) diff --git a/core/storage/__init__.py b/core/storage/__init__.py index 3a12dbe6..29cf8654 100644 --- a/core/storage/__init__.py +++ b/core/storage/__init__.py @@ -79,7 +79,7 @@ class QubesVmStorage(object): # TODO: Windows support # We prefer to use Linux's cp, because it nicely handles sparse files - retcode = subprocess.call (["cp", source, destination]) + retcode = subprocess.call (["cp", "--reflink=auto", source, destination]) if retcode != 0: raise IOError ("Error while copying {0} to {1}".\ format(source, destination))