PDA

View Full Version : Mount on container reboot



ukhost4u
08-08-2011, 12:09 PM
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/

tom
08-08-2011, 12:59 PM
yes, see http://wiki.openvz.org/Bind_mounts (also see the 'history' of this article)

ukhost4u
08-08-2011, 01:23 PM
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

tom
08-08-2011, 02:05 PM
yes, this script triggers on start/reboot.

ukhost4u
08-08-2011, 02:25 PM
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

tom
08-08-2011, 02:41 PM
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).

ukhost4u
08-08-2011, 02:55 PM
Thanks Tom.

This makes sense to me now!

Paul