A standard OpenBSD install works well. X is not necessary, but easier to just install it, the full OpenBSD install will still be smaller than a minimal Linux install. On OpenBSD, you will have to add rsync.
You want two directories hanging off root, one for all IBS backup volumes, the physical storage space, and one for $IBSROOT, which is where your system managers will be looking for data. The idea is ALL your backups should be visible in $IBSROOT, even though the individual backups are stored elsewhere. I use these:
There are some mount options I would suggest using with your backup partitions:
I'm using a simplified version of the standard OpenBSD layout -- missing are the X partitions (while X is loaded, it's not used, and I don't see a benefit for separate X partitions here), there's no /usr/local directory. That's a bit risky -- OpenBSD enforces Write^Execute(# df -h Filesystem Size Used Avail Capacity Mounted on /dev/sd4a 554M 207M 320M 39% / /dev/sd4g 38.7G 20.0K 36.8G 0% /tmp /dev/sd4h 3.9G 1.6G 2.1G 42% /home /dev/sd4d 5.8G 1.8G 3.8G 32% /usr /dev/sd4e 7.8G 1.9G 5.4G 26% /var /dev/sd3o 61.4M 2.0K 58.3M 0% /bu /dev/sd3p 61.4M 8.0K 58.3M 0% /v /dev/sd4i 2.1T 1.9T 129G 94% /v/1 /dev/sd5d 7.2T 5.5T 1.3T 81% /v/3 /dev/sd5j 1.3T 330G 895G 27% /v/2
You may notice /tmp and /var are kinda big -- that's because OpenBSD includes a locate command which takes a lot of /tmp and /var space to rebuild its database on a big IBS system (remember: you might have the same file showing up in 20+ different locations!). It took me several iterations to get this to a good size. Lots of big files aren't as bad as lots of tiny files -- and I have a lot of backups of my mail server with a decade of e-mail on it.
As I always recommend, there's some unallocated space not shown here. In that way, if I later find out that I made something too small or I needed that /usr/local or other partition, I've got space available. In this case, I have over 150G unallocated, pretty much anything I need to change, I can change with that available.
[root@ibs-linux ~]# df -h -txfs -text4 -T Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/rl-root xfs 2.0G 67M 2.0G 4% / /dev/mapper/rl-usr xfs 5.0G 1.1G 4.0G 21% /usr /dev/sda2 xfs 1014M 326M 689M 33% /boot /dev/mapper/rl-var xfs 5.0G 166M 4.9G 4% /var /dev/mapper/rl-tmp xfs 5.0G 69M 5.0G 2% /tmp /dev/mapper/rl-ibs ext4 2.8M 14K 2.5M 1% /ibs /dev/mapper/rl-v ext4 2.8M 16K 2.5M 1% /v /dev/mapper/rl-home xfs 5.0G 68M 5.0G 2% /home /dev/mapper/ibs_vg-ibs1 xfs 2.0T 15G 2.0T 1% /v/ibs1 /dev/mapper/ibs_vg-ibs2 xfs 2.0T 15G 2.0T 1% /v/ibs2
Default location and file name is correct, and you don't want to enter a password.# ssh-keygen -t ed25519 Generating public/private ed25519 key pair. Enter file in which to save the key (/root/.ssh/id_ed25519): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_ed25519 Your public key has been saved in /root/.ssh/id_ed25519.pub The key fingerprint is: SHA256:uHlLOeCTWG50uFGJgnBtE+U5bbT0BlmGgxsc1dtwYNE root@ibs-linux The key's randomart image is: +--[ED25519 256]--+ |. ...+o+==*+ | | o .+.+*+Bo E | | ....=o*.o= | | ..* .. . | | B S | | * O . | | . X = | | . + o | | . | +----[SHA256]-----+
The public key file will look like this:
The last field (root@ibs-linux) is a comment -- make sure it indicates where the key came from.# cat /root/.ssh/id_ed25519.pub ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIMJWzOZ7/g/nCEwfTJ04WepP3I9pYj5wOMiPRQZwqcf root@linux-ibs
Assuming your backup server is coming from a fixed IP address, you may wish to restrict the public key to that IP:
Place this line to the ~root/.ssh/authorized_keys file on your systems you are backing up.from=192.168.1.29" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIMJWzOZ7/g/nCEwfTJ04WepP3I9pYj5wOMiPRQZwqcf root@linux-ibs
Make a log directory. The logs could be stored in one of your backup volume directories, or put into an appropriate /var/ directory. Up to you. I put a symlink /bu/z-logs pointing to the IBS log directory (which in my case is /var/log/ibslogs). I find it convenient, but it can also be "wrong", since it isn't a real backup directory.
So...let's assume we will put config files in /etc/ibs and log files will physically be in /var/log/ibs, but will be accessable by symlink in /ibs/z-logs:
Run# mkdir -p /var/log/ibs /etc/ibs # ln -s /var/log/ibs /ibs/z-logs
(btw: if you get something like: bad interpreter, your first line of the script needs to be changed!)# ibs -template Template ibs.config file has been generated in current directory. Populate it, and copy it to /etc/ibs/ibs.config
Look at the comments in the file and set things according to your needs. Copy the edited file to /etc/ibs. World-readable should be fine, really not too many secrets on a system like this.
You need a default backup filter template file, /etc/ibs/default.bufilter. Here's mine, which works ok for basic OpenBSD backups:
The basic premise here is that we want things starting at root, but skipping some directories that we really don't need in the backup. If something is mounted on /mnt, we don't care. You may wish to exclude /usr, but compared to everything else on a typical system, it probably isn't that big, and you very often have important stuff hidden away (for example, administrative scripts in /usr/local!).+ / - /bin - /sbin - /dev - /lib - /lib64 - /mnt - /media - /proc - /run - /sys
rsync filter files are a bit confusing, so there's a whole dedicated page here for that.
At this point, you are ready to start building backup target directories and do your first test backups.
Install the IBS root public key into the target system's root user's
authorized_keys file
Verify you can login as root from the IBS system to the backup target. The first time you do so, you will need to verify that you trust the remote system key.
Prep the IBS backup directory by running the -prep option, specifying the directory on a physical storage device you want the backup to end up on -- something like /v/ibs1:
Assuming no errors, you are ready for a test "First Backup!"# ibs -p /v/ibs1/newserver
this will launch a backgrounded backup of "newserver". Repeate the key installation, test login, and ibs -prep for all the rest of your servers.# ibs newserver
If you stagger your backups, you can also create individual list files -- for example, I have some backups I run daily, others I run only periodically, so I have a daily.list in addition to all.list. This works nicely so that my IBS reports are typically run against all.list, but daily I run against daily.list.
Now, I have in my root crontab this:
The daily job kicks off at 4:01am, the report is printed a little before 7:00am, and the big archive job is run every four days at 9:01am. Note that the way cron works, days are based on 1, not zero, so */4 means 1, 5, 9, etc., so the ME backups are handled pefectly without any extra effort. Not all unixes take the */4 notation, however.01 4 * * * /usr/local/sbin/ibs daily.list >/tmp/ibs-daily.out 01 9 */4 * * /usr/local/sbin/ibs archive > /tmp/ibs-archive.out 58 6 * * * /usr/local/sbin/ibs -report all.list >/tmp/bureport.out 2>&1
I could have root mail out the report, but for personal reasons, I wanted the mail to come from my personal account, not from root@ (long story). So, I have IBS dump the output into /tmp, then I have a separate cronjob to mail it to me from my own account:
I'm not sure that was worth the effort.0 7 * * * mail -s "IBS backup report" nick
IF you put other third party apps on the system, adding a wxallowed partition for /usr/local may be needed, but because of the sensitivity of this system, you don't want to add apps that might introduce vulnerabilities to the system. For example, don't put a web browser on here. Just don't. So if your application doesn't run without a wxallowed partition, maybe it shouldn't be here.
2. Root file authorized_keys location : This will vary from OS to OS. In general, it's in the root user's home directory. On OpenBSD, that's /root/.ssh/authorized_keys, on AIX, it's /.ssh/authorized_keys. For reasons unrelated to IBS, consider putting your keys in a common directory (I have used /etc/ssh/keys) using the AuthorizedKeysFile option in sshd_config.
Incremental Backup System home
Page
Contact Holland Consulting
since August 8, 2022
Page Copyright 2022, Nick Holland, Holland Consulting.