Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Absolute BSD - The Ultimate Guide To FreeBSD (2002).pdf
Скачиваний:
29
Добавлен:
17.08.2013
Размер:
8.15 Mб
Скачать

Note If you're building a Web server, where each Web site has its own user and home directory, assigning the rest of the disk to /usr might not be a great idea. In such a case, using 3GB of hard drive space for /usr will more than suffice for just about any use, and you can assign the remainder to /home, the partition for users' home directories. Doing so segregates their files from the system, and file access speed is generally unimportant once it exceeds a certain acceptable minimum.

When you finish, the Disklabel menu will look something like Figure 1.8.

Figure 1.8: Disklabel after partitioning

A Second Hard Drive

If you have a second hard drive of comparable quality to your main drive, you can make good use of it if you plan properly. First, use the outer edge of the drive for swap, as discussed earlier in the "Swap Splitting" section. Use the rest of the drive to segregate your data from your operating system. Do this by assigning the remainder of the drive to the partition that stores files for whatever your server is for. If it's a mail server, use the second drive for /var or /var/mail. If it's a Web server, make it /www or /home. If it's a network logging host, assign the second drive to /var/log.

In general, segregating your operating system from the data you're serving will increase system efficiency. Like all rules of thumb, this is debatable. But no sysadmin will tell you that this is an actively bad or dangerous idea, whereas they can argue endlessly about other variations on drive usage.

If you have no idea what your server will be for, make your second drive for /usr and use most of the space on your first drive for /var.

If your second drive is much slower than your main system drive, don't bother using it. Not only will its performance not be that good, chances are that it is much older than your main drive and more likely to fail.

The FreeBSD installer will detect all of your system hard drives when it boots, and it will give you the opportunity to partition each and every one.

27

Soft Updates

FreeBSD includes a bunch of fancy filesystem tricks collectively known as soft updates. We'll learn more about soft updates in Chapter 13. For now, just accept that enabling them during the install is a good idea. If you learn about soft updates and decide that you don't like them, you can easily disable them. We'll learn about that in Chapter 13 as well.

Arrow down to select each partition, and press S. This will enable soft updates.

Block Size

This section contains options that can really impair system performance. If you're new to FreeBSD, take the defaults! This is for experienced UNIX administrators who know exactly what they're doing.

Block size refers to the minimum size of a file. If you have a file that contains just one tiny character, it uses one whole block, even if it barely fills that block. By the same token, if your file is just over the block size, it takes up one block and a fragment of another. Each block can be divided into fragments, so that multiple, slightly oversized files can use one block to store their extra tidbits.

FreeBSD defaults to 8KB blocks. If you're creating a large partition—say, 1GB or more—use 16KB blocks. When you do this, you also need to change your fragment size. The FreeBSD file system (UFS, or UNIX File System) works best with fragments one−eighth the size of a block. This would be 16,384−byte blocks and 2,048−bit fragments.

Set the block size with the newfs program. From the Disklabel screen, press N while on a partition to display a pop−up dialog box containing newfs options. To use 16KB blocks and 2KB fragments, enter

...............................................................................................

newfs −f 2048 −b 16384

...............................................................................................

What to Install

The next menu gives you a choice of what to install. While there are quite a few options, I'll simplify them. If you're building an Internet server, choose the "Developer" option. If you're building a desktop or general−purpose experimental machine, choose the "All" option (as shown in Figure 1.9). (Remember to use the space bar to select your choice, and the ENTER key to proceed!)

28

Figure 1.9: Distributions menu

Install will then ask you if you want to install the Ports Collection. You do, even if you don't know it yet. Select "Yes".

If you're installing the X Window System, or X for short, accept the options to install everything in X. (It's much simpler to add them now than to add them later.) Again, once you have a good grip on FreeBSD, you can always go back and remove pieces if you need to.

Installation Media

You'll have a variety of options for installation media, as shown in Figure 1.10. The most popular are CD−ROM and FTP. If you have a FreeBSD CD−ROM, use it. If you don't have a CD, but you have a live network connection, you can install via FTP. This is probably the option you want if you created the floppy disks. If you're behind a firewall, choose to either install via FTP "through a firewall" or "through a http proxy." Be sure your network cable is plugged in before you choose any FTP install options.

Figure 1.10: Installation media menu

You can also install FreeBSD from tape backup, NFS, several dozen floppy disks, or a few other media. If you're using one of these, you're either already a UNIX sysadmin (NFS, tape), or you have

29

probably been brained by falling masonry and are just waiting for the kind gents in white coats to cart you off to your padded room (floppy disks).

If you are using an FTP install, the system will pop up a menu asking you to choose which interface you want to use. Choose your Ethernet card. You'll then be asked for the IP address information you gathered back when you started preparing for an FTP install.

Committing

Once you choose your installation media, sysinstall will ask you if you're sure. If you choose "Yes", the hard drive will start to spin, your CD drive will light up, and you can go get lunch. When you come back, most of the install will be complete.

Finally, you'll see a dialog box asking you if you want to do any post−install setup. Choose "Yes".

Post−Install Setup

The post−install FreeBSD Configuration menu provides some basic options for setting up your computer (see Figure 1.11). We'll discuss how to configure everything later, but your life will be easier if you do some basic setup now.

Figure 1.11: Post−Install configuration

Root Password

To begin, set a root password. If you don't have one, any doofus can log into the system as root without using any password. (Since root has absolute control over your hardware and software, this would be bad.) Choose the third option in the Configuration menu, "Set the system manager's password". It will ask you to enter the root password twice (as shown in Figure 1.12). Remember your root password, as it's a bit of an annoyance to recover it if you lose it.

30