storage/file: fix preserving spareness on volume clone

Force creating sparse file, even if source volume is not such file (for
example block device).

Reported by @na--
QubesOS/qubes-issues#3255
This commit is contained in:
Marek Marczykowski-Górecki 2017-10-29 17:35:59 +01:00
parent f18f4c9bff
commit f3455b5d99
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -429,7 +429,7 @@ def copy_file(source, destination):
os.makedirs(parent_dir)
try:
cmd = ['cp', '--sparse=auto',
cmd = ['cp', '--sparse=always',
'--reflink=auto', source, destination]
subprocess.check_call(cmd)
except subprocess.CalledProcessError: