If this is acceptable as is, then I'll try to get a simple lxc-clone out tomorrow (taking into account your comments from last time).
Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com> --- src/lxc/lxc-destroy.in | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/lxc/lxc-destroy.in b/src/lxc/lxc-destroy.in index 565d89d..ddd3c3b 100644 --- a/src/lxc/lxc-destroy.in +++ b/src/lxc/lxc-destroy.in @@ -75,5 +75,15 @@ if [ ! -d "$lxc_path/$lxc_name" ]; then exit 1 fi +# Deduce the type of rootfs +# If LVM partition, destroy it. If anything else, ignore it. We'll support +# deletion of others later. +rootdev=`grep lxc.rootfs $lxc_path/$lxc_name/config | awk -F= '{ print $2 '}` +if [ -b $rootdev -o -h $rootdev ]; then + lvdisplay $rootdev > /dev/null 2>&1 + if [ $? -eq 0 ]; then + lvremove $rootdev + fi +fi # recursively remove the container to remove old container configuration rm -rf --preserve-root $lxc_path/$lxc_name -- 1.7.4.1 ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users