cp --reflink=auto to speed up clone/backup/restore on btrfs
This commit is contained in:
parent
34f7ddd41e
commit
3e3ac36f58
@ -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])
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user