Merge remote-tracking branch 'qubesos/pr/9'
* qubesos/pr/9: cp --reflink=auto to speed up clone/backup/restore on btrfs
This commit is contained in:
commit
ed4e3115d8
@ -1992,7 +1992,7 @@ def backup_restore_do(restore_info,
|
|||||||
backup_dir)
|
backup_dir)
|
||||||
|
|
||||||
# We prefer to use Linux's cp, because it nicely handles sparse files
|
# 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:
|
if cp_retcode != 0:
|
||||||
raise QubesException(
|
raise QubesException(
|
||||||
"*** Error while copying file {0} to {1}".format(backup_src_dir,
|
"*** 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)
|
home_dir + '/' + restore_home_backupdir + '/' + f)
|
||||||
if format_version == 1:
|
if format_version == 1:
|
||||||
subprocess.call(
|
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:
|
elif format_version >= 2:
|
||||||
shutil.move(backup_dom0_home_dir + '/' + f, home_file)
|
shutil.move(backup_dom0_home_dir + '/' + f, home_file)
|
||||||
retcode = subprocess.call(['sudo', 'chown', '-R', local_user, home_dir])
|
retcode = subprocess.call(['sudo', 'chown', '-R', local_user, home_dir])
|
||||||
|
@ -79,7 +79,7 @@ class QubesVmStorage(object):
|
|||||||
# TODO: Windows support
|
# TODO: Windows support
|
||||||
|
|
||||||
# We prefer to use Linux's cp, because it nicely handles sparse files
|
# 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:
|
if retcode != 0:
|
||||||
raise IOError ("Error while copying {0} to {1}".\
|
raise IOError ("Error while copying {0} to {1}".\
|
||||||
format(source, destination))
|
format(source, destination))
|
||||||
|
Loading…
Reference in New Issue
Block a user