From f714a8224b5d18cbf335b27bbe90a625b6b60529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 7 Nov 2015 03:12:19 +0100 Subject: [PATCH] backup: follow symbolic links For a long time Qubes backup did not include symlinked files, which apparently is quite common practice for users with multiple disks (for example HDD + SSD). It is covered in documentation (https://www.qubes-os.org/doc/secondary-storage/), but better solution would be to simply include symlinked files. Restore of such files would (of course) not preserve the symlinks - normal files will be restored instead. But that's fine. If the user want to move the data to another location, he/she can do that and restore the symlink. The only possible breakage from this change is having a copy (instead of symlink) to a VM icon. But storing that symlink in a backup was broken for some time (because of --xform usage) and it is handled during restore, so not a real problem. This doesn't cover all the problems with symlinked VM images - the other one is qvm-block behaviour, which would treat such images as non-system disks, so easily detachable (which would break VM operation). But that's another story. Fixes QubesOS/qubes-issues#1384 --- core/backup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/backup.py b/core/backup.py index 08190bb8..7852c278 100644 --- a/core/backup.py +++ b/core/backup.py @@ -555,6 +555,7 @@ def backup_do(base_backup_dir, files_to_backup, passphrase, tar_cmdline = ["tar", "-Pc", '--sparse', "-f", backup_pipe, '-C', os.path.dirname(filename["path"]), + '--dereference', '--xform', 's:^%s:%s\\0:' % ( os.path.basename(filename["path"]), filename["subdir"]),