Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Still getting used to Linux, and the GUI is great. I have Ubuntu 10 and I can go to Network and see the Windows network. Then double clicking this gets me to the drives that are shared. Then when I go back to the terminal and use:

cd ~/.gvfs

I can see the mapped drives. But it would be nice if I could this without all the mouse clicking. So how do I map network drives in the terminal, something akin to net use for Windows.

EDIT: Not sure what happened, but this is what I did to get it to work. I created the directory for the share in /media and then ran:

sudo mount -t cifs -o username=nicorellius //server/share/ /media/share

and it said command couldn't be found. So i thought I would go ahead and use smbfs so I ran:

sudo apt-get install smbfs

I tried the command suggested with smbfs instead of cifs and that didn't work either. So I tried again and then the next time I ran:

sudo mount -t cifs -o username=nicorellius //server/share/ /media/share

it worked and I could navigate to the directory with cd.

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

Create a directory on your machine to use as a mount point for the share:

sudo mkdir /media/yoursharename

Then use the mount command to map a Windows share to the mount point you just created:

sudo mount -t cifs -o username=nicorellius //server/sharename /media/yoursharename

You should now be to access the share from your /media/yoursharename mount point.

share|improve this answer
    
Isn't Samba already installed? Is it not the program that is accessing the share when I go to Places > Network and find the Windows network? –  nicorellius May 25 '10 at 18:20
1  
Samba is already installed, but smbfs for mounting remote file systems isn't by default on Ubuntu, I've used this method for for a long time but I've just checked and cifs seems to have superseded smbfs and I imagine the gui is mounting the drive using cifs as well. I've modified the mount command to the cifs version in my original answer. You should be to run this without installing any extra packages. –  John Rabotnik May 25 '10 at 19:19
    
See edit in my question for what I did to make it work... –  nicorellius May 25 '10 at 23:03
    
Oddly enough, I tried this on the other share I needed access to and it didn't work. Something about the IP address or sever name... So I tried with the local IP 192.168.x.x and this worked as well. Great help, John - Thanks! –  nicorellius May 25 '10 at 23:18
add comment

gvfs-mount can be used to mount filesystems under ~/.gvfs in the same manner as Gnome applications.

share|improve this answer
    
syntax would be: gvfs-mount mount smb://[email protected]/share You may have to create a bookmark first. –  Flow Aug 20 '11 at 16:29
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.