mount --bind mounted harddrive?

knireis

Member
Feb 3, 2011
55
0
6
I have mounted (via fstab) 2 local harddisks in the HN on /data/disk1 and /data/disk2

On the container i created the /data directory. Now i try to make the data available to a container with entering following command on the HN:

mount --bind /data /var/lib/vz/root/102/data

But after the command on the container i see /data/disk1 and /data/disk2, but the are no subdirectories presented.
 
I have mounted (via fstab) 2 local harddisks in the HN on /data/disk1 and /data/disk2

On the container i created the /data directory. Now i try to make the data available to a container with entering following command on the HN:

mount --bind /data /var/lib/vz/root/102/data

But after the command on the container i see /data/disk1 and /data/disk2, but the are no subdirectories presented.
Hi,
i guess you need two bind-mounts.
create a file /etc/vz/conf/102.mount with following content:
Code:
#!/bin/bash
source /etc/vz/vz.conf
source ${VE_CONFFILE}
mount -n --bind /data/disk1 ${VE_ROOT}/data/disk1
mount -n --bind /data/disk2 ${VE_ROOT}/data/disk2
Perhaps you need the right filepermission inside the disks too?

Udo
 
Hi,
i guess you need two bind-mounts.
create a file /etc/vz/conf/102.mount with following content:
Code:
#!/bin/bash
source /etc/vz/vz.conf
source ${VE_CONFFILE}
mount -n --bind /data/disk1 ${VE_ROOT}/data/disk1
mount -n --bind /data/disk2 ${VE_ROOT}/data/disk2
Perhaps you need the right filepermission inside the disks too?

Udo

thanks, i just figured it out by trial and error
file permissions were ok, but i need a seperate line for each mounted disk