Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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/

\\192.168.1.2\root /media/data cifs username=doomstone,password=XXXX,auto,user 0 0
\\192.168.1.2\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

2 Answers 2

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
2  
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
2  
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

 
discard

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.