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

mxs kolo kolomaxes at gmail.com
Wed Jul 9 09:29:11 UTC 2014


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
+       if [ $? -eq 0 ]; then
+               mount $dev_path  $rootfs_path
+       else
+               rootfs_path=$dev_path
+       fi
     fi
 fi
 config_path=$path


b.r.
 Maxim Kozin


More information about the lxc-users mailing list