Physical Disk to Container

rephormat

Renowned Member
Mar 5, 2010
14
0
66
I have searched google and the forums for any info to help me attach a physical drive to a container vm. More specifically I have an ubuntu container obtained from your downloads within the web interface. I have set this up to host files for my network using Samba. The problem is the majority of those files are on a seperate physical disk that was previously attached to another linux server doing the same thing. It is a standard partition with an EXT4 filesystem.

Is this possible? And if so can you provide steps to doing so?

I will update the wiki with any new info / experience I gain from this so that others can benefit.
 
OK. I was able to successfully bind mount a physical disk to my CT, but when I try doing so with a mount script I get the following error:

/usr/sbin/vzctl start 101
Starting container ...
Error exec /etc/vz/conf/101.mount: Permission denied
Error executing mount script /etc/vz/conf/101.mount
VM 101 start failed -

101.mount
--------------
#!/bin/bash
source /etc/vz/vz.conf
source ${VE_CONFFILE}
mount --bind /mnt/storage ${VE_ROOT}/mnt/storage
proxmox:/etc/vz/conf#

Where is the permissions problem?
 
Error exec /etc/vz/conf/101.mount: Permission denied
Error executing mount script /etc/vz/conf/101.mount

After reviewing my script I determined that I forgot to put the execute permission on the script. After doing a "chmod +x 101.mount" command the error is no more.