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?

link|improve this question

67% accept rate
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
feedback

2 Answers

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

link|improve this answer
1  
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
feedback

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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