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, her...

How to configure ISCSI target and initiator?

What is ISCSI? ISCSI is a shared storage service, by using ISCSI service we can share storage space which we can use as internal storage in different machines. Requirements- 2 CentOS machines Free storage space (as per your requirements) Let’s start with configuration- Configuration (Server-Side)- First, we need to install the targetcli package, # yum install targetcli -y Now start and enable the service. # systemctl start/enable target.service Create partition of free space that you want to share as ISCSI storage. # fdisk /dev/sdb Follow the instructions and create a partition according to your requirements. I’ve created a partition of 6GB size. No need to format this partition but you can create LVM partition if you want. Now run following command- # targetcli > cd /backstores/block > create data_block /dev/sdb1 > cd /iscsi > create iqn.2020-03.com.example:server1 > cd iqn.2020-03.com.example:server1/tpg1/acls > create iqn.2020-03.com.example:desktop1 > cd ....

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...