Ubuntu Linux Quick Tip – Mount a Samba (Windows) file share to a folder

To mount a Samba (Windows) file share to a folder in Ubuntu Linux, you need to have Samba Filesystem Support installed. The easiest way to do this is through apt-get on the command line:

sudo apt-get install smbfs

After the installation has finished, create a directory that the Samba share will be mounted to (e.g. ‘windows_share‘ in the ‘/media‘ directory):

sudo mkdir /media/windows_share

Finally, use the mount command to mount the remote shared folder to your newly created directory (change the IP address, paths, username and password in the example below as needed):

sudo mount -t smbfs //10.0.0.100/shared_folder/
  /media/windows_share -o username=Guest,password=

To unmount the Samba share, use the umount command (change the path in the example below as needed):

sudo umount /media/windows_share

To automatically mount the Samba share when you boot up your computer, you’ll need to edit your /etc/fstab file as detailed on this page on the Ubuntu Forums.

For more detailed usage information on the mount and umount commands as well as fstab, see their man pages:

man mount
man umount
man fstab

 

Related posts:

  1. Portable Ubuntu for Windows
  2. Configuring a Vodafone 3G modem on Ubuntu Linux 9.04 (Jaunty Jackalope)
  3. Linux Quick Tip: Renew a machine’s DHCP lease with dhclient
  4. Displaying a text-based file and folder tree on the command line
  5. The Ubuntu Pocket Guide
Twitter Digg Delicious Stumbleupon Technorati Facebook Email

3 Responses to “Ubuntu Linux Quick Tip – Mount a Samba (Windows) file share to a folder”

  1. Technically shouldn’t this be mounted under /mnt? /media is for removable media such as USB or CDROM whereas /mnt is for network file systems.

Trackbacks/Pingbacks

  1. Load Data from Excel Format into Database « Code Ghar - 25 Aug 2009

    [...] is very easy to mount a Windows shared folder under Debian. Hat tip to Ubuntu Linux Quick Tip – Mount a Samba (Windows) file share to a folder and How to mount remote windows partition (windows share) under Linux. First, install [...]

  2. Auto-Mount Network Share on Ubuntu | Ryan Rampersad - 19 Aug 2010

    [...] had a great deal of help in writing this, especially from Geekology, the Ubuntu forums, Linux Questions and of course Tux [...]

Afrigator