[Users] Auto mounting NFS mount points when a container starts

Bailey, Darragh dbailey at hp.com
Tue Mar 31 07:43:20 EDT 2009

I'm currently setting up a container where I would like to have certain mounts occur automatically when the container is started. I've already verified that I can mount the NFS filesystems, so it does work.

I'd rather not do all this mounting from outside the VE, using vps.mount and vps.umount to umount them. But that does appear to be one solution that would work.

Adding them to /etc/fstab doesn't appear to have any effect, I presume since there is nothing run by openvz to moung any remaining filesystems in that file.

Also tried adding them to the ${VEID}.start script called by vzctl on starting a VE, but it appears to attempt the mount before the requried services are started and thus fails.

I haven't tried using rc.local yet, I don't know if that gets called, but it might take care of the problem.

So far it appears to me, that the only other alternative is to us autofs, which is less than ideal due to the way it requires the mount points be configured.

i.e. for 3 filesystems on different mount points, /mnt1, /somewhere/mnt2, /elsewhere/now/mnt3, I would need 3 separate autofs files to manage them.

Has anyone used anything else to handle this? Or is autofs the generally accepted solution?

Darragh Bailey

More information about the Users mailing list