|
|
5b4f08 |
commit 92fd923f75f1f42d246e925f1c4526f36f6fd88d
|
|
|
5b4f08 |
Author: Stephen Degler <stephen@degler.net>
|
|
|
5b4f08 |
Date: Tue Sep 24 17:06:14 2013 +0200
|
|
|
5b4f08 |
|
|
|
5b4f08 |
fs-snapshot: btrfsctl is obsolete, use btrfs. BZ 1010974
|
|
|
5b4f08 |
|
|
|
5b4f08 |
diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py
|
|
|
5b4f08 |
index 4f99b6a..786b0c1 100644
|
|
|
5b4f08 |
--- a/plugins/fs-snapshot/fs-snapshot.py
|
|
|
5b4f08 |
+++ b/plugins/fs-snapshot/fs-snapshot.py
|
|
|
5b4f08 |
@@ -198,9 +198,8 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume):
|
|
|
5b4f08 |
"""
|
|
|
5b4f08 |
Runs the commands necessary for a snapshot. Basically its just
|
|
|
5b4f08 |
|
|
|
5b4f08 |
- btrfsctl -c /dir/to/snapshot #this syncs the fs
|
|
|
5b4f08 |
- btrfsctl -s /dir/to/snapshot/${snapshot_tag}
|
|
|
5b4f08 |
- /dir/to/snapshot
|
|
|
5b4f08 |
+ btrfs filesystem sync /dir/to/snapshot #this syncs the fs
|
|
|
5b4f08 |
+ btrfs subvolume snapshot /dir/to/snapshot /dir/to/snapshot/${snapshot_tag}
|
|
|
5b4f08 |
|
|
|
5b4f08 |
and then we're done.
|
|
|
5b4f08 |
"""
|
|
|
5b4f08 |
@@ -212,11 +211,11 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume):
|
|
|
5b4f08 |
|
|
|
5b4f08 |
snapname = mntpnt + snapshot_tag
|
|
|
5b4f08 |
conduit.info(1, "fs-snapshot: snapshotting " + mntpnt + ": " + snapname)
|
|
|
5b4f08 |
- p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE)
|
|
|
5b4f08 |
+ p = Popen(["/sbin/btrfs", "filesystem", "sync", mntpnt], stdout=PIPE, stderr=PIPE)
|
|
|
5b4f08 |
err = p.wait()
|
|
|
5b4f08 |
if err:
|
|
|
5b4f08 |
return 1
|
|
|
5b4f08 |
- p = Popen(["/sbin/btrfsctl", "-s", snapname, mntpnt], stdout=PIPE, stderr=PIPE)
|
|
|
5b4f08 |
+ p = Popen(["/sbin/btrfs", "subvolume", "snapshot", mntpnt, snapname], stdout=PIPE, stderr=PIPE)
|
|
|
5b4f08 |
err = p.wait()
|
|
|
5b4f08 |
if err:
|
|
|
5b4f08 |
return 1
|