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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!