Thursday, August 27, 2015

Share a folder between windows and linux

To share a linux folder with windows, just use Samba.

To share a windows folder with linux, you can use cifs-utils. Details are below:

    1) Create windows shared folder [2] on windows machine (say MachineX): C:\Shared\
       - now can access \\MachineX\Shared\ on other machines on the same domain.
    2) Download/Install cifs-utils on linux machine:
       - download from [3].
       - unzip and install:
         bzip2 -d cifs-utils-6.4.tar.bz2
         tar xvf cifs-utils-6.4.tar
         cd cifs-utils-6.4
         ./configure --prefix=/usr \
            --disable-pam \
            --disable-systemd
         make
         sudo make install
       - finally, the command is available on linux by: sudo /sbin/mount.cifs
    3) Mount the shared folder on linux:
       - mount:
         cd /mnt
         sudo mkdir MachineX_Shared
         sudo /sbin/mount.cifs  //[MachineX IP address]/Shared  /mnt/MachineX_Shared -o user=[username]
       - now can access the folder and write to it.

References:

[1] http://www.howtogeek.com/176471/how-to-share-files-between-windows-and-linux/
[2] http://lifehacker.com/288033/mount-a-windows-shared-folder-in-linux
[3] http://www.linuxfromscratch.org/blfs/view/svn/basicnet/cifsutils.html


No comments:

Blog Archive

Followers