Skip to content

Instantly share code, notes, and snippets.

@gairys
Forked from dbirks/centos-zfs-urbackup.md
Created August 24, 2019 14:04
Show Gist options
  • Save gairys/274527c73a6f145835aa3de4b1e37e1b to your computer and use it in GitHub Desktop.
Save gairys/274527c73a6f145835aa3de4b1e37e1b to your computer and use it in GitHub Desktop.
Install Urbackup on CentOS 7 using ZFS

Installing Urbackup on CentOS using ZFS

Here's the details on installing Urbackup on the ZFS file system on the stable CentOS 7.

  • Install CentOS 7. I'll be using the Minimal install.
    • Once you have the .iso, write it to a CD or USB drive. I recommend using Rufus if you're on Windows to write it to USB.
    • Go ahead and boot to it.
    • Most of the defaults on the Installation Summary page should be good. However you will want to:
      • Confirm the time zone is correct.
      • Click the disk you want to install to.
      • Enable the network and set a hostname.
    • On the next page, set a root password and make a user account.
      • Check the box to make the user administrator.
    • After it's finished installing, reboot and log in as the user you created.
  • (Side note, you may want to ssh into your machine now to make copy and pasting commands easier.)
  • First thing you'll want to do is get your system up to date with sudo yum update
  • Install some other programs with sudo yum install vim wget
  • Install ZFS using the guide here. I'll list the commands below as well.
  • Download the package: sudo yum localinstall http://download.zfsonlinux.org/epel/zfs-release$(rpm -E %dist).noarch.rpm
  • Add zfsonlinux's gpg key with gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
  • Modify the repo file with sudo vim /etc/yum.repos.d/zfs.repo so that zfs-kmod is the only repository enabled. The guide mentioned above might make it more clear.
  • Install ZFS with sudo yum install zfs
  • Enable the ZFS kernel module with sudo modprobe zfs
  • Now we can create a pool of disks.
  • Check which disks are available with lsblk. The disk with your OS on it will probably be sda, with the other disks being sdb, sdc, or the like.
  • I just have one disk right now, so I'm going to create a pool named ocean with the command sudo zpool create ocean sdb -f
    • The -f flag is to force an overwrite of data. It is very important to double-check that sdb is referring to the actual disk you want to erase.
  • I am also going to enable compression with sudo zfs set compression=lz4 ocean
  • By default, your pool will now be mounted at /ocean.
  • Now we can install Urbackup.
  • Set up uroni's repo.
    • Change directories into the repo listings with cd /etc/yum.repos.d/
    • Download the repo config file with sudo wget http://download.opensuse.org/repositories/home:uroni/CentOS_7/home:uroni.repo
  • Install Urbackup with sudo yum install urbackup-server
  • Start Urbackup with sudo systemctl start urbackup-server
  • Enable it to start on boot with sudo systemctl enable urbackup-server
  • Make a subdirectory for Urbackup to store its files in with sudo mkdir /ocean/urbackup
  • Give ownership to the urbackup user with sudo chown urbackup:urbackup /ocean/urbackup
  • Now we can configure Urbackup.
  • Go to the web config page at http://hostname:55414.
  • Under Settings, you'll want to change the backup storage path to /ocean/urbackup.

That completes the server setup! You'll want to install the clients on each of the machines now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment