ugh.book

(singke) #1
UFS: The Root of All Evil 277

inconsistencies when directory hierarchies are replicated.
Filenames that were linked in the original hierarchy are no
longer linked in the replica...

This is actually rather an understatement of the true magnitude of the
bug. The problem is not just one of “inconsistencies”—in point of
fact the copy may be infinitely large if there is any circularity in the
symbolic links in the source hierarchy.

The solution, as any well-seasoned Unix veteran will tell you, is to
use tar^6 if you want to copy a hierarchy. No kidding. Simple and ele-
gant, right?

Disk Usage at 110%?


The Unix file system slows down as the disk fills up. Push disk usage much
past 90%, and you’ll grind your computer to a halt.


The Unix solution takes a page from any good politician and fakes the
numbers. Unix’s df command is rigged so that a disk that is 90% filled gets
reported as “100%,” 80% gets reported as being “91%” full, and so forth.


So you might have 100MB free on your 1000MB disk, but if you try to
save a file, Unix will say that the file system is full. 100MB is a large
amount of space for a PC-class computer. But for Unix, it’s just spare
change.


Imagine all of the wasted disk space on the millions of Unix systems
throughout the world. Why think when you can just buy bigger disks? It is
estimated that there are 100,000,000,000,000 bytes of wasted disk space in
the world due to Unix. You could probably fit a copy of a better operating
system into the wasted disk space of every Unix system.


There is a twist if you happen to be the superuser—or a daemon running as
root (which is usually the case anyway). In this case, Unix goes ahead and
lets you write out files, even though it kills performance. So when you have
that disk with 100MB free and the superuser tries to put out 50MB of new
files on the disk, raising it to 950 MB, the disk will be at “105% capacity.”


(^6) “tar” stands for tape archiver; it is one of the “standard” Unix programs for making
a tape backup of the information on a hard disk. Early versions wouldn’t write
backups that were more than one tape long.

Free download pdf