diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-08-07 09:08:39 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-08-07 09:08:39 +0000 |
commit | 9cdee64c0cdea7ace5135b49746d71a0d5b19689 (patch) | |
tree | deba0b7a0a4b543775bac9d48f42924013aca4b1 /morphlib | |
parent | 35d5984604e042e1dc633705f652a4c9790459d1 (diff) | |
download | morph-9cdee64c0cdea7ace5135b49746d71a0d5b19689.tar.gz |
SyslinuxDiskBuilder: sync before snapshotting
This is needed in older versions of btrfs, otherwise snapshots can
contain empty files, since the data has not been written to disk.
This behaviour was discovered in a debian squeeze i386 VM, and has not
been seen elsewhere, but this is an environment that must be supported
for bootstrapping.
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/plugins/syslinux-disk-systembuilder_plugin.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/morphlib/plugins/syslinux-disk-systembuilder_plugin.py b/morphlib/plugins/syslinux-disk-systembuilder_plugin.py index 3f8ddea8..a10053d8 100644 --- a/morphlib/plugins/syslinux-disk-systembuilder_plugin.py +++ b/morphlib/plugins/syslinux-disk-systembuilder_plugin.py @@ -161,6 +161,9 @@ class SyslinuxDiskBuilder(SystemKindBuilder): # pragma: no cover '%(source)s to %(target)s', source=source, target=target, chatty=True) with self.build_watch('create-runtime-snapshot'): + # sync needed for older versions of btrfs where files aren't + # flushed to disk before they have their contents snapshotted + self.app.runcmd(['sync']) self.app.runcmd(['btrfs', 'subvolume', 'snapshot', source, target], cwd=path) |