Tuesday, December 11, 2012

Mounting a Windows Drive Remotely in a Linux Machine


1. Create a local user in the Windows machine (IP=10.253.99.19)
      Ex. Account name = user123 and password = abc123%

2. Set the drive E:\ shareable to user123 with READ / WRITE privileges on Windows machine (IP=10.253.99.19)

3. Make a mounting point directory on the Linux machine (IP=10.253.99.20)
    Ex. $ mkdir -p /usr/local/pub/mnt/svr19

4.  Make a bash script named remountServers.sh  on the Linux machine (IP=10.253.99.20)
  

#/bin/bash

#Unmount
sudo umount /usr/local/pub/mnt/svr19

#Mount
sudo mount -t cifs //10.253.99.19/e -o username=user123,password=abc123% /usr/local/pub/mnt/svr19

5. Make the script executable
    Ex. $ chmod a+x remountServers.sh 

6. Execute the script
   Ex. $ ./remountServers.sh