• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • Life always offers you a second chance ... Its called tomorrow !!!

    Monday, December 23, 2013

    How to mount Windows share on Linux

    Most of us know that we use Samba to share our Linux file system and it can also be accessed under Windows very easily with no much mathematic calculation. But to mount a Windows share on Linux becomes a bit tricky for most of us. Let me show you a simple step to do the same.

    NOTE: While accessing a Windows network share you use backward slash (\\) but while mounting a windows share on Linux you need to use forward slash (//)

    Points to be considered
    1. You can mount a particular shared folder and not the machine name or IP
    For eg: You can mount // but you cannot mount //

    2. You need to have login credential for the windows share access even if the share is accessible with full permission for everyone.

    On Linux RHEL 5 or above
    # mount -t cifs "//path_to_windows_share/Folder_name" -o username=deepak,password=my_password  /mnt

    On Linux RHEL 4 or below
    # mount -t smbfs "//path_to_windows_share/Folder_name" -o username=deepak,password=my_password  /mnt
    Here /mnt is the local mount point on Linux. You can use any other mount point in your case.

    Once the above command is executed make sure it ran without any error
    # echo $?

    It it returns zero, that means the above command executed successfully and in case the o/p is any other digit that means the earlier command was not executed properly.

    Now let us verify if our windows share is mounted
    # mount
    /dev/sda3 on / type ext4 (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    // on /mnt type cifs (rw)

    Now you can use /mnt as any other linux directory.
    # cd /mnt
    # ls

    Let me know your success and failures.

    Related Articles
    How to set environment (PATH) variable permanently in Linux
    Give an alias entry in Linux

    Follow the below links for more tutorials


    Post a Comment