Coding

Automatically Unmount Network Shares on Ubuntu


Hard disk dissection

Hard disk dissection

I’ve mentioned before, how I mount shared drives in Ubuntu both at home and at work.  While this is quite useful, it seems the default setup for Ubuntu stops the network interface before disconnecting these drives.  This results in Ubuntu hanging for a while on shutdown while these drives time out.  After the jump we describe how to solve this problem.

It seems that during the shutdown sequence for Ubuntu, networking will be turned off before any network shares have been unmounted.  This will cause your computer to display the following for a few minutes before shutting down:

CIFS VFS: server not responding
CIFS VFS: no response for cmd ## mid ###

To fix this problem, and enable the computer to shut down more smoothly, we need to make sure the shares are unmounted before the network is disconected.  This can be done by running to following commands:

sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh stop 15 0 6 .

This will increase the priority for share unmounting, allowing the shares to be unmounted cleanly, before the network shutdown scripts are run.

Standard

3 thoughts on “Automatically Unmount Network Shares on Ubuntu

  1. Nice Post, i like the article in your blog…
    i will visit this blog more often…
    Nice info in there…

    specially about
    Automatically Unmount Network Shares on Ubuntu

    cheers

  2. Thanks a million, ever since auto mounting our soho file server to my netbook the netbook was taking forever to shut down, your instructions solved it, thank you!

    David

Comments are closed.