Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hello i am trying to get my slave media center to mount a network drive at startup automatic. I have written this to my /etc/fstab/

\\\root /media/data cifs username=doomstone,password=XXXX,auto,user 0 0
\\\xbmc /media/xbmc cifs username=doomstone,password=XXXX,auto,user 0 0

Now when i do a "mount /media/data" it all works just fine, but it dose not mount it on statup. witch is a pain as the computer dose not have a keyboard, only a remote. So i need to ssh the computer and mount the drives each time i boot. As far as i can figure is that the computer dose not have a network connection at the mount time, and thus fails the mount of the network drives.

How can i do this so it can be mounted at startup?

share|improve this question
I'm brining the problem up again as it did not work, it only worked for 2-3 reboots and then it manuel mount for me again! – DoomStone Oct 8 '10 at 9:32

Try replacing auto with _netdev in the options in /etc/fstab - this should make the mount wait until the network is up.

share|improve this answer
The most underrated fstab option. There are not enough people who know about this, even though it is unspeakably useful. +1 – wzzrd Aug 2 '10 at 9:44
Cool i will try it when i get home from work – DoomStone Aug 2 '10 at 11:04
It worked thanks – DoomStone Aug 2 '10 at 14:31
Thank you. This is the only place on the internet documenting _netdev. :P – earthmeLon Feb 22 '13 at 22:01

Either write mount /media/{data,xbmc} to /etc/rc.local (hope it's called so in Ubuntu) or take a look at autofs.

Edit: didn't see this, you have to replace your backslashes with "/" in /etc/fstab.

share|improve this answer
I have tryed that, it diden't work – DoomStone Aug 2 '10 at 9:15
Would have voted you up if you had refrained from mentioning putting stuff into /etc/rc.local. Don't do that, unless there is no other straight-forward way to do something. In this case, there is with either autofs or - and I would prefer this - using _netdev. – wzzrd Aug 2 '10 at 9:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.