Having trouble with bind mount

gob

Renowned Member
Aug 4, 2011
69
2
73
Chesterfield, United Kingdom
[SOLVED]

Hi
I have a new PVE 3.1 server.
I have a second RAID array with an LVM volume mounted in fstab as /FP02storage

That is fine and I can use that volume.
I am trying to bind mount it into VM 100 as /FP02storage

There is a 100.mount file with the following script:
Code:
#!/bin/bash
. /etc/vz/vz.conf
. ${VE_CONFFILE}
SRC1=/FP02storage
DST1=/FP02storage


mount -n -t simfs ${SRC1} ${VE_ROOT}${DST1} -o ${SRC1}

however when I attempt to start VM 100 it won't start and the following task status is posted:

Code:
Starting container ...
mount: mount point /var/lib/vz/root/100/FP02storage does not exist
Error executing mount script /etc/pve/openvz/100.mount
TASK ERROR: command 'vzctl start 100' failed: exit code 79

I tried creating the mount point inside /var/lib/vz/root/100/ also, but that didn't work either.

Where am I going wrong?

Cheers.
 
Last edited:
Why do you mount using simfs?
and why do you not want it written to mtab?
And lastly, what you do is not a bind mount!!

What you should do instead:
mount --bind ${SRC1} ${VE_ROOT}${DST1}

And to avoid your problem in the future:
mkdir -p ${VE_ROOT}${DST1} && mount --bind ${SRC1} ${VE_ROOT}${DST1}
 
thanks for your reply mir.

To be honest, that was the last script I tried from various posted examples. All of the previous scripts did use --bind and I hadn't even noticed it was --simfs.
I have no idea what difference that option makes nor whether or not I need it written to mtab ;-)
I will switch it to bind when I am next able to down the server.

Thanks also for the mkdir tip. I will put that in also..

Regards