1

I'm running Trusty Server 64bit in VMware and am trying to get shared folders to load on startup.

The problem I'm seeing is that the required module vmhgfs does not get loaded until after fstab is executed, so I end up with a "An error occurred while mounting /srv. Press S to skip mounting or M for manual recovery" error during boot.

If I run $ mount -a after I log in, it mounts just fine.

I've tracked down the mod load to /etc/vmware-tools/services.sh, which is executed from /etc/init/vmware-tools.conf:

start on runlevel [235] or starting gdm or starting kdm or starting prefdm
stop on runlevel [06]

pre-start exec /etc/vmware-tools/services.sh start
post-stop exec /etc/vmware-tools/services.sh stop

Is there any way to change this process to get this services.sh script to execute before fstab.

Otherwise, what's the best way to to mount this share. One if the things I'd like to do is to be able to also have a share for /var/lib/mysql, so ideally this process would have to complete before the mysql services needs it.

AndyCNX
  • 11
  • You could remove the /srv filesystem from the fstab and run the mount from /etc/rc.local. – Jos Dec 03 '14 at 12:18
  • File a bug report: https://bugs.launchpad.net/ubuntu/+source/open-vm-tools – psusi Dec 03 '14 at 14:38
  • Simply add vmhgfs in an extra line to /etc/modules

    See: http://askubuntu.com/questions/365346/virtualbox-shared-folder-mount-from-fstab-fails-works-once-bootup-is-complete?rq=1

    –  Feb 01 '15 at 09:18
  • Thanks @Jos, I ended up running the mount command in /etc/rc.local. – Yeo Aug 06 '15 at 16:48
  • Please allow me to post this as an answer below, so your question gets the "answered" status. – Jos Aug 06 '15 at 18:20

2 Answers2

0

Remove the line with the /srv filesystem from /etc/fstab, and add a mount command to /etc/rc.local. This way, your /srv filesystem will be mounted at a later moment, but before it is needed by MySQL.

Jos
  • 29,224
0

On a newer Ubuntu with systemd as Init-system you can set the following options to your shared folder in fstab:

noauto,x-systemd.automount,rw

"noauto" will skip this filesystem on boot, "x-systemd.automount" will mount this filesystem as soon as it is accessed for the first time (a simple ls is sufficient). This way the boot process gets not interrupted, but on shutdown it will be cleanly dismounted (which is not the case if you do it the rc.local-way).

Oliver R.
  • 377