Skip to main content

Backup to NFS Mount Questions

Comments

16 comments

  • uk01
    Hi we do backups to nfs for the same space reasons. I don"t think you can use additional local directory as it"ll still back up locally first. We have the cpanel servers saving directly to the nfs server with incremental backups, they then copy the files to 2 remote locations. Our nfs is another vm in a vitalised environment on the same host, but I think nfs4 has better security. We restrict incoming ip"s on the nfs vm to justcthe host servers, then on the cpanel host servers allow the nfs. One thing, you may need to set no_root_squash in etc/exports, not usually recommended but without that we had permission errors especially if zipping the system files. Probably only affects incremental when system files are copied to remote. All in all it works well and solves the space issue on the cpanel vms. Unfortunately if you choose to retain the files on the nfs it"ll retain all of them, cpanel does not allow us to control what we retain. I guess you could create a cron script to delete some on the nfs? Hope this helps!
    0
  • cPanelLauren
    Hi @ronaldst While You can use NFS I do want to point out that we don't officially support it. This is noted here: Backup Configuration - Version 68 Documentation - cPanel Documentation You may want to be aware as well of the other warnings/info associated with different backup types as detailed in the above documentation.
    0
  • uk01
    Absolutely, cpanel doesn't support it, but for many years local backup space has been an issue. We virtualise servers to make better use of CPU resources to avoid leaving so much unused, so why have premium SSD and only be able to use half of it. Local backups are more problems than the risks of NFS. It'll check the local space at the beginning of the backup and fail the whole backup if not enough, how much is enough, if you use SSD on a 100mb connection, you need more as it backs up quicker than it transfers and crashes the server when full. At least with NFS that risk and management of space is removed. We can then have cpanel servers running at 80-90% capacity if required. OP another way which is more supported is to mount another drive to the cpanel server for backups (if you have a spare slot on dedicated) or a remote drive on virtual, but you need this for each VM whereas NFS mount can be shared - (different folders all allowed by IP) It's discussions like this which push development and ideas, so even though not supported, it's still a important area of hosting.
    0
  • ronaldst
    I am currently testing NFS mounting a backup directory now, and so far it seem to be working well. I am actually thinking that cPanel have not properly solved the challenges regarding backups with the current version of WHM. Being able to control the amount of locally stored backups is such a basic feature, and vital to space management on any server. Retention settings on remote destinations are working flawless, and different type of retentions can be set up for different types of backups. I am thinking that that retention settings of local and remote backups should be separated. Allow one type of retention on local storage, and another on remote storage. Alternatively, implementing a way of restoring backups from remote destinations, similar to the one available when files are stored in the local backup directory. I am thinking this would benefit most server setups using WHM, either being dedicated servers or virtual ones. Is there anything planned (within the development team) to update the backup system?
    0
  • ronaldst
    I discovered that the NFS mount used for backup have file permission issues. All the files are set to owner 100, group users (100:users). This allows any non-jailed shell user to access the files.. @
    0
  • metalsmiley
    Hi, Did you found a solution about this issue ? I'm having the same problem on ovh. Thanks
    I discovered that the NFS mount used for backup have file permission issues. All the files are set to owner 100, group users (100:users). This allows any non-jailed shell user to access the files.. @
    0
  • uk01
    Hi yes I found a solution, it"s worked perfectly all year. I"ll check it and post back. Sorry I must have missed the last post last year!
    0
  • uk01
    Here you go /backupfolder 0.0.0.0(rw,sync,no_subtree_check,no_root_squash) Ensure your etc/export file on the nfs server has the above line, the no root quash resolves the permissions issue. It basically gives the server root rights within the backup folder. Replace the ip with the ip of the server you are backing up. Hope this helps!
    0
  • Netcrusher

    I know this is an old thread, but I want to know how can you use NFS doing incremental backups, exported with sync. I've tried converting from compressed to incremental and it's extremely slow, unusable. It works fine for large files, but not for small ones. Converting to async solved my problem but I don't know if it's reliable enough to use it like this.

    0
  • cPRex Jurassic Moderator

    Netcrusher - as far as cPanel is concerned, our support for NFS hasn't changed, so you're welcome to try it but do some testing with your specific implementation first before you rely on it.

    0
  • Netcrusher

    cPRex yes, I know, the question was for uk01. Thanks!

    0
  • uk01

    We used nfs for a while but it was slow and used too many resources.

    We now use sshfs again, the latest version is ok with symlinks.

    This has worked well for several years with incremental and is much easier to set up as you’re literally just using ssh to directly access a remote server

    Here’s the command to load the folder
    (You can also use fstab and ssh keys)

    sshfs -o nonempty -p 22 root@12.345.678.9:/root/remotefolder/ /localbackupfolder

    0
  • Netcrusher

    Right now, I'm testing async NFS which works really well. Working with large files, NFS sync was also pretty ok. Thank you very much for your response and tips!

    0
  • uk01

    You’re welcome.
    NFS has probably improved since we used it too.
    If I remember right, with nfs you just have to be careful with ownership / permissions on the remote files when backing up cpanel users

    0
  • Netcrusher

    If you're using no_root_squash everything is owned by root, so there are no issues.

    0
  • uk01

    That rings a bell, I remember, it does 👍

    0

Please sign in to leave a comment.