Skip to main content

NFS server configuration.




How to configure NFS in Ubuntu/CentOS-

What is NFS -
NFS stands for Network File System, developed by Sun Microsystems. By using this protocol a user on a client computer can access files over a computer network much like local storage is accessed.

Let’s start with configuration -

First, we need to install the required packages. Tp install NFS package we need to run following command -
# apt install nfs-kernel-server        => For Ubuntu
# yum install nfs nfs-utils        => For CentOS/RedHat

Now create a directory that you want to share over the network.
# mkdir /nfsshare

Now change the permission of shared directory as bellow-
# chmod 777 /nfsshare

After all this, we need to make an entry in exports file-
# vim /etc/exports
/nfsshare    *(rw,sync)
Save and exit.

Note - ‘*’ denotes that shared directory available for all networks, instead of * we can give a particular IP address or domain name.
 ‘rw’ means read-write permission.
‘sync’ means it will synchronize the data real-time basis.
We can add more arguments on the basis of needs like ‘sec’ for security.

Now start and enable the services.
# systemctl start/enable nfs-server.service        => For CentOS/RedHat
# systemctl start nfs-kernel-server

Now export the shared directory -
# exportfs -rv

Add the firewall rules-        => For CentOS/RedHat
# firewall-cmd --permanent --add-service=nfs
# firewall-cmd --permanent --add-service=rpc-bind
# firewall-cmd --permanent --add-service=mountd
# firewall-cmd --reload
For Ubuntu -
# ufw allow nfs

Now start with the client configuration.

To see the shared directory we need to run following command -
# showmount -e <” server IP address”>

To mount NFS share in the client we need to follow these steps

First, we need to install nfs-utils packages in centos for ubuntu no need to install it’s already there.
# yum install nfs-utils

Now edit fstab file and the following line-
192.168.0.110:/nfsshare    /mnt    auto    defaults    0    0
Save and exit

If you guys have any doubts comment below otherwise you can send me an Email - johntheh4cker



Comments

Popular posts from this blog

How to install BlackArch Linux in VirtualBox

In this blog, I'm going to show you how to install BlackArch Linux in VirtualBox/VMWare. Open your VirtualBox application and click on create a new virtual machine from the main menu. Assign a minimum 2GB ram minimum. Add hard-disk of at least 50GB. Now boot the newly created VM and start the installation process. First, select Boot Black arch Linux, and if you have Nvidia graphics then select Boot BlackArch Linux (nonfree). First thing first you need to login in your new BlackArch live session. The default username and password is root & blackarch. Now after this open terminal and type first command #blackarch-install- #blackarch-install After that, you need to follow the instructions. - Select the second option Install from black arch Live-ISO and hit enter.   - Now you need to select the output method quiet or verbose, here I'm selecting the second option verbose mode.  - Now select your locale settings, according to your locality, here I

How to install and setup Manjaro-i3 for the first time.

Hey, guys today I'm going to show you how to install and setup Manjaro-i3. In this case, first of all, we need to know what is Manjaro and the difference between Manjaro & Manjaro-i3. What is Manjaro? Manjaro is an opensource Linux distribution based on ArchLinux. Its basically used for personal work or we can say that this distribution is the workstation edition of ArchLinux. What is i3? i3 is a desktop environment used in many distributions. It looks good and clean. If you are good at remembering shortcuts and commands then this is for you. It's a lightweight desktop environment. If you are switching to i3 from a gnome desktop environment then you will find some dificulties to use it, but you will learn very quickly. In my opinion, this is the most beautiful desktop environment I have ever used. Now let's take a look at how to install it in VirtualBox . First of all, create a virtual machine with at least 2 GB ram and 40 GB HDD space. Now a

Object storage configuration through MinIO

Object storage configuration through MinIO   Hi guys, in this blog I'm going to explain to you how to set up an object storage server in your local system through MinIO object storage. What is Object Storage - Object storage is a computer data storage architecture that manages data as objects. It can directly store files, unlike block storage. What is MinIO - Minio is a popular open-source object storage server. The service stores unstructured data such as photos, videos, log files, backups, and container/VM images, and can even provide a single object storage server that pools multiple drives spread across many servers. Prerequisites - Ram - 2GB (testing), 4GB recommended. HDD - As per your requirements. Static IP address. If you want to host it on the web then get a domain name. Configuration - First thing you need to update your server. # sudo apt update -y Now you need to download “minio” package by using the following command - # wget https://dl.min.io