How to setup NFS for Proxmox backups?

eiger3970

Well-Known Member
Sep 9, 2012
276
3
58
Hello,
I am setting up NFS and would like to check if I have the setup right.

Proxmox runs on 1 server, connected to router.
2nd computer has some 2TB HDDs in it, connected to router.
Install Ubuntu 14.04 server on 2nd computer.
Set static IP on 2nd computer.
Install NFS on 2nd computer Ubuntu OS as per https://help.ubuntu.com/community/SettingUpNFSHowTo

Not sure what to setup on Proxmox, if anything for NFS? http://pve.proxmox.com/wiki/Storage_Model

Turn 2nd computer on once per month or whenever I feel I can afford electricity to leave on all the time.
Automate backups on Proxmox or manuall backup once per month when 2nd computer is turned on.
 
Proxmox has pretty flexible backup mechanisms for virtual machines, however, in order to run snapshot backups, i.e. live backups without bringing the virtual machine down, ensuring no downtime, NFS storage should be used. This document will describe the process of setting up NFS [1] storage and connecting it to Proxmox VE [2]. Preliminary considerations It is best to use a separate physical server to serve as a file server or a backup server solely. One can always trick Proxmox by setting up a virtual machine to provide the NFS share, however such approach is not strongly recommended. If you are short on physical servers you can create a virtual machine and point it to use a separate physical hard drive; to do that specify the hard drive to be used in the qemu-server configuration file used by the virtual machine. For instance:
# nano /etc/pve/nodes/yournode/qemu-server/100.conf
# with the virtual drive the configuration will look like:
ide0: local:111/vm-111-disk-1.raw,size=5G
# to use the physical drive, change it to something like:
ide0: /dev/sdb

Make sure to use the correct disk. This setup was tested in the lab and proved suitable. It may be possible to use the virtual disk as well, but such a setup wasn’t tested.
NFS setup #

CareNet infrastructure is running Ubuntu Server 12.04 x64 for the servers, thus, the following instructions apply to this operating system, but should work for other Linux distributions as well, but the installation process may be different.

To install NFS server:
# apt-get update
# apt-get install nfs-kernel-server nfs-common portmap

To add an NFS share or export:
# nano /etc/exports
/backup/vm 10.10.10.10(rw,async,no_root_squash)

For simplicity and to ensure security, it is recommended to use NFS only with trusted clients in trusted networks. We use a separate private network to connect to the NFS share from Proxmox. To further enhance security configure a firewall on the system running NFS to allow connections only from trusted clients.

The no_root_squash option in the above exports configuration is used to enable root user access to the share, so that Proxmox can write to it. Note: This setup is used solely for live backups with Proxmox. If you need more specific or extended setup go through the official how-to [1] and pay close attention to security implications of using NFS.
Connecting NFS export to Proxmox #

CareNet server is running Proxmox VE 2.2, which provides a quick and simple way to add NFS storage to the system. To connect an NFS share open the web interface and go to Datacenter -> Storage -> Add. Fill in the required info. For the example provided above the setup will look like the following:
ID: nfs (this is just a name for the share, use something descriptive here)
Server 10.10.10.11 (considering you run your NFS server at 10.10.10.11)
Export: /backup/vm
Content: Backups, Images, ISO (make sure to include Backups)
Enabled: yes
Max Backups: 2 (this option is used to set the backup depth: 2 means only two backup copies will be stored, the new backups will overwrite the older backups)
 
  • Like
Reactions: guletz
Thank you for the reply.
I still don't understand how to setup Proxmox as a backup tool for daily automatic backups to a 2nd HDD I stuck in the Proxmox machine.
I would then use the 2nd physically separate computer with a 2 TB HDD for a monthly backup, by turning on the 2nd computer once per month and then transferring Proxmox's backups to the 2nd computer.
 
Thank you for the reply.
I still don't understand how to setup Proxmox as a backup tool for daily automatic backups to a 2nd HDD I stuck in the Proxmox machine.
I would then use the 2nd physically separate computer with a 2 TB HDD for a monthly backup, by turning on the 2nd computer once per month and then transferring Proxmox's backups to the 2nd computer.

This is the bit I don't understand.
One can always trick Proxmox by setting up a virtual machine to provide the NFS share, however such approach is not strongly recommended. If you are short on physical servers you can create a virtual machine and point it to use a separate physical hard drive; to do that specify the hard drive to be used in the qemu-server configuration file used by the virtual machine. For instance:
# nano /etc/pve/nodes/yournode/qemu-server/100.conf
# with the virtual drive the configuration will look like:
ide0: local:111/vm-111-disk-1.raw,size=5G
# to use the physical drive, change it to something like:
ide0: /dev/sdb
 
Maybe a Proxmox backup snapshot?
I ran a Backup on Proxmox to NFS for 19:00, but nothing happened?
Doesn't say what path Proxmox backed up to and what path the backup was sent to on the NFS computer.
 
Last edited:
first format your disk with ext4 Fs

--------------------------------------------------

next install NFS kernel server your node

cammand : apt-get install nfs-common nfs-kernel-server

--------------------------------------------------

next, create a folder on /mnt directory

command : mkdir /mnt/'directory_name'

and give it all permission

command : chmod 777 /mnt/'directory_name'

-------------------------------------------------

next, add the path for usb to exports file to be available later on NFS resources

cammand : nano /etc/exports

add this line on the end

/mnt/backup 192.168.87.0/255.255.255.0(acl,async,no_subtree_check,rw,root_squash)
your IP range / mask

------------------------------------------------

next, get Your disk UUID

command: blkid

copy that UUID

now we set our usb drive to mount on start up (if you eject the usb while the machine on you must restart the server or mount it manually)

command : nano /etc/fstab

add this line in the end

UUID=your_disk_uuid /mnt/'directory_name' auto nosuid,nodev,nofail 0 0

please make sure that all folder on your disk are (rw)

-----------------------------------------------

next reboot your machine

-----------------------------------------------

go create your NFS folder all should be fine
 
  • Like
Reactions: guletz

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!