7

At work, I spend a lot of time manipulating files on a networked computer that's running SME Server (but that's set up for Windows filesharing, if that somehow makes a difference).

I have been wondering how to cd to the network drive's root from bash so that I don't have to keep calling up Finder / nautilus every time I want to copy a file. Any suggestions?

In Ubuntu, I connect to the drive as a Windows share via Places - Connect to Server. In OSX, well, I logged in to the drive once, and it just shows up in Finder.

3 Answers 3

9

While technically using Samba, Nautilus uses gvfs, which uses FUSE to mount the SMB share using libsmbclient, you aren't actually mounting the filesystem as you would with the mount command. When you use Nautilus with SMB mounts, a background process gvfsd-smb is started. You can access the mountpoint in ~/.gvfs/, where there's a directory in there with a name based on the mount settings you used to connect.

Check out /proc/mounts to see the details of the gvfs-fuse-daemon's mountpoint.

1
  • It appears that instead of using ~/.gvfs, samba (fuse) now uses /run/user/$USER/gvfs/. This is on a Fedora 17 box as of July 2012. Commented Jul 6, 2012 at 14:46
6

An easy way is to mount the share using SAMBA. After installing samba you can mount the share as follow:

mount -t cifs -o username=user,password=secret //server.com/share /mount/point

There is a guide for openSUSE that appears via Google. See man mount.cifs for more options.

3
  • Note that if you've connected to the server via Places - Connect to server, you should be able to open a terminal in the folder from nautilus. Gnome uses samba behind the scenes, and mounts the share just as phunehehe suggests above Commented Mar 22, 2011 at 15:31
  • In ubuntu, this command requires sudo. I want it in a script. Is there a way to authenticate it once and then let it run with sudo every other time? Commented Apr 1, 2011 at 5:14
  • @mouche How about running with sudo script? See this answer to another question Commented Apr 1, 2011 at 5:22
5

For OS X look for your share name under /Volumes (it may have a "-digit" at the end if you have many mounts with the same name). The same goes for mounted CD/DVDs and disk images.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.