20 August 2007

We Meet Again, Mr. BSD

Over the weekend, while weathering a cat.5 thunderstorm called "wife", I managed to finally install OpenBSD on the spare machine I got from a friend. These are my thoughts on the experience.

I had a few run-ins with *BSD flavours in the past (especially NetBSD, with which I was, for a few months, slightly obsessed when I was 19). I honestly didn't remember the "disklabel(8)" thing, which is, at the same time, quite an ingenious device and a fairly big PITA. The concept is that FFS, (the filesystem used by BSDs -- from what I understand, a variation on UFS) doesn't really need more than one primary MBR partition, and doesn't really want to deal with "classic" (DOS) logic partitions either. They take one primary partition and "slice" it in "labels", basically implementing their own logical partitioning scheme. This is all fine and dandy, but unfortunately the tools for this sort of slicing are really bare, and still force you to work with cylinders and heads and sectors; party like it's 1981!
Something slightly more intuitive, like cfdisk(8), would work wonders for adoption rates, but it's clear that the OpenBSD project doesn't really care about adoption rates(which is fine, their priorities are different).
So, the main giveaway is this: don't try to do anything clever, just get a big primary partition and leave other filesystems alone.

Once past this initial hurdle, however, installation is incredibly easy, and will leave you with a bare system in which everything is turned off, apart from (optionally) the OpenSSH server. This is perfect for a server machine, and that was exactly my aim for this box. 

OBSD's hardened version of Apache comes preinstalled, but I had to install Subversion, Python, MLDonkey and a few other apps, so had to learn a little bit about pkg_add(1) (ah, memories of Slackware here...). Apparently, you can configure it to automatically download binary packages (pkg_add -i), but somehow I missed this and ended up manually downloading the binaries, which was a bit slow. I didn't attempt to get java, I understand you have to compile it from sources and can take ages. I did setup the ports source tree, though, and successfully built a couple of utilities, just for kicks; being a predecessor to the Gentoo "portage" system, it looks like a simplified version of it, and works fine.

Samba was so easy to set up, it wasn't even funny.

The only thing I didn't manage to fix, being a newbie admin when it comes to serious stuff, is DNS. This machine will not act as DHCP server (have an integrated router for that), but I'd like it to work as nameserver for the other computers in the LAN. I read a few howtos here and there, but they either cover a dhcp+dns configuration or pure Internet-facing stuff, which is not what I want. Any pointers would be appreciated.

Now I just have to buy a wireless card for it, being careful to get a supported one (either this Netgear WG311 or the Edimax EW-7128G), and then I'll finally have an always-on box to use for downloads, mp3 streaming, svn repository etc etc. Who knows, I might even expose ssh and apache to the Internet. Scary! :)

Technorati Tags: , , , ,


Unknown said...

You're trying too hard to get DNS working, I think. It's in the base system, but not started by default. To get it going on startup:

echo named_flags >> /etc/rc.conf.local

Ok, you're done. It should allow recursive queries from machines on the local network by default.

Anonymous said...

Having one large partition is a bad thing, if you have misconfigured your logging and it fills up you /var, there is no limit to how far it will go, it will fill your whole disc. It is always good to have /, swap, /tmp, /home, /etc/, and /var as seperate partitions.

toyg said...

Darrin, thanks a lot, that worked perfectly! :)