228 System Administration system because the boot process will clear out all the crud that accumulated in the /tmp directory. So now you know why the boot process cleans out /tmp. Making a “large” partition containing the /tmp directory, for the times when a program may actually need all that space to work properly, just moves the problem around: it doesn’t solve anything. It’s a shell game. That space so carefully reserved in the partition for the one or two times it’s needed can't be used for things such as user files that are in another par- tition. It sits idle most of the time. Hey, disks are cheap these days. But no matter how big you make /tmp, a user will want to sort a file that requires a a temporary file 36 bytes larger than the /tmp partition size. What can you do? Get your costly sysadmin to dump your whole system to tape (while it is single-user, of course), then repartition your disk to make /tmp bigger (and something else smaller, unless buying an additional disk), and then reload the whole system from tape. More downtime, more cost. The swap partition is another fixed size chunk of disk that frequently turns out not to be large enough. In the old days, when disks were small, and fast disks were much more expensive than slow ones, it made sense to put the entire swap partition on a single fast, small drive. But it no longer makes sense to have the swap size be a fixed size. Adding a new program (espe- cially an X program!) to your system often throws a system over the swap space limit. Does Unix get unhappy when it runs out of swap space? Does a baby cry when it finishes its chocolate milk and wants more? When a Unix system runs out of swap space, it gets cranky. It kills processes without warning. Windows on your workstation vanish without a trace. The system gives up the ghost and panics. Want to fix the vanishing process trick prob- lem by increasing swap space? Get your costly sysadmin to dump your whole system to tape (while it is single-user, of course), then repartition your disk to make /swap bigger, and then reload the whole system from tape. More downtime, more cost. (Sound familar?) The problem of fixed size disk partitions still hurts less now that gigabyte disks are standard equipment. The manufacturers ship machines with disk partitions large enough to avoid problems. It’s a relatively expensive solu- tion, but much easier to implement than fixing Unix. Some Unix vendors now swap to the file system, as well as to a swap partition, which helps a bit, though swapping to the file system is much slower. So Unix does progress a little. Some Unix venders do it right, and let the paging system dynamically eat into the filesystem up to a fixed limit. Others do it wrong and insist on a fixed file for swapping, which is more flexible than refor- matting the disk to change swap space but inherits all the other problems. It also wreacks havoc with incremental nightly backups when using dump,
Disk Partitions and Backups 229 frequently tripling or quadrupling the tape used for backups. Another addi- tional cost of running a Unix system. Partitions: Twice the Fun Because of Unix’s tendency to trash its own file system, early Unix gurus developed a workaround to keep some of their files from getting regularly trashed: partition the disk into separate spaces. If the system crashes, and you get lucky, only half your data will be gone. The file system gets trashed because the free list on disk is usually incon- sistent. When Unix crashes, the disks with the most activity get the most corrupted, because those are the most inconsistent disks—that is, they had the greatest amount of information in memory and not on the disk. The gurus decided to partition the disks instead, dividing a single physical disk into several, smaller, virtual disks, each with its own file system. The rational behind disk partitions is to keep enough of the operating sys- tem intact after a system crash (a routine occurrence) to ensure a reboot (after which the file system is repaired). By the same reasoning, it was bet- ter to have a crashing Unix corrupt a user’s files than the operating system, since you needed the operating system for recovery. (Of course, the fact that the user’s files are probably not backed up and that there are copies of the operating system on the distribution tape have nothing to do with this decision. The originalversion of Unix sent outside of Bell Labs didn’t come on distribution tapes: Dennis Ritchie hand-built each one with a note that said, “Here’s your rk05, Love, Dennis.” (The rk05 was an early removable
Previous Page Next Page