Mounting Windows Share to Linux

In order to Mount a windows share to Linux , create a share in your windows


Now in the linux server create a directory where you want to mount the share
mkdir /mnt/winshare

Now mount the share by typing the following command:
mount -t cifs -o username=,password= //serverip/shareddrive /mnt/winshare

If you want the drive to be mounted on reboots, create an fstab entry:

vi /etc/fstab
//serverip/shareddrive /mnt/winshare cifs auto,gid=users,file_mode=0664,dir_mode=0775,iocharset=iso8859-15,credentials=/etc/sharepasswd 0 0

Now create a password file /etc/sharepasswd
vi /etc/sharepasswd

mount -a

Now you can access your windows share at /mnt/winshare

6 thoughts on “Mounting Windows Share to Linux

  • October 19, 2012 at 6:37 pm

    Hello Amit,

    I used your process to mount one of the windows server on my Linux server. That works perfect. Thanks.

    I am having some issues like when I export any text file directly to Linux directory and shared it from my desktop to other then same file is getting loaded into other database successfully but when I generate the file into the mounter server then while loaded into the database it’s getting error for file terminator is not correct.
    But everything works fine when I share them manually

  • October 19, 2012 at 6:54 pm

    Mounter server means the Linux server where you have mounted the windows share ? So as far as I understand your question, if you create file from windows it works fine but if you create file from Linux ( the server that mounts the share ) you are having error ?

    If that is the case, then it could be permission/ownership issue. When you create the file in Linux machine the owner could be the user creating file.. but really need to know more to pinpoint the issue.

    Thanks and I am glad that helped you.

  • October 19, 2012 at 7:34 pm

    No I am generating the file from Linux only, but when exported to Linux drive and copy to my desktop then it works fine but if I export the file on Mounter server then it don’t.


  • October 22, 2012 at 2:05 pm

    Any clue on why I am not able to load the file when I export from oracle to the mounter server?

  • October 22, 2012 at 8:37 pm

    The issue was with the conversion of the file from Linux to Windows by using unix2dos solved my issue..

  • October 24, 2012 at 2:34 am

    Hi Sloba,
    Thank you for letting know what the issue was, sorry for late reply.


Leave a Reply