Browse Source

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
Marek Marczykowski-Górecki 6 years ago
parent
commit
f3455b5d99
1 changed files with 1 additions and 1 deletions
  1. 1 1
      qubes/storage/file.py

+ 1 - 1
qubes/storage/file.py

@@ -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: