btrfs via symlink not working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
# fresh quantal instance (2012-09-04)
sudo apt-get update
sudo apt-get install lxc btrfs-tools -y </dev/null
# put a btrfs fs on /mnt
sudo umount /mnt
dev=$(awk '$2 == "/mnt" { print $1; }' /etc/fstab)
echo "making fs on $dev"
sudo mkfs -t btrfs $dev -L ephemeral0 $dev
sudo mount /mnt
sudo mkdir /var/lib/lxc /var/cache/lxc # in case they dont already exist
sudo rsync -a /var/lib/lxc/ /mnt/var-lib-lxc
sudo rm -Rf /var/lib/lxc
sudo ln -sf /mnt/var-lib-lxc /var/lib/lxc
sudo rsync -a /var/cache/lxc/ /mnt/var-cache-lxc
sudo rm -Rf /var/cache/lxc
sudo ln -sf /mnt/var-cache-lxc /var/cache/lxc
sudo lxc-create -t ubuntu-cloud -n source-
sudo lxc-clone -o source-
sudo lxc-start -n precise-amd64 -d
sleep 10
sudo lxc-stop -n precice-amd64
sleep 10
## Then ##
$ sudo lxc-destroy -n precise-amd64
rm: cannot remove `//var/
rm: skipping `/var/lib/
I would have expected this to work.
$ sudo lxc-ls
precise-amd64 source-
I'm not sure what creates this scenario, but some more debug:
$ df /var/lib/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vdb 20971520 727396 18217108 4% /mnt
$ df /var/lib/
Filesystem 1K-blocks Used Available Use% Mounted on
- 20971520 727396 18217108 4% /mnt/var-
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: lxc 0.8.0~rc1-4ubuntu32
ProcVersionSign
Uname: Linux 3.5.0-13-generic x86_64
ApportVersion: 2.5.1-0ubuntu4
Architecture: amd64
Date: Wed Sep 5 00:48:33 2012
Ec2AMI: ami-00000146
Ec2AMIManifest: FIXME
Ec2Availability
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
TERM=screen
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
Thanks for submitting this bug. Indeed if lxc.rootfs is a symbolic link, it is assumed to be a lvm rootfs.
I tink it should be ssafe to rm -rf --one-filesystem $rootfs if it is a symbolic link but is not a blockdev.