<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 05/27/2012 10:37 PM, Derek Simkowiak wrote:
<blockquote cite="mid:4FC29080.1090706@simkowiak.net" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
><i> the subsequent rm -rf $rootfs</i> <br>
<br>
Serge,<br>
Could you elaborate on this? The lxc-destroy is not supposed
to rm -rf the root filesystem, is it?<br>
<br>
What if I had data in there I wanted to copy to a new LXC
rootfs I'm building?<br>
<br>
Unless I have misunderstood something, doing an rm -rf is a
horrible idea. Virt-Manager and VirtualBox do not remove your
.vmdk disk image when you "destroy" a virtual machine.<br>
</blockquote>
<br>
It does:<br>
<br>
if out=$(btrfs subvolume list "$lxc_path/$lxc_name/rootfs"
2>&1); then<br>
out=$(btrfs subvolume delete "$lxc_path/$lxc_name/rootfs"
2>&1) ||<br>
echo "WARN: failed btrfs subvolume delete: $out"<br>
fi<br>
# recursively remove the container to remove old container
configuration<br>
rm -rf --preserve-root $lxc_path/$lxc_name<br>
<br>
<br>
lxc_path=/var/lib/lxc is hardcoded (at least in Ubuntu).<br>
<br>
<br>
If custom path is in use, then the container is not touched.<br>
<br>
tamas<br>
</body>
</html>