Here we have two servers. we are going to attach  an additional disk in one server and share the disk to the other server using NFS

server 1 - (NFS server)

server 2 - ( NFS client)

these are private IPs

we are attaching disk in NFS server .


Login into azure portal ,

  1. Go to the Azure portal to find the VM. Search for and select Virtual machines.
  2. Choose the VM from the list.
  3. In the Virtual machines page, under Settings, choose Disks.

Then attach a new disk,

  1. On the Disks pane, under Data disks, select Create and attach a new disk.
  2. Enter a name for your managed disk. Review the default settings, and update the Storage type.
  3. When you are done, select Save at the top of the page to create the managed disk and update the VM configuration.

Connect to the server via putty,

Once connected to your VM, you need to find the disk,


The output is similar to the following example

Here xvdf  is the attached disk.

If you are using an existing disk that contains data, skip to mounting the disk. If you are attaching a new disk, you need to partition the disk.

parted /dev/xvdf --script mklabel gpt mkpart xfspart xfs 0% 100%

mkfs.xfs /dev/xvdf1

partprobe /dev/xvdf1

Then create a directory and mount the file system,

mkdir /datadrive

Use mount to  mount the filesystem

mount  /dev/xvdf1  /datadrive

df -h

Disk is mounted.

To ensure that the drive is remounted automatically after a reboot, it must be added to the /etc/fstab file.


Copy the UUID and save it in /etc/fstab

nano /etc/fstab

UUID=18d5b64a-0dfc-4b8d-8b15-a05950570399   /datadrive   xfs   defaults,nofail   1   2

And save.

Thats all..


NFS, stands for Network File System, is a server-client protocol used for sharing files between linux/unix to unix/linux systems. NFS enables you to mount a remote share locally. You can then directly access any of the files on that remote share.

I have two server

NFS server -  (in this server we already attached a disk)

NFS client -

Install and start needed services on both NFS server and client

yum install nfs-utils

systemctl enable rpcbind

systemctl enable nfs-server

systemctl enable nfs-lock

systemctl enable nfs-idmap

systemctl start rpcbind

systemctl start nfs-server

systemctl start nfs-lock

systemctl start nfs-idmap

We need to run above commands in both servers.

Login into NFS server,

We want to mount the /datadrive as NFS

chmod 777 /datadrive

Export shared directory on NFS Server:

nano /etc/exports

And put


systemctl restart nfs-server

Then Login into client server, we already enabled and installed all the needed things

Create a directory

mkdir /backup

Mount the share from server to client as shown below

mount -t nfs /backup

To verify ,


You need to add in /etc/fstab files

nano  /etc/fstab /backup/ nfs rw,sync,hard,intr 0 0

And save

Thats all