BSD or Linux?

by Greg Lehey

In the last article, I started to look at the differences and similarities between BSD UNIX and UNIX System V. I had meant to continue with that discussion this month. But then something happened.

As you know, Wes Peters and I take turns to write articles in this column. From the beginning, we said that our style and our focus would be different, and so far we've kept to that. So two months ago I wrote about System V, and last month Wes wrote about Linux. The difference in feedback was striking: I had almost no feedback about System V, and it seems that Slashdot was overflowing with discussion about Wes' article. Obviously Linux is a more interesting topic, so in this article I'd like to follow up on some of the issues that were raised. I'll quote some of the messages sent to Slashdot.

Why do we need so many free operating systems?

Nathan asked one of the more common questions:
This article failed to answer the question that I've had for a while: if the two communities have so much in common, why is there a need for one or the other? According to the author, the Linux community handles the ``newbies'' and the oddball hardware, and the BSDers concern is security, portability, and stability. Why can't we combine the forces we have and come up with a platform that is secure, portable, stable, and well-supported (not to say that any one of the mentioned platforms does not yet fit this description)? To me, it seems as if the only thing that separates Linux advocates from *BSD advocates is the philosophy of software and the respective licenses that the platforms have been placed under; nothing more, nothing less.
somebody wrote:
OK, although I think that there's always merit in discussion and debate, I think we all need to take a breath and look at what the situation is here. The industry needs commonality, because we don't all have time to learn the nuances of 5 subtly different platforms. The successful vendors have been the ones to get others to follow their bandwagon, or jump on the strongest one and somehow influence it.

Developing software is too time-consuming to repeat n times for n platforms. Instead of arguing the merits of one platform vs. another, we should all be arguing over how best to provide a common platform for software development, that allows for multiple implementations to exist transparently. Users are gaining a common user interface with efforts like GNOME and KDE, but programmers need more commonality at the API to develop these applications.

It seems to me that it's time to consider merging BSD with Linux. This would lead to even more rapid development of Linux and more of that mythical buzz. It's time for the non-UNIX to become the ONE UNIX.

These are good points. Why don't we all pull on the same rope? There are a number of good reasons: Interestingly, there's a possibility that a new effort to merge BSD and Linux will arise: the Linux kernel with BSD userland. It's too early to know if it will fly, but if it does, it will increase the number of versions available, not reduce it.

The rabble-raisers and the snobs

An Anonymous Coward (Slashdot's name for somebody who doesn't want to reveal his name) wrote:
Well, well, not bad overall for a BSD fanatic. I suppose Linux has raving Anonymous Cowards, and BSD has patronizing snobs. Not sure which is worse. Wouldn't it be a nice world without both?
I suppose there's a bit of truth in this statement. I don't think it applies to Wes, but certainly some BSD users tend to look down their noses on Linux users, and there's a minority on both sides which takes delight in flaming those who have the audacity or stupidity to use a different operating system.

In the case of the BSD rabble-raisers, this isn't particularly directed towards Linux users. There used to be a fair amount of animosity within the BSD camps as well, and one of the prime objectives of Dæmon News has been to get BSD users to work together instead of against each other. In general, though, I think people are becoming less aggressive towards each other. I'd like to think that Dæmon News is helping here.

cthonous writes:

BSD seems to me a very insular community.
I suppose that depends on your point of view. I suppose the most interesting part of that statement is that he sees one BSD community: BSD is making a more unified impression. In general, though, I find that the communities are becoming less insular.

Horses for courses

Mr York writes:
This was a pretty good artical - although I felt it implied that Linux wasn't as good a server. They both have their good and bad aspects and I look forward to more sharing of code from both camps. So far, my experiance has shown me (caution, opinions start here):

