November 23, 2013

Accessing Network Files via NFS and CIFS in Linux

Working with remote file system under Linux is not hard. Below I will show how to use the two most common remote file system used:

  • NFS - Network File System
  • CIFS - Common Internet File System

NFS

Show the NFS server’s export list.

$ showmount -e nfsserver.domain.com

Mount. Note that the directory /remote must exist before mount, if not create it with mkdir /remotenfs.

$ mount nfsserver.domain.com:/c/media /remotenfs

Unmount file systems

$ umount /remotenfs

CIFS

CIFS is the underlying remote file protocol used for samba server and which is the most common file server when having a mixed client environment with Windows and Linux.

Install client library

$ yum install samba-client

Show the CIFS server’s sharenames.

$ smbclient -L nfsserver.domain.com

Mount. Note that the directory /remote must exist before mount, if not create it with mkdir /remotecifs.

$ mount //cifsserver.domain.com/media /remotecifs

Unmount file systems

$ umount /remotecifs

No comments: