SYS: Mount and unmount CIFS and NFS network file systems.

Share this link

NFS network file system

To mount and unmount NFS network file systems, you need to set up a NFS server.

Install the NFS client package:

# yum install -y nfs-utils

Let’s assume that the /home/tools directory is exported by the nfsserver server.
If no working DNS, add an entry in the /etc/hosts file with the nfsserver name and its IP address.

Edit the /etc/fstab file and add the following line:

nfsserver:/home/tools /mnt nfs4 defaults 0 0

Execute the /etc/fstab file configuration:

# mount -a

To check the current configuration, type:

# mount | grep nfsserver

To unmount the NFS mounted directory, remove the previous line from the /etc/fstab file and type:

# umount /mnt

Note: If you get a message like “/mnt: device is busy”, check that you are not in the mounted directory and no process is using it. To do that, type:

# fuser /mnt

CIFS network file system

To mount and unmount CIFS network file systems, you need to set up a CIFS file server.

Install the Samba client packages:

# yum install -y cifs-utils
# yum install -y samba-client

Let’s assume that the /shared directory is exported by the smbserver server.
If no working DNS, add an entry in the /etc/hosts file with the smbserver name and its IP address.

Edit the /etc/fstab file and add the following line:

//smbserver/shared /mnt cifs rw,username=user01,password=pass 0 0

Execute the /etc/fstab file configuration:

# mount -a

To check the current configuration, type:

# mount | grep smbserver
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
3 comments on “SYS: Mount and unmount CIFS and NFS network file systems.
  1. Danzede says:

    ?I used to be very pleased to find this web-site.I needed to thanks in your time for this glorious learn!! I definitely having fun with each little little bit of it and I’ve you bookmarked to take a look at new stuff you weblog post.

  2. leme says:

    “smbserver:/shared /mnt cifs rw,username=user01,password=user01 0 0”

    also you can do the following .. instead of typing username and password in a word readable file like fstab you can use the following options
    credentials=/path/to/credentials/file
    like so
    /root/.credentials
    where .credentials contains the following
    username=username
    password=password
    and set the following permission on it
    chmod 0600 ..
    make sure it’s owned by root
    chown root.root /root/.credentials

    and that’s it 😀 thanks to M.Jang’s book

Leave a Reply

Upcoming Events (Local Time)

There are no events.

RHCSA7: Task of the day

Allowed time: 3 minutes.
Check that you've got no SELinux policy violations.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a default secure MariaDB database called maria and back up the database with mysqldump.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...