[lxc-users] lxc-create try rsync data to device instead mount point

mxs kolo kolomaxes at gmail.com
Fri Jul 25 12:53:25 UTC 2014


Hi
> The other templates only take rootfs from the config file if lxc-create
> did not pass in "--rootfs".  I think you should do the same, because
> lxc should have already mounted the device for you.
Where LXC placed mount directory ?

After container created and started, I can't see any mount points for it:
# grep lxc.root /var/lib/lxc/git/config
lxc.rootfs = /dev/data/git
# lxc-info  -n  git | grep State
State:          RUNNING
# lxc-attach  -n git uptime
 08:12:15 up 1 day, 0 min,  0 users,  load average: 1.10, 1.29, 1.33
# grep git /proc/mounts
#

I can mount device manually:
# mount /dev/data/git /mnt
# ls -la /mnt/
total 92
dr-xr-xr-x 21 root root  4096 Jul 24 16:12 .
drwxr-xr-x 17 root root  4096 Jul 24 16:13 ..
dr-xr-xr-x  2 root root  4096 Jul  8 19:48 bin
dr-xr-xr-x  2 root root     6 Sep 23  2011 boot
drwxr-xr-x  5 root root  4096 Jul 24 16:12 dev
drwxr-xr-x 49 root root  4096 Jul 14 14:25 etc
....
drwxr-xr-x 14 root root  4096 Jul 10 18:02 usr
drwxr-xr-x 18 root root  4096 Jul 10 17:07 var
# grep git /proc/mounts
/dev/mapper/data-git /mnt xfs
rw,relatime,attr2,inode64,sunit=1024,swidth=2048,noquota 0 0

Other template probably fails same way in case use LVM, for example fedora:
#lxc-create  -t fedora   -n t1  -B lvm --lvname=t1  --vgname=data
--fstype=xfs --fssize=10G
....
Download complete.
Copy /var/cache/lxc/fedora/x86_64/20/rootfs to /dev/data/t1 ...
Copying rootfs to /dev/data/t1 ...mkdir: cannot create directory Б: File exists
rsync: ERROR: cannot stat destination "/dev/data/t1/": Not a directory (20)
rsync error: errors selecting input/output files, dirs (code 3) at
main.c(565) [Receiver=3.0.9]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at
io.c(605) [sender=3.0.9]

b.r.
 Maxim Kozin


More information about the lxc-users mailing list