Help with auto mounting

Nik2016

Member
Oct 25, 2016
19
0
6
44
Hello, I'm rebuilding my proxmox server and trying to re-add my data disks as directories then using mount points to pass them to VM's / Containers. I'd just like some input about if the method I'm using for auto mounting my physical HDD's to the data centre level is correct. It did work for my previous server but there was a small issue where after starting the vm I'd have a communication issue and have to stop it. Starting it again afterwards had no problems and it booted properly, but I've always suspected it was due to the way the disks were mounted.

The method I used is:
mkdir /hdd-mount
mount /dev/sda1 /hdd-mount

nano /etc/fstab
/dev/sda1 /hdd-mount ext4 defaults 0 0

Any feedback would be really helpful. Thanks!
 
Your disks holds non-vm data like directories, files etc? If so, you can only use bind-mounts via the GUI in containers, not VMs.

It seems to me that this created an additional and unnecessary layer of complexity, if you only need those files served in some way.

How many VMs/Containers will need these files?
 
Ah, your right about the bind mounts. Think I could still add the disks by adding them as vm disks in the GUI. The data on the disks is all my media and documents, nothing vm or proxmox related. 2 VM's are going to need access to the disks, not going to have any containers use them for now.

So if the way I'm doing it is creating unnecessary complexity how would you suggest I change my setup?
 
If you do not use containers, you will not be able to bind mount the items. This is only possible with containers.

If you want to share the data to "real" VMs (KVM/QEMU) you need to export them via samba or nfs to the machines, so your Proxmox VE Host will also become a fileserver.
 
Thanks for your replies.

So if I want to share data from a disk to a VM I'd have to share it via samba/nfs from another host on the network? Is that the best method of accessing the data on a VM in your opinion? Btw what do you think about passing through the sata disk using this:-

nano /etc/pve/qemu-server/[vm id]
ide3: /dev/sdb1

I've tested it and it does work, but I don't know if it's the wisest method to use in the long term.
 
Of course that works too. Therefore I asked about the number of VMs needed access. Direct access is only possible for one VM, not for 2 as you wrote. Therefore, you need to share it "indirect", e.g. over Samba or NFS.
 
So would the simplest way to handle this be to pass the disks to 1 vm then setup samba on there and share it to any other vm's / containers? 1 VM with direct access and everything else indirect.

1 other question. If I went with the passthrough method could I safely remove / add the disks to the 1 vm without worry of my data getting damaged? When I did my test on an ubuntu desktop vm it added directories and files to it. Not sure why, maybe something I overlooked.
 

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!