On 05/27/2012 10:37 PM, Derek Simkowiak wrote:
>/the subsequent rm -rf $rootfs/

Could you elaborate on this? The lxc-destroy is not supposed to rm -rf the root filesystem, is it?

What if I had data in there I wanted to copy to a new LXC rootfs I'm building?

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.

It does:

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 "WARN: failed btrfs subvolume delete: $out"
# recursively remove the container to remove old container configuration
rm -rf --preserve-root $lxc_path/$lxc_name

lxc_path=/var/lib/lxc is hardcoded (at least in Ubuntu).

If custom path is in use, then the container is not touched.

Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Lxc-users mailing list

Reply via email to