Skip to content

Why I'm using OpenBSD rather than Linux

Introduction
I used various flavours of Linux for many years, but since 2014 I've changed to OpenBSD. This happened more or less by accident. I first installed OpenBSD largely from curiosity, not dissatisfaction with Linux. But the more I used it the better I liked it. until I finally installed it on all my computers.

At first I kept one laptop running Linux so that I could use Adobe Flash and Skype, neither of which run on OpenBSD. But Flash is no longer maintained for Linux and the sites that demand it (fortunately a decreasing number) complain that the version on Linux is too old. Skype is no longer available for 32-bit machines (like mine) so that is no longer a reason for me to keep Linux.

OpenBSD is often praised for its security but that wasn't what attracted me initially. I didn't think myself to be particularly vulnerable, but I've changed my mind somewhat now in view of the increasing quantity of internet fraud and the number of ISPs and other holders of data whose security has been breached (TalkTalk is the latest example as I write). OpenBSD gives me a degree of confidence, though I hope not complacency.

There is a different kind of security that I also care about: what to do if everything goes wrong. Recently I stupidly managed to delete my /etc directory, thus rendering my system unbootable. I regularly backup /home both to tarsnap and to another computer on my local network, but of course I needed to reinstall the system. OpenBSD is the easiest OS to install that I've ever used, so reinstalling took only about half an hour. I still had to fetch the third-party packages that I use, but I keep a list of those so I knew what I needed to get. Best of all, I didn't even need my backup of /home; OpenBSD helpfully sets up a separate /home partition by default and I didn't need to overwrite this during the reinstall. Recovery from my mistake was therefore relatively painless.

I could have done all this on ArchLinux or Debian too, but installing those takes longer.

Using OpenBSD as a desktop
I find that OpenBSD works well as a desktop OS. Any disadvantages? I've already mentioned Flash and Skype, both of which have security risks so you are better off without them if they are not essential. Arch and Debian have more packages than OpenBSD but in practice this hasn't made much difference to me. Arch is more bleeding-edge than OpenBSD, even the -current flavour (branch) I use, but again that hasn't been a problem. And I like the *BSD concept of having a unified base system, which even includes X in the case of OpenBSD.

The stability of OpenBSD is excellent. The -current flavour, which I use, is roughly comparable with Debian unstable, which does occasionally spring a surprise on you, but in almost 3 years I've never had any major problems with OpenBSD.

None of this is meant as a criticism of Linux, which, as I say, I used happily for many years.

Conclusion
There's a lot more to say about OpenBSD as a desktop OS, including why I find it works better for me than does FreeBSD, but I have other posts about that and I won't repeat myself here. Please use the tags to read more.



Tarsnap - deleting unwanted archive-files

I backup my system with tarsnap every night via crontab, using the following command to make files with date stamps.

tarsnap --exclude [any-files-not-to-backup] -c -f arcadiabackup-`date +%y%m%d` /data-to-backup

After some days this produces archive-files of the following character as seen with tarsnap --list-archives.

arcadiabackup-131101
arcadiabackup-131102
arcadiabackup-131103
arcadiabackup-131104

(In practice, the files will not always be in the correct date order as they are in this example.)

The problem
After several months I ended up with over 100 archive files and this resulted in my paying for more space than I needed.

You can delete files with a command such as:

tarsnap -d -f arcadiabackup-131201

When you have a lot of files to delete this will take a long time if you delete each one separately, and tarsnap doesn't allow the use of wildcards. But you can have more than one -f and this offers a quicker route.

The solution
I have worked out a semi-automatic method which I now describe. It would be possible to make it fully aujtomatic by using python or a similar language and I may do that one day, but for the moment this works for me. Here are the steps.

(Note: my editor is vim. If you use a different editor, such as emacs, you'll have to adapt the steps for that.)

1. Make a list of all the archive-files and save it as, e.g., archivelist.

tarsnap --list-archives > archivelist

2. Make an executable script called, e.g. tarsnap-delete. It should contain the following lines initially:

#!/bin/sh

tarsnap -d

3. Import archivelist (made in Step 1) into tarsnap-delete.

It will now look something like this.

#!/bin/sh

tarsnap -d
arcadiabackup-131101
arcadiabackup-131102
arcadiabackup-131103
arcadiabackup-131104

4. Now delete all the entries that you DON'T want to remove from the tarsnap archjive. E.g. in this case you might delete the newest two entries (arcadiabackup-131103 and arcadiabackup-131104).

5. You now want to insert -f before each remaining archive file. In vim you can do it like this:

:%s/arcadia/-f arcadia/g

Your file will now look like this:

#!/bin/sh

tarsnap -d
-f arcadiabackup-131201
-f arcadiabackup-131102

6. Almost there! Now we just format all the entries into a single paragraph:

gqip

It will now look like this:

#!/bin/sh

tarsnap -d -f arcadiabackup-131101 -f arcadiabackup-131102

(Note: if you have a lot of entries, you will need to do

:set tw=1000

to avoid unwanted breaks in the command line.)

7. You can now save and exit vim, after which executing the file tarsnap-delete will delete all the archive files you selected.








Backing up with tarsnap

I have to say that I'm mostly unhappy about putting important personal stuff on the "cloud". At the same time, the thought that everything might be lost if a disaster occurred here is not nice either. So recently I looked into several places for storing files but they all had difficulties of one kind another. Many didn't work for linux, and of those that did, either there were problems using them or the security was suspect, or both. One which I liked had a scheme for distributed storage on people's computers. Admittedly the files would be broken up and encrupted, but still I didn't like the idea. I wouldn't put my own stuff out there and I wouldn't want other people's files on my system.


Then I looked at Tarsnap (Online Backup for the Truly Paranoid), which is different. Security is at its heart and it doesn't even run on Windows (except with Cygwin)! It also has a very reasonable pricing system - you only pay for what you use. So if you are similarly thinking about off-site storage and you use Linux or FreeBSD, have a look at tarsnap.

From the tarsnap home page

Tarsnap is a secure online backup service for BSD, Linux, OS X, Minix, Solaris, Cygwin, and probably many other UNIX-like operating systems. The Tarsnap client code provides a flexible and powerful command-line interface which can be used directly or via shell scripts. ... With five minutes to download and install Tarsnap and $5 for an initial deposit, you can get started with Tarsnap today and stop worrying about whether your data is safe.