<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<font size="-1">I'm trying to figure out <font size="-1">how to
create an LXC using <font size="-1">multiple <font size="-1">LVM
logical <font size="-1">volumes. I'd like to do<font
size="-1"> <font size="-1">have the </font></font><font
size="-1"><font size="-1"><font size="-1">root
filesystem of the LXC on it<font size="-1">s own <font
size="-1">LV<font size="-1">, the /var di<font
size="-1">rectory of the LXC on its own LV,
and the <font size="-1">/tmp directory <font
size="-1">of the LXC on its own LV</font></font>.
Here is what I've done so<font size="-1">
far<font size="-1"> o</font>n the host:<br>
<br>
<font size="-1">=====================================</font><br>
<font size="-1">root@reaver:~# vgdisplay
vg_lxc1<br>
--- Volume group ---<br>
VG Name vg_lxc1<br>
System ID <br>
Format lvm2<br>
Metadata Areas 1<br>
Metadata Sequence No 21<br>
VG Access read/write<br>
VG Status resizable<br>
MAX LV 0<br>
Cur LV 4<br>
Open LV 3<br>
Max PV 0<br>
Cur PV 1<br>
Act PV 1<br>
VG Size 261.70 GiB<br>
PE Size 4.00 MiB<br>
Total PE 66994<br>
Alloc PE / Size 11264 / 44.00
GiB<br>
Free PE / Size 55730 / 217.70
GiB<br>
VG UUID
Zb2ume-1Ty9-s8Ze-NEZc-7Vee-A3h7-A2IvGd</font></font></font></font></font></font></font></font></font></font></font></font></font></font><br>
<font size="-1"><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1">=====================================<br>
<br>
</font></font></font></font></font></font></font></font></font></font></font></font></font></font><font
size="-1"><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font
size="-1"><font size="-1"><font
size="-1"><font size="-1"><font
size="-1"><font size="-1"><font
size="-1"><font
size="-1"><font
size="-1"><font
size="-1"><font
size="-1"><font
size="-1">=====================================<br>
</font></font></font></font></font></font></font></font></font></font></font></font></font></font>root@reaver:~#
lvdisplay vg_lxc1<br>
--- Logical volume ---<br>
LV Path
/dev/vg_lxc1/lv_ldap_var1<br>
LV Name lv_ldap_var1<br>
VG Name vg_lxc1<br>
LV UUID
VfCZgf-ZOGA-lJgn-GFO8-fOAd-IMzl-QF32aY<br>
LV Write Access read/write<br>
LV Creation host, time reaver,
2013-11-30 13:46:11 -0700<br>
LV Status available<br>
# open 1<br>
LV Size 10.00 GiB<br>
Current LE 2560<br>
Segments 1<br>
Allocation inherit<br>
Read ahead sectors auto<br>
- currently set to 256<br>
Block device 254:3<br>
<br>
--- Logical volume ---<br>
LV Path
/dev/vg_lxc1/lv_ldap_tmp1<br>
LV Name lv_ldap_tmp1<br>
VG Name vg_lxc1<br>
LV UUID
GDru3y-oLJB-Iv06-tjv3-wHuq-p8Fi-xBUscf<br>
LV Write Access read/write<br>
LV Creation host, time reaver,
2013-11-30 13:46:16 -0700<br>
LV Status available<br>
# open 1<br>
LV Size 4.00 GiB<br>
Current LE 1024<br>
Segments 1<br>
Allocation inherit<br>
Read ahead sectors auto<br>
- currently set to 256<br>
Block device 254:4<br>
<br>
--- Logical volume ---<br>
LV Path
/dev/vg_lxc1/lv_ldap_root1<br>
LV Name lv_ldap_root1<br>
VG Name vg_lxc1<br>
LV UUID
u1tAUH-t7CB-tEdp-M84c-H93p-9CEn-7xXzAM<br>
LV Write Access read/write<br>
LV Creation host, time reaver,
2014-02-10 20:19:30 -0700<br>
LV Status available<br>
# open 1<br>
LV Size 10.00 GiB<br>
Current LE 2560<br>
Segments 1<br>
Allocation inherit<br>
Read ahead sectors auto<br>
- currently set to 256<br>
Block device 254:2<br>
</font></font></font></font></font></font></font></font></font></font></font></font></font></font><font
size="-1"><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1">=====================================</font></font></font></font></font></font></font></font></font></font></font></font></font></font><br>
<br>
<small>I manually created the LV's that I would use for /tmp
(lv_ldap_tmp1) and /var (lv_ldap_var1), but the LV for the rootfs
(lv_ldap_root1)</small> <small>I</small> <small>created using
the lxc-create command:<br>
<br>
<big><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1">=====================================</font></font></font></font></font></font></font></font></font></font></font></font></font></font></big><br>
lxc-create -n ldap_baneling -t debian -B lvm --vgname vg_lxc1
--lvname lv_ldap_root1 --fstype xfs --fssize 10G<br>
<big><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1">=====================================</font></font></font></font></font></font></font></font></font></font></font></font></font></font></big></small><br>
<br>
<small>This seems to work correctly for the rootfs, but I can't seem
to get the container to use the /var and /tmp LV's. This is what
I've changed in my container's config file:<br>
<br>
</small><small><small><big><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font
size="-1">=====================================</font></font></font></font></font></font></font></font></font></font></font></font></font></font></big></small><br>
lxc.mount.entry = /var/lib/lxc/ldap_baneling/rootfs/var
/var/lib/lxc/ldap_baneling/rootfs/var none bind 0 0<br>
lxc.mount.entry = /var/lib/lxc/ldap_baneling/rootfs/tmp
/var/lib/lxc/ldap_baneling/rootfs/tmp none bind 0 0</small><br>
<small><big><font size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1"><font size="-1"><font
size="-1"><font size="-1">=====================================</font></font></font></font></font></font></font></font></font></font></font></font></font></font></big></small><br>
<br>
<small>I've mounted the LV's under their respective directories.
However, when I run df /var or df /tmp under the container it
appears that that those directories are still mounted under the
rootfs. Am I just going about this incorrectly? Any direction
would be appreciated.<br>
<br>
Thanks,<br>
Josh</small><br>
</body>
</html>