From 62e21f67f0d139c9926c382630ad0a652aaeedc9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 2 Jan 2018 05:58:17 +0100 Subject: Delete subvolume before trying to create --- custom/btrfs-snapshots.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'custom') diff --git a/custom/btrfs-snapshots.nix b/custom/btrfs-snapshots.nix index 7114e9d9..44b08740 100644 --- a/custom/btrfs-snapshots.nix +++ b/custom/btrfs-snapshots.nix @@ -50,6 +50,7 @@ in { serviceConfig = with pkgs; { Type = "oneshot"; + ExecStartPre = "-${btrfs-progs}/bin/btrfs subvolume delete -c ${snapshotMount "%i"}"; ExecStart = "${btrfs-progs}/bin/btrfs subvolume snapshot ${optionalString cfg.readOnly "-r"} %f ${snapshotMount "%i"}"; RemainAfterExit = true; ExecStop = "${btrfs-progs}/bin/btrfs subvolume delete -c ${snapshotMount "%i"}"; -- cgit v1.2.3