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

Serge Hallyn serge.hallyn at ubuntu.com
Fri Jul 18 16:18:56 UTC 2014


Quoting mxs kolo (kolomaxes at gmail.com):
> p.s.
>  better use $name instead $utsname and check that lxc.rootfs is really
>   lvm volume:
> 
> [root at node01 mkozin]# diff -uN
> /usr/share/lxc/templates/lxc-centos.ORIG
> /usr/share/lxc/templates/lxc-centos
> --- /usr/share/lxc/templates/lxc-centos.ORIG    2014-07-07
> 12:39:32.430333034 +0400
> +++ /usr/share/lxc/templates/lxc-centos 2014-07-09 13:23:55.134301987 +0400
> @@ -839,8 +839,14 @@
>      rootfs_path=$path/rootfs
>      # check for 'lxc.rootfs' passed in through default config by lxc-create
>      if grep -q '^lxc.rootfs' $path/config 2>/dev/null ; then
> -        rootfs_path=$(sed -e '/^lxc.rootfs\s*=/!d' -e 's/\s*#.*//' \
> +        dev_path=$(sed -e '/^lxc.rootfs\s*=/!d' -e 's/\s*#.*//' \
>              -e 's/^lxc.rootfs\s*=\s*//' -e q $path/config)
> +       lvs $dev_path > /dev/null 2>&1

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.  Also, the
lxc.rootfs could be something like "nbd:file:1", which you are not
handling here.

> +       if [ $? -eq 0 ]; then
> +               mount $dev_path  $rootfs_path
> +       else
> +               rootfs_path=$dev_path
> +       fi
>      fi
>  fi
>  config_path=$path
> 
> 
> b.r.
>  Maxim Kozin
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list