CIFS and NFS on netapp

 Netapp is an storage server, it can share storage using several protocols like nfs v1,v2,v3,v4, cifs, etc.

nfs - is purely for Linux related protocol, we can run nfs service from nfs server. less secured, it will get chance to lost the mount path

cifs - is more like support for windows as well linux. it's more reliable it's never get failed or lasted the mount path.

NFS client configuration-----------

nfs server - 10.10.10.10

for mount an nfs share path on linux need nfs-util package is required in client side

#yum install nfs

//if we start nfs server then this server will able to export share phat on its own system storage

//for receiving or mount from another nfs server share path it request nfs client running server, no need of service "nfs server " started

#showmount -e 10.10.10.10 (nfs server ip, it will display the all shares form nfs server)

# rpcinfo -p 10.10.10.10 (to know the port which are using)

#mount -t nfs 10.10.10.10:/nfssharedlocation /mnt/testmount

//for unmount the path

#umount /mnt/testmount

//for make this as permanent 


#findmnt        //this is very useful command which listed out all mount path on server in easy manner

///////some of the server using/proc/mounts as mounting place instead of /etc/fstab

#vi /etc/fstab

10.10.10.10:/nfssharedlocation    /mnt/testmount    nfs    sync    0 0

---------------------------------------------------------------------------------------

samba client or cifs client configuration

samba or cifs server : 10.10.10.10

Package required for 

1. cifs-utils

2. samba-client

#smbclient -U  boobi -L  10.10.10.10       //this will show all share on the server

#smbclient -U boobi/boobalan -L 10.10.10.10    //this is for domain credentials

#mount -t cifs -o username=boobi //10.10.10.10/sharepath /mnt/testmount

//it prompt password for this or another method use "credentials=/home/credentials" include this instead of username , and credentials must be contain username-username, password-password,domain-domainname

//for making them permanent

#vi /home/credential

username=boobi

password=12345

domain=boobi

#chmod 600 credential

#vi /etc/fstab

//10.10.10.10/sharepath    /mnt/testmount    cifs    credentials=/home/credential    0 0

----------------------------

#mount -a    //for remount all path written on fstab, no need of reboot.

cifs mount

#mount -t cifs -o credentials=/etc/samba/credentials/.gdpr_mft,vers=1.0,rw,gid=501,uid=501,dir_mode=0775,file_mode=0774 //server/P/StockPublisher /STOCKPUBLISHE

fstab entry

//server/P/StockPublisher  /STOCKPUBLISHE cifs credentials=/etc/samba/credentials/.nasprod,vers=1.0,rw,gid=501,uid=501,dir_mode=0775,file_mode=0774 0 0

-----------------

So, this should be something like this:

#cat /etc/fstab  //option for mount nfsversion 4.0

10.170.10.10:/NFS/QA_file  /QA_file        nfs    rw,hard,intr,nfsvers=4.0    0 0

---------------------------

# mount -vvv -a

# umount /mnt/testmount/

--------------------------

#nfsstat -m     // you can check the mounted nfs versions

---------


//to check

#df -h 

#lsblk


Difference between /etc/fstab and /proc/mounts


The /etc/fstab and /proc/mounts files are both used to store information about the mounted file systems on a Linux system. However, there are some key differences between the two files.


/etc/fstab is a static file that is created when the system is installed. It contains the mount information for the system, including the device, mount point, file system type, and options. This file is used by the mount command to mount file systems at boot time.

/proc/mounts is a dynamic file that is updated by the kernel whenever a file system is mounted or unmounted. It contains the same information as /etc/fstab, but it also includes the mount time, mount options, and other information. This file is used by the mount command to get information about the mounted file systems.

In general, /etc/fstab is used to store the default mount information for the system, while /proc/mounts is used to get the current mount information.


Here is a table that summarizes the differences between /etc/fstab and /proc/mounts:


Feature /etc/fstab /proc/mounts

Location /etc /proc

File type Static Dynamic

Purpose Store default mount information Store current mount information

Used by mount at boot time mount at any time

I hope this helps! Let me know if you have any other questions.

Post a Comment

0 Comments