Linux
-NFS server: not so good (is there any work being done on this?)
-SMB client: good
-SMP: good (could be better)
-Portability: good
-Ease of configuration: good (I love System V and kernel modules)
-RAID: never tried
-TCP/IP: good (I add this just because the older Linux kernel didn't do TCP/IP near as well as FreeBSD)

FreeBSD
-NFS server: good
-SMB client: not so good (I don't think kernel level support exists - ie smbmount. does it?)
-SMP: not so good
-Portability: not so good (use NetBSD - whole other topic)
-Ease of configuration: Ok (but I really wish they would move to System V - is it possible to make a disto that is System V?)
-RAID: good (I love vinum)
-TCP/IP: good I know, I know - some of my opinions are probably ill formed, please correct me where I may be wrong.

It's difficult to categorize these opinions. First, of course, the original article wasn't about the difference between FreeBSD and Linux, it was about the difference between the free BSDs (including NetBSD and OpenBSD) and Linux. But the real problem with this kind of statement is that there is very little factual information on relative quality. Things are looking better in this area: recently some Linux and FreeBSD people did some performance testing together. The main reason wasn't to compare the two operating systems: it was a threat from outside.
A few months ago, Mindcraft published some benchmark results claiming that Microsoft NT could outperform Linux as a web server by a factor of 2.5 to 1. The Open Source community immediately cried ``foul'' and checked up on the details, in that order. A number of people repeated the tests, notably PC Week, and found that yes, indeed, in the benchmark chosen by Mindcraft, NT does outperform Linux. We don't have any hard data for the BSDs, but it seems likely that they would not perform that much better.

What's this? Microsoft really does outperform free UNIX? In a word, yes. Of course, there's a but: this better performance isn't across the board. Some specific aspects of NT have been optimized to perform better than the Open Source UNIXes, specifically multi-threaded TCP/IP stacks and SMP support. Another test performed by the German magazine c't showed that the results were very dependent on the functions performed, but that Linux SMP performance was not as good as that of NT. Tests performed with FreeBSD showed that it probably would not measure up either.

The Mindcraft benchmarks have had an interesting result: until then, the Open Source community was convinced that all Open Source operating systems performed an order of magnitude better than Microsoft. Now we see that this is not always the case. By comparison with this shock, the differences that Mr. York perceives are pretty minor.

A more positive result of the Mindcraft benchmarks was that the followup tests included a significant degree of cooperation between the Linux and FreeBSD performance people. We don't have any specific results from this cooperation yet, but we can look forward to more cooperation in the future, and that should benefit all involved parties.

Simba writes:

Having used FreeBSD and Linux for a number of years now... well, I'll share my own opinion on the xBSD vs. Linux ball of wax.

Linux gets the nod from me for a desktop workstation. It's got the widest support of obscure hardware, multimedia support, graphics support, and so on.

xBSD (FreeBSD in perticular) gets the nod from me for serving. It is infinately more stable and secure then any flavor of Linux I've tried, out of the box, without any tuning. My Linux boxes are just fine for creating content, and mild serving. But, past experience has taught me not to trust them for serving huge mission critical projects.

This is quite a popular impression, but it's not one that I share. There are plenty of Linux servers out there, and most users are happy. You'll probably find others who say that they've had a lot of trouble with FreeBSD, and it went away when they installed Linux. In the majority of such cases, hardware incompatibilities are the cause of the problems.

As to workstations, the graphics support for both is XFree86, and it's identical for BSD and Linux. Yes, it's possible that Linux has support for more obscure hardware, but for 99% of all machines, you'd be hard pressed telling the difference between Linux and BSD. Try the equivalent of the Turing test: sit somebody down at a Linux or BSD machine running XFree86 and the fvwm2 window manager, remove some utilities such as dmesg and uname, restrict his access to some non-critical directories (/ and /etc, for example), and ask him to tell what kind of machine it is. If it walks like a penguin, quacks like a penguin, flies like a penguin, it could be... BSD.

More information, please

mjg wrote:
I don't know a huge amount about the specific details of FreeBSD, but I have briefly installed and played with it (and will do so again when I free up a machine for it). I would have loved to learn a little more of the specifics, e.g. how the task scheduling and memory management is handled compared to Linux, etc.
That's a valid point. We'll consider a followup article on the internal differences between Linux and BSD. One problem here is that we don't know Linux well enough. If any knowledgeable Linux person would like to help us there, please contact Wes or me.

Ease of installation

At the USENIX conference in Monterey, I was given a Debian Linux 2.1 CD-ROM set, so I installed it on my laptop to get an idea of what the Linux people are talking about. Surprise, surprise. It only took me half an hour to install FreeBSD on the same laptop, including getting XFree86 up and running. It took two attempts and several hours to install Linux. I'll report on this (and other installs) at some other time, but it's instructive to discuss why I had so much difficulty with Linux.

When it comes to installing FreeBSD, I wrote the book . I've probably done more FreeBSD installations than just about anybody. Although I have installed Linux before, this was my first Debian installation. Things are different, and I had to pay much more attention to the process. For example, both the BSDs and commercial UNIX install in a single partition and subdivide it into the partitions that they need.

The standard platform-independent scheme of four partitions that all PCs use was introduced by Microsoft. UNIX has had its own partitioning method since long before Microsoft started using disks, and it uses the same term. This double use of the word partition is confusing. In BSD, we call the Microsoft partition a slice.
As far as I can tell, Linux doesn't subdivide slices. This means that my Linux installation used up two of the four partitions in the partition table, one for the root file system and one for the swap file. The other two partitions are used by Microsoft and FreeBSD, so I couldn't have a /usr file system on the Linux installation.

Does this make Linux worse? Of course not. Admittedly, you could point to the fact that the BSD/UNIX way of partitioning gives you more flexibility, but how often do you really want to install multiple OSs on a single machine? And as far as the ease of installation goes, there's an important lesson to learn:

The first time I installed UNIX on a PC was about 10 years ago. It was SCO XENIX/386, and it was a real pain. The next time was about a year later, and the version was Interactive UNIX/386. In the 1992/1993 time frame I installed BSD/386, Consensys UNIX System V.4 and Univel UnixWare 1.0. None of these systems were easy to install; in fact, in this time frame the German magazine iX wrote a report on some PC UNIX variants and admitted that they had not been able to install any of them. Only shortly after that, I installed the first version of Linux. Not surprisingly, it was also painful. And I wasn't surprised.

Since then, free UNIX installations have become much easier, some more than others. My first XENIX installation required me to read in about 40 floppies and do a whole lot of work myself. For example, you needed a calculator to decide how to partition the disk. Even today, SCO requires you to create three boot floppies before installing UnixWare. By contrast, the free UNIX CDs I got at USENIX (Debian Linux, FreeBSD, NetBSD and OpenBSD) all booted straight from CD-ROM. This ease of installation means that you don't have to worry too much about understanding what you're doing. For example, nowadays the disk partition editors will do most of the calculations for you.

People are getting used to this ease of installation, and it means that you expect to be able to install without reading the instructions. If you're used to a particular kind of installation, any other kind will require you to think again, and that slows things down a lot. This has little to do with the relative quality of the installation mechanism.

A user who prefers to be anonymous writes:

While use friendliness is a topic that does not usually come up in discussions about unix, it warrants mention here.

Linux is by far the most user friendly unix out there. Usually bash is included as the default shell with the emacs key bindings already set up. BSD uses csh with no CLI editing configured. This is a major turn off to a newbie. This is just an example - this kind of user friendliness pervades linux and is totally absent from BSD (and commercial unices as well).

I suspect that even some Linux fans might disagree here. Yes, it's true that Linux supplies bash as the default shell, certainly a thing I approve of. I recommend it in my book. But this is an installation issue, not a user-friendliness issue. And setting up an Ethernet board is pretty much the same for each system.

I contacted this user and asked him in some more detail about the problems he had had. He was using a 3Com 3C509 Ethernet board, which is normally not a problem with FreeBSD. Since he no longer has FreeBSD on his system, it's not possible to diagnose the problem. It's not uncommon for people to have trouble with some board or another when installing a new system, of course. That's why each operating system group has a mailing list for people to ask for help.

He continues:

I remember when I first used linux, setting up my ethernet card was very easy. And I was utterly unix-clueless at the time. After a year of using linux, I decided to give FreeBSD a try and it took me quite a while to figure out how to set it up.

Linux has many little setup tools like linuxconf and the distributions usually include their own nice setup utilities.

Well, I hadn't heard of linuxconf, so I thought I would give it a try. Let's see...
=== grog@woodgate (/dev/ttyp0) /home/grog 1 -> linuxconf
bash: linuxconf: command not found
=== grog@woodgate (/dev/ttyp0) /home/grog 2 -> man linuxconf
No manual entry for linuxconf
=== grog@woodgate (/dev/ttyp0) /home/grog 3 -> locate linuxconf
=== grog@woodgate (/dev/ttyp0) /home/grog 4 -> uname -a
Linux woodgate 2.0.36 #2 Sun Feb 21 15:55:27 EST 1999 i686 unknown
=== grog@woodgate (/dev/ttyp0) /home/grog 5 -> 
It's clear what this means: linuxconf is part of the distribution that cthonous uses, but it's not available on every platform. On the other hand, it sounds like FreeBSD's sysinstall and UserConfig utilities.

Finally, he says:

BSD is very painful for someone who does not know unix. BSD might convert some people from linux, but it will never convert anyone from windows.
In fact, I think the average Microsoft user wouldn't see much difference between the Linux and BSD. And certainly BSD, like Linux, has enough converts from Microsoft.

What an organization!

Simba writes:
Don't get me wrong, I like Linux. However, the development structure is just too muddled. There's some excellent code, some good code, and some not so good code. FreeBSD (and call this snobbish if you will, but it works) has a 'tighter fist' as I put it on source, Open but it gets scrutinized more, as such it's stable and secure as a rock. Sure, explots show up (e.g. the 3.2 natd thing) but they are much less common then the Linux expolits which turn up. e.g. Teardrop, and the fistfull of other DoS attacks on Linux. Sure, they are patched within hours of being found, but with xBSD they generally aren't there to begin with.

FreeBSD, from the people who brought you TCP/IP.

From what I've seen, I'd agree that FreeBSD has tighter code control. One member of the core team spends most of his time checking other people's code (and usually finding it wanting). While this can be frustrating when you're at the receiving end, it makes for better, more consistent code.

Where does that leave us?

We've looked at a lot of viewpoints in this article, and now I should finish by making a pronouncement about why BSD is better than Linux, or something like that. But things aren't that easy.

The fact is, we're still all discovering what is happening. The Open Source movement has changed dramatically since the early days of Linux and 386BSD, and it's showing no signs of slowing down: if anything, the pace is increasing. People are changing too. More and more people are working full time on Open Source projects. This has two important results: the communication between the groups is getting better, and it is becoming more mature in its nature.

What does this mean for you? One obvious thing is that, whatever Open Source operating system you're using, you probably don't want to change. If you do, you'll need a reason. I hope that this article has given you one: I'd like to think that you'll enjoy using BSD more than Linux. But that's just my opinion, and it's more likely that this article has just raised new questions.

But, you will say, Wes described good reasons for moving from Linux to one of the BSDs. Not really: in fact, he described the features that each development team considers important. For example, OpenBSD concentrates on security; does that mean you should drop your NetBSD or Linux system and move to OpenBSD? Probably not; the NetBSD and Linux developers (especially NetBSD) are monitoring what goes on in OpenBSD, and any important advances in OpenBSD find their way into other operating system. FreeBSD concentrates on performance and stability. Should you drop your Linux or OpenBSD system and move to FreeBSD? Probably not. All UNIX-like systems are becoming more stable, hardware is getting faster, and unless you have a particular need, the hassle of changing may be more than it's worth. In summary: hold on and enjoy the ride. All four operating systems will be hardly recognizable in two years' time.