Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm connecting to my university's VPN so I can connect to the network drive. The VPN seems to be working fine and I can connect to the drive by typing the address into Nautilus and entering my login details:

smb://139.___.___.140/home

However, this fstab entry doesn't work:

//139.___.___.140/home /media/___ cifs domain=CS,username==___,password=___,uid=sai,gid=sai  0 0

Nor does manually mounting it:

sudo mount -t cifs //139.___.___.140/home /media/___ -o domain=CS,username=___,password=___,uid=sai,gid=sai,user

The only error it gives is:

mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

It's obvious the host isn't down since I can view the share from Nautilus.

Why is Nautilus mounting it fine but not the normal mount command? What could cause this error?

share|improve this question
add comment

2 Answers

fstab is run at boot, before VPN connections get a chance to actually connect.

Run nmcli con list to get your connection's UUID. Note that or copy it to a text file.

Now, make another shell script in your home folder:

#!/bin/bash
sleep 25
nmcli up uuid <your uuid here>
sleep 5
mount //139.___.___.140/home /media/___

replacing VPNNAME with the name of your VPN, and <your uuid here> with the UUID you noted earlier when getting the list of network connections.

Add that script to startup applications.

Replace the line in fstab with:

//139.___.___.140/home /media/___ cifs domain=CS,username==___,password=___,uid=sai,gid=sai,user  0 0

so it can be mounted by user.

You'll notice that you need to fill in the data you redacted from your post. The command will take 30 seconds to get intalized, allowing for connectivity. You can make the sleep times shorter if you wish.

share|improve this answer
    
While the VPN isn't available at boot time I don't think this is the problem I am currently facing. If I manually start the VPN then run the mount command it gives the same error message. –  Annan Nov 7 '12 at 21:11
1  
@Annan Honestly I don;t know why this would be, but I'll leave my answer up for reference. –  hexafraction Nov 7 '12 at 21:12
add comment

This thread http://www.linuxquestions.org/questions/linux-newbie-8/mount-drive-on-windows-98-computer-947748/ led me to try several different things.

I ended up specifying the server name (servern=) and capitalizing everything. That thread mentions using 'sec=lanman' but my problem was with a Windows 7 machine so my final solution was like this:

mount -t cifs -o username=___,password=___,servern=NBCLIENTNAME //NBCLIENTNAME/SHARENAME /tmp/mnt

I think it was the capitalization that did it. Not sure if you can get the NetBios names of your remote client or not. HTH.

share|improve this answer
add comment

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.