Showing posts with label CIFS. Show all posts
Showing posts with label CIFS. Show all posts

Friday, March 10, 2017

How to mount CIFS file system on Linux Server

Hope you are doing well at your end. In this post, I will explain how we mount the CIFS file system on Linux operating system.

Normally on linux machine if we mount the any other linux machine folder is quite easiy in comparision to mount the window shared folder on linux machine. So let's going to final topic where i will explain step by step method to mount the CFS folder on Linux server.

Step by Step method for Mount CIFS on Linux Server:

1. In the initial step we will gather all rpm's or packages information which is required for CIFS file system.

redhat# rpm -qa | grep cifs 
cifs-utils-4.8.1-20.el6.x86_64

if you see the above output, this packages is required for CIFS file system on Linux system. So you can install this rpm using rpm command if you have rpm packages on the server otherwise you will install the packages using YUM utility.

redhat#rpm -ivh cifs-utils-4.8.1-20.el6.x86_64.rpm

if you are using YUM, then please install the packages using below command.

redhat#yum install cifs-utils*

it is installed all required dependency related to CIFS file system.

2. In this step, we will create the mount point on the server where we need to mount the CIFS file system.

redhat# mkdir -p /backup/cifs

We will create the above mount directory where i will mount the file system.

3. Now, we will create a CIFS user and assign a password so the user can access mount folder.

redhat# touch /etc/cifspasswd
redhat# chmod 600 /etc/cifspasswd

redhat#vi /etc/cifspasswd

user=castwebsvc
password=*******

4. In this step we need to make a permanent entry of mounted file system so once we reboot the machine mounted file system not umount.

redhat# vi /etc/fstab

ADD fstab entry :

//WindowsServer/share /mount/point cifs rw,mand,user=USER,password=PASS 0 0

Example :
//192.168.0.1/CAST_data4/AICCodeUpload  /backup/cifs cifs   rw,mand,credentials=/etc/cifspasswd         0 0

You can take an example for your system. Please change the mount point as per your requirement.

5. In the final step you need to mount the file system using below command.

redhat# mount /backup/cifs
redhat# mount -a

Using above command the CIFS file system has been mounted successfully.