Wednesday, March 28, 2012

MOUNT CIFS STORAGE DRIVE IN LINUX

1. Login to Linux box as root user
2. Check if you can ping the external network attached storage
    $ ping x.x.x.x (IP)

3. Create a directory in Linux on which you want to mount this external storage
    $ cd /
    $ mkdir xyz

4. Issue the following command
    $ mount -t cifs -o username=xxxxx,password=********   //1.2.3.4/abc   /xyz
   
Where 1.2.3.4 is IP of storage (replace it with you actual IP), "/abc" is the folder that we want to mount and "/xyz" is the local folder that we have created in setp 3.

OR

Make an entry in fstab so that this may be mounted automatically on server boot.

$ vi /etc/fstab

$ //1.2.3.4/abc   /xyz  cifs username=xxxxxx,password=***********    0    0