Hi,
while testing lxc-create / lxc-destroy on btrfs, I found a bug
preventing correct deletion of containers when stored using btrfs
subvolume, since they can't be deleted using simple "rm -fr".
--
Frederic Crozat <fcro...@suse.com>
SUSE
>From c573badadcc0179d76ccf35c57df4fcb5b203e61 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcro...@suse.com>
Date: Wed, 18 Apr 2012 15:47:52 +0200
Subject: [PATCH 1/2] Remove btrfs subvolume when removing rootfs
---
src/lxc/lxc-destroy.in | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/lxc/lxc-destroy.in b/src/lxc/lxc-destroy.in
index b0f2da5..8d3f1a5 100644
--- a/src/lxc/lxc-destroy.in
+++ b/src/lxc/lxc-destroy.in
@@ -106,5 +106,10 @@ if [ ! -z "$rootdev" ]; then
fi
fi
fi
+# if rootfs is a btrfs subvolume, drop it
+if out=$(btrfs subvolume list $lxc_path/$lxc_name/rootfs 2>&1); then
+ out=$(btrfs subvolume delete $lxc_path/$lxc_name/rootfs 2>&1) || { echo "failed to remove btrfs subvolume $lxc_path/$lxc_name/rootfs "; false; }
+fi
+
# recursively remove the container to remove old container configuration
rm -rf --one-file-system --preserve-root $lxc_path/$lxc_name
--
1.7.7
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel