Mount on container reboot

ukhost4u

Member
Oct 30, 2008
95
0
6
Hello.

I currently have an iSCSI backup system setup on the physical node, but I need to mount this inside a container. I currently do this by using a mount like:

mount --bind /remotebackup /var/lib/vz/root/102/remotebackup

The issue is that if the container is rebooted this mount is lost. Is there a way to add this to the system so that it will mount this ever time a container is rebooted? Could it be added to the 102.conf for example?

I attempted to mount the iSCSI into the container directly but this caused other issues.

Thanks,

Paul Hughes
Senior Manager
http://www.ukhost4u.com/
 
Hello Tom.

Thanks for the link. Just to follow up how would I set this to be done on a container reboot? Do I add this to a conf file or do I need to reference it from the 102.conf file?

Its very important this is ran each time the container is rebooted.

Paul
 
yes, this script triggers on start/reboot.
 
Hello.

Maybe I am missing something but where do I place this script? Do I save it in a folder location as a .sh file?

I get the script, but what I don't get it where the script needs to go.

Thanks,

Paul
 
Hello.

Maybe I am missing something but where do I place this script? Do I save it in a folder location as a .sh file?

I get the script, but what I don't get it where the script needs to go.

Thanks,

Paul


see the link I sent.

cat << EOF > /etc/vz/conf/${CTID}.mount

this means the script must be in /etc/vz/conf/, and the name must be VMID.mount (eg. 101.mount).