[Users] OpenVZ Bind mounts

jehan Procaccia tem-tsp jehan.procaccia at tem-tsp.eu
Fri May 28 10:55:47 MSK 2021


Hello

I recently had the same objectives to mount cifs on a CT

1) mount it on the Host node (hypervisor)
2) attache it to the CT

1) is what you already did
2) I did that :
# vzctl set CTname --bindmount_add /mnt/hostdisk:/mnt/ctdisk --save

so the host node FS mounted at /mnt/hostdisk will be presented on 
/mnt/ctdisk in the CT

that works fine, exept that you cannot migrate your CT to an other host 
node without pepraring the host mount on the destination .
beware also if you use cifs mount options like uid=1000,gid=1000, those 
ids are should match ids on the CT .

regards .

jehan .

Le 28/05/2021 à 05:07, mike at infinilan.com a écrit :
>
> Hello list,
>
> Hoping someone can help, (forum registration is closed) I'm trying to 
> bind a samba share from the host to the OpenVZ container, but when I 
> do the directory on the container is empty. I've tried to follow 
> https://wiki.openvz.org/Bind_mounts however I think it's out of date 
> as it refers to simfs which I don't have. I made the directory 
> permissions open and selinux is disabled.
>
> - Here's the layout:
> NAS ---(CIFS)---> Virtuozzo-Server ----(BIND Mount)---> OpenVZ-Container
> Virtuozzo, OpenVZ release 7.0.16
>
> Here's what I've done:
>
> 1. Mount CIFS share on the host:
> [root at openvz conf]# mount -t cifs //server/directory /mnt/disk -o 
> username=user,vers=3.0,file_mode=0775,dir_mode=0775
>
> 2. Run the bind mount (I've tried a few variations of this):
> [root at openvz conf]# mount -v --bind /mnt/disk/ /vz/root/101/mnt/disk/
> mount: /mnt/disk bound on /vz/root/101/mnt/disk.
>
> - Here's what it looks like on the host:
> [root at openvz conf]# ls -l /mnt/disk/ | wc -l
> 234
> [root at openvz conf]# ls -l /vz/root/101/mnt/disk/ |wc -l
> 234
>
> - ...On the container (101):
> [root at computer1 ~]# ls -l /mnt/disk/
> total 0
>
>
> Anyone have any ideas what's going on? It's causing real dramas here.
>
> Kind regards,
> Mike.
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://lists.openvz.org/mailman/listinfo/users





More information about the Users mailing list