Physical Disk to Container

rephormat

Active Member
Mar 5, 2010
14
0
41
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.
 

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!