Mounting Windows Share to Linux

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

\\serverip\shareddrive

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
username=
password=

mount -a

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

  1. 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

    • AKN
    • 10/19. 2012 6:54pm

    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.

  2. 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.

    Thanks,
    Sloba

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

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

    • AKN
    • 10/24. 2012 2:34am

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

    Thanks

  1. No trackbacks yet.

You must be logged in to post a comment.

return top