openvz mount disk

spacefighter

Member
Mar 24, 2011
14
0
21
Hi,
I am trying to set up a little media server for my music. I am having troubles figuring out how to mount a second disk to my container. I have tried doing a mount --bind setup but without the --bind and it works but I get problems permissions.
So is this the right way to set it up? It is an ntfs disk, a backup of my music. should it be a different file system?

Thanks
 
Thanks!
I didn’t get the part about mounting it first to the host then the container. Thought I could just mount it straight there.

I am assuming there is a startup file or something where I can put the commands for mounting my disk to the host so I don’t have to do it every restart. Could you point me in the right direction to where it is?
 
Thanks!
I didn’t get the part about mounting it first to the host then the container. Thought I could just mount it straight there.

I am assuming there is a startup file or something where I can put the commands for mounting my disk to the host so I don’t have to do it every restart. Could you point me in the right direction to where it is?
Hi,
/etc/vz/conf/VMID.mount

like this:
Code:
cat /etc/vz/conf/104.mount
#!/bin/bash
source /etc/vz/vz.conf
source ${VE_CONFFILE}
mount -n --bind /spool ${VE_ROOT}/spool
Udo
 
Thanks Udo

I think I got the .mount file part down now.

I still have to mount the disk to the proxmox host and then bind mount that to the container. Right?

Is there somewhere I could put the code to mount the disk to the host? So if I restart the physical box it will auto mount the disk?
 
you need to add your disk in /etc/fstab to get it mounted on host reboot.
 
Thanks Udo

I think I got the .mount file part down now.

I still have to mount the disk to the proxmox host and then bind mount that to the container. Right?

Is there somewhere I could put the code to mount the disk to the host? So if I restart the physical box it will auto mount the disk?
Hi,
like Tow wrote - /etc/fstab is the right place.
One annotation - you can use devicepath (/dev/sdb1) or UUIDs. Take the UUID to avoid trouble if the device-ordering change (like second internal disk and your external disk became sdc after reboot and so on).
You see the UUID with "blkid".

Udo