Linux – Mount a Windows network drive

linuxmountnetworkingwindows

I want to mount a network drive on the server (SBS2008). I have two options: Either using Fedora, (which already mounts on a CentOS) server, or directly on the CentOS server. Here is the command I tried on the Fedora machine:

mount -t cifs //192.168.xx.xx/abc /mnt/lan -o username=usernameofwindowsmachine,pass=xyz

If I use this command nothing happens, and if I press enter it goes on to the next line and prints nothing.

I also tried to mount on the CentOS directly but no command worked (mount -t smbfs, smbclient, smbmount, …). smbmount is not installed. smbclient gets a timeout and Fedora uses cifs and not smbfs … The Fedora machine already has a mount on a Windows 2003 Server, but I don't know how this has been made. I don't want to install something because I only want to transfer a big file from CentOS to SBS2008.

Edit:
So it is not that easy to mount a network drive … I went another way: I saw that WinSCP was installed on the SBS2008 and connected on the machine and managed to transfer the file. The speed is not that good (1,8 MB/sec.) but hey it works.

Best Answer

This must be:

     mount -t cifs //192.168.xx.xx/abc /mnt/lan -o username=usernameofwindowsmachine,password=xyz

Another approach is a credential file like /root/.cifscredentials:

     username=usernameofwindowsmachine
     password=xyz

and then use:

     mount -t cifs //192.168.xx.xx/abc /mnt/lan -o credentials=/root/.cifscredentials

Next should be using:

     mount -t cifs //WindowsDnsName/abc /mnt/lan -o credentials=/root/.cifscredentials,ip=192.168.xx.xx

Another thing is the Windows Domain Name, which can also be added to the mount options:

     mount -t cifs //WindowsDnsName/abc /mnt/lan -o credentials=/root/.cifscredentials,ip=192.168.xx.xx,domain=WinDomainName

After all that take a closer look at man mount.cifs.

Related Question