Table of Contents

Mount And Unmount Cifs And Nfs Network File Systems

General Information

Working with network shared file systems.


Example Data

The examples below assume the following server/share information:


CIFS

Mounting a Common Internet File System (CIFS) share.

Ensure packages are installed

yum install -y cifs-utils samba-client


Create target mount point, list shares

mkdir /mnt/cifs-share
smbclient -L 192.168.1.100


Temporarily Mount Share

mount -t cifs -o username=rjones //192.168.1.100/public-docs /mnt/cifs-share


Persistent Mount Share: Edit /etc/fstab, Add Entry/Save

vim /etc/fstab
 
//192.168.1.100/public-docs /mnt/cifs-share cifs username=rjones,password=123456 0 0


More Secure Alternative: CIFS with credentials file

vim /etc/fstab
 
//192.168.1.100/public-docs /mnt/cifs-share cifs credentials=/root/.cifs_mount 0 0


Mount all and Verify

mount -a
df -hT

NFS

Mounting a Network File System (NFS) share.

Ensure packages are installed

yum install nfs-utils


Create target mount point

mkdir /mnt/nfs-share


Temporarily Mount Share

mount -t nfs 192.168.1.100:/public-storage /mnt/nfs-share


Persistent Mount Share: Edit /etc/fstab, Add Entry/Save

vim /etc/fstab
 
192.168.1.100:/public-storage /mnt/nfs-share nfs defaults 0 0


Mount all and Verify

mount -a
df -hT