In the previous chapters, we've looked at preparing to install FreeBSD. In this chapter, we'll finally do it. If you run into trouble, I'll refer you back to the page of Chapter 2 which discusses this topic. If you want to install FreeBSD on the same disk as Microsoft or another operating system, you should have already read Chapter 4 , Shared OS installation.
The following discussion relates primarily to installation on the i386 architecture. See page 78 for differences when installing on the AXP ("Alpha") processor.
To install FreeBSD you need the software in a form that the installation software understands. You may also need a boot
The first step in installing FreeBSD is to start a minimal version of the operating system. The simplest way is to boot directly from the installation CD-ROM. If your system doesn't support this kind of boot, boot from floppy. See page 85 for more details.
The description in this chapter is based on a real-life installation on a real machine. When you install FreeBSD on your machine, a number of things will be different, depending on the hardware you're running, the way you're installing the software and the release of FreeBSD you're installing. Nevertheless, you should be able to recognize what is going on.
Booting from CD-ROM is mainly a matter of setting up your system BIOS and possibly your SCSI BIOS. Typically, you perform one of the following procedures:
These settings are probably not what you want to use for normal operation. If you leave the settings like this, and there is a
The boot process itself is very similar to the normal boot process described on page 528. After it completes, though, you are put into the sysinstall main menu.
(рис 5.1) Main installation menu
Figure 5-1 shows the main sysinstall menu. sysinstall includes
To get started, select one of Standard, Express or Custom.The names imply that the Standard installation is the best way to go, the Express installation is for people in a hurry, and Custom installation is for when you want to specify exactly what is to be done.
In fact, the names are somewhat misleading. There isn't really that much difference between the three forms of installation. They all perform the same steps:
We looked at disk partitions and file systems on page 34. We'll look at the other points when we get to them. So what's the difference between the kinds of installation?
The big problem with Standard and Express installations is that they don't let you back up: if you pass a specific step and discover you want to change something, you have to abort the installation and start again. With the
(рис 5.2) Custom Installation options
The first item on the menu is to set installation options. There's probably not too much you'll want to change. About the only thing of interest might be the editor ec, which is a
(рис 5.3) Installation options
The first installation step is to set up space for FreeBSD on the disk. We looked at the technical background in Chapter 2, on page 39. In this section only, we’ll use the term partition to refer to a slice or BIOS partition, because that's the usual
Even if your disk is correctly partitioned, select the Partition menu: the installation routines need to enter this screen in order to read the partition information from the disk. If you like what you see, you can leave again immediately with q (quit), but you must first enter this menu. If you have more than one disk connected to your machine, you will next be asked to choose the drives that you want to use for FreeBSD.
#isDisk selection menu
This screen shows entries for each drive that sysinstall has detected; in this example, the system has one ATA (IDE) drive, /dev/ad0, and one SCSI drive,
If you intend to use more than one disk for FreeBSD, you have the choice of setting up all disks now, or setting the others up after the system is up and running. We'll look at the latter option in Chapter 11 , on page 199.
To select the disk on which you want to install FreeBSD, move the cursor to the appropriate line and press the space bar. The screen you get will probably look like Figure 5-5. Table 5-1 explains the meanings of the columns in this display. The first partition contains the
In this case, the Microsoft file system uses up the whole disk except for the last track, 1008 sectors (504 kB) at the end of the disk. Clearly there's not much left to share. We have the option of removing the Microsoft partition, which we'll look at here, or we can shorten it with FIPS.We looked at FIPS in Chapter 4, page 52, and we'll look at what to do with the resultant layout on page 66.
(рис 5.4) Partition editor menu
Don't forget that if you remove a partition, you lose all the data in it. If the partition contains anything you want to keep, make sure you have a readable backup.
You remove the partition with the d command. After this, your display looks like:
(рис 5.5)
The next step is to allocate a FreeBSD partition. There are two ways to do this: if you want to have more than one partition on the drive (for example, if you share the disk with another operating system), you use the c (create) command. We'll look at that on page 66. In this case, though, you want to use the entire disk for FreeBSD, so you choose the a option. The resultant display is effectively the same as in Figure 5-5 : the only difference is that the Desc field now shows freebsd instead of fat.
That's all you need to do here: leave /disk by pressing the q key.
Don't use the W (Write Changes) command here. It's intended for use only once the system is up and running.
| Column | Description |
|---|---|
| Offset | The number of the first sector in the partition |
| Size | The length of the partition in sectors |
| End | The number of the last sector in the partition |
| Name | Where present, this is the device name that FreeBSD assigns to the partition. In this example, only the second entry has a name. |
| Ptype | The partition type. Partition type 6 is the |
| Desc | Atextual description of the kind of partition. fat stands for File Allocation Table, a central part of the Microsoft |
| The partition | |
| Flags | Can be one or more of the following characters
= The partition is correctly aligned.> The partition finishes after cylinder 1024, which used to cause problems for Microsoft.A This is the active (B The partition C This is a FreeBSD compatibility partition.R This partition contains a root file system
|
On a PC, the next screen asks what kind of boot selector (in other words, MBR) you want. You don't get this on an Alpha.
(рис 5.6) Boot selector menu
If you plan to have only one operating system on this disk, select Standard .If you are sharing with another operating system, you should choose BootMgr instead. We'll look at this in more detail in the section on booting the system on page 529. Exit by pressing the tab key until the OK tab is highlighted, then press Enter.
| Choice | Description |
|---|---|
| BootMgr | Install the FreeBSD |
| Standard | Use a standard MBR. Youwill be able to boot only from the |
| None | Don't change the MBR. This is useful if you already have another |
If you are installing on a disk shared with another operating system, things are a little different. The section continues the example started in Chapter 4 . When you enter the
(рис 5.7) Shared partitions
This display shows the two Microsoft partitions, adOsl and ad0s2,which is what you see after using FIPS; if you have just installed Microsoft on one partition, the partition ad0s2 will not be present. If it is, you first need to remove it. Be very careful to remove the correct partition. It's always the second of the two partitions, in this case ad0s2.
Remove the partition by moving the highlight to the second partition and pressing d. After this, the display looks like:
(рис 5.8)
The next step is to allocate a FreeBSD partition with the c command. The menu asks for the size of the partition, and suggests a value of 35899920 sectors, the size of the unused area at the end. You can edit this value if you wish, but in this case it's what you want, so just press ENTER. You get another window asking you for the partition type, and suggesting type 165, the FreeBSD
(рис 5.9)
The new partition now has a partition type 8 and
After this, select a
The next step is to tell the installation program what to put in your FreeBSD partition. First, we'll look at the simple case of installing FreeBSD by itself. On page 75 we'll look at what differences there are when installing alongside another operating system on the same disk.
When you select Label, you get the screen shown in Figure 5-8 .
(рис 5.10) Label editor menu
In this example, you have 20GB of space to divide up. How should you do it? You don't have to worry about this issue, since sysinstall can do it for you, but we'll see below why this might not be the best choice. In this section we'll consider how UNIX file systems have changed over the years, and we'll look at the issues in file system layout nowadays.
When UNIX was young, disks were tiny. At the time of the third edition of UNIX, in 1972, the root file system was on a Digital RF-11, a fixed head disk with 512 kB. The system was growing, and it was no longer possible to keep the entire system on this disk, so a second file system became essential. It was mounted on a Digital RK03 with 2 MB of storage. To quote from a paper published in the Communications of the ACM in July 1974:
In our installation, for example, the
As time went on, UNIX got bigger, but so did the disks. By the early 80s, disks were large enough to put / and /usr on the same disk, and it would have been possible to merge / and /usr, but they didn't, mainly because of reliability concerns. Since that time, an additional file system, /var, has come into common use for frequently changed data, and just recently sysinstall has been changed to create a /tmp file system by default. This is what sysinstall does if you ask it to partition automatically:
(рис 5.11) Default file system sizes
It's relatively simple to estimate the size of the root file system, and sysinstall's value of 128 MB is reasonable. But what about /var and /tmp? Is 256 MB too much or too little? In fact, both file systems put together would be lost in the 18.7 GB of /usr file system. Why are things still this way? Let's look at the advantages and disadvantages:
In the early days of UNIX,
As a result of these considerations, I have changed my recommendations. In earlier editions of this book, I recommended putting a small root file system and a /usr file system on the first (or only) disk on the system. /var was to be a
This is still a valid layout, but it has a couple of problems:
As a result, I now recommend:
This layout allows for easy backup of the file systems, and it also allows for easy upgrading to a new system version: you just need to replace the root file system. It's not a perfect fit for all applications, though. Ultimately you need to make your own decisions.
Apart from files, you should also have at least one swap partition on your disk. It's very difficult to predict how much
It's almost impossible to know in advance what your system will require. Here are some considerations:
The dump routines can only dump to a single partition, so you need one that is big enough. If you have 512 MB of memory and two swap partitions of 384 MB each, you still will not be able to dump.
A couple of examples might make this clearer:
To view the current swap usage, use pstat. Here's a typical view of this machine's
$ pstat -s Device 1024-blocks Used Avail Capacity Type /dev/da0s1 122880 65148 57668 53% Interleaved
$ pstat –s Device 1024-blocks Used Avail Capacity Type /dev/ad0s1b 1048576 14644 1033932 1% Interleaved
It's not so important that the Athlon is using less swap: it's using less than 3% of its memory in swap, whereas the 486 used 4 times its memory. In a previous edition of this book, I had the example of a Pentium with 96 MB of memory, which used 43 MB of swap. Look at it from a different point of view, and it makes more sense: swap makes up for the lack of
If, however, you look at it from the point of view of acceptable performance, you will hear things like "you need at least one-third of your virtual memory in
In summary: be generous in allocating
For the file systems, the column Mount now shows the mount points, and the Newfs column contains the letters UFS1 for UNIX File System, Version 1, and the letter Y, indicating that you need to create a new file system before you can use it. At this point, you have two choices: decide for yourself what you want, or let the
With these considerations in mind, we'll divide up the disk in the following manner:
To create a file system, you press c. You get a prompt window asking for the size of the file system, and offering the entire space. Enter the size of the root file system
(рис 5.12) Specifying partition size
When you press ENTER, you see another prompt asking for the kind of partition. Select A File System:
(рис 5.13) Selecting partition type
When you press ENTER,you see another prompt asking for the mount point for the file system. Enter / for the root file system, after which the display looks like:
(рис 5.14) Allocated root file system
It's not immediately obvious at this point that soft updates are not enabled for this file system. Press s to enable them, after which the entry in the Newfs column changes from UFS1 to UFSl+S. See page 191 for reasons why you want to use soft updates.
Next, repeat the operation for the swap partition and the /home file system, entering the appropriate values each time. Don't change the value offered for the length of /home: just use all the remaining space. At the end, you have:
(рис 5.15) Completed partition allocation
You don't need to enable soft updates for /home; that happens automatically. That's all you need to do. Exit the menu by pressing q.
At this point in the installation, you have told sysinstall the overall layout of the disk or disks you intend to use for FreeBSD, and whether or how you intend to share them with other operating systems. The next step is to specify how you want to use the FreeBSD partitions. First, though, we'll consider some alternative scenarios.
If you have already started an installation and aborted it for some reason after creating the file systems, things will look a little different when you get to the label editor. I twill find the partitions, but it won't know the name of the mount points, so the text under Mount will be <none>. Under Newfs, you will find an *) instead of the text UFS1 Y. The label editor has found the partitions, but it doesn't know where to mount the file systems. Before you can use them, you must tell the label editor the types and mount points of the UFS partitions. To do this:
m (Mount). A window pops up asking for the mount point. Enter the name, in this example, first /, then press Enter. The label editor enters the name of the mount point under Mount, and under Newfs it enters UFS1 N—it knows that this is a UFS file system, so it just checks its consistency and doesn't overwrite it. Repeat this procedure for /home, and you're done. If you are sharing your disk with another system, you can also use this method to specify mount points for your Microsoft file systems. Select the Microsoft partition and specify the name of a mount point.UFS1 N changes to UFS1 Y. If you leave the N there, the commit phase will check the integrity of the file system with fsck rather than creating a new one.If you have another operating system on the disk, you'll notice a couple of differences. In particular, the label editor menu of Figure 5-8 (on page 68) will not be empty: instead, you'll see something like this:
(рис 5.16)
Be careful at this point. The file system shown in the list is the active Microsoft partition, not a FreeBSD file system. The important piece of information here is the fact that we have 17529 MB of free space on the disk. We'll create the file systems in that free space in the same way we saw on page 72.
The next step is to decide what to install. Figure 5-14 shows you the menu you get when you enter Distributions. A complete installation of FreeBSD uses about 1 GB of space, so there's little reason to choose anything else. Position the cursor on the line All, as shown, and press the space bar.
Next, sysinstall asks you if you want to install the Ports Collection. We'll look at the Ports Collection in Chapter 9 . You don't have to install it now, and it takes much more time than you would expect from the amount of space that it takes: the Ports Collection consists of over 150,000 very small files, and copying them to disk can take as long as the rest of the installation put together. On the other hand, it's a lot easier to do now, so if you have the time, you should install them.
Whatever you answer to this question, you are returned to the distribution menu of Figure 5-14. Select Exit, and you're done selecting your distributions.
(рис 5.17) Distribution selection menu
Now sysinstall knows the layout of the disk or disks you intend to use for FreeBSD, and what to put on them. Next, you specify where to get the data from.
The next thing you need to specify is where you will get the data from. Where you go now depends on your
At this point, sysinstall knows everything it needs to install the software. It's just waiting for you to tell it to go ahead.
(рис 5.18) Installation medium menu
So far, every thing you have done has had no effect on the
If you are installing with the
Last Chance! Are you SURE you want continue the installation? If you're running this on an existing system, we STRONGLY encourage you to make proper backups before proceeding. We take no responsibility for lost disk contents!
When you answer yes, sysinstall does what we've been preparing for:
After the file systems are mounted, and before installing the software, sysinstall starts processes on two other virtual
In addition, after sysinstall mounts the root file system, it starts an interactive shell on /dev/ttyv3. You can use it if something goes wrong, or simply to watch what's going on while you're installing. You switch to it with ALT-F4.
After installing all the files, sysinstall asks:
Visit the general configuration menu for a chance to set any last options?
You really have the choice here. You can answer Yes and continue, or you can reboot: the system is now run able. In all probability, though, you will have additional installation work to do, so it's worth continuing. We'll look at that in the following chapter.
Installing FreeBSD on an Alpha (officially Compaq AXP) has a few minor differences due to the hardware itself. In principle, you perform the same steps to install FreeBSD on the Alpha architecture that you perform for the Intel architecture. See page 42 for some differences.
The easiest type of installation is from CD-ROM. If you have a supported
>>>boot dvaO
Insert the mfsroot.flp floppy when prompted and you will end up at the first screen of the install program. You can then continue as for the Intel architecture on page 59.
To install over the Net, fetch the floppy images from the ftp site, boot as above, then proceed as for the Intel architecture.
Once the install procedure has finished, you will be able to start FreeBSD/Alpha by typing something like this to the
>>>boot dkcO
This instructs the show device command:
>>>show device dka0.0.0.4.0 DKA0 TOSHIBA CD-ROM XM-57 3476 dkc0.0.0.1009.0 DKC0 RZ1BB-BS 0658 dkc100.1.0.1009.0 DKC100 SEAGATE ST34501W 0015 dva0.0.0.0.1 DVA0 ewa0.0.0.3.0 EWA0 00-00-F8-75-6D-01 pkc0.7.0.1009.0 PKC0 SCSI Bus ID 7 5.27 pqa0.0.0.4.0 PQA0 PCI EIDE
This example comes from a Digital Personal Workstation 433au and shows three disks attached to the machine. The first is a CD-ROM called dka0 and the other two are disks and are called dkc0 and dkc100 respectively.
You can specify which kernel file to load and what boot options to use with the -file and -flags options to boot:
>>>boot -file kernel.old -flags s
To makeFreeBSD/Alpha boot automatically,use these commands:
>>>set boot_osflags a >>>set bootdef_dev dkcO >>>set auto_action BOOT
Paradoxically, upgrading an old version of FreeBSD is more complicated than installing from
What, you want to remove FreeBSD? Why would you want to do that?
Seriously, if you decide you want to completely remove FreeBSD from the system, this is no longer a FreeBSD issue, it's an issue of whatever system you use to replace it. For example, on page 63 we saw how to remove a Microsoft partition and replace it with FreeBSD; no Microsoft software was needed to remove it. In the same way, you don't need any help from FreeBSD if you want to replace it with a different operating system.
In this section, we'll look at the most common installation problems. Many of these are things that once used to happen and haven't been seen for some time: sysinstall has improved considerably, and modern hardware is much more reliable and easy to configure. You can find additional information on this topic in the section Known Hardware Problems in the file INSTALL.TXT on the first CD-ROM.
sysinstall is intended to be easy to use, but it is not very tolerant of errors. You may well find that you enter something by
If you select to install from CD-ROM, you may get the message:
No CD-ROM device found
This might even happen if you have booted from CD-ROM! The most common reasons for this problem are:
One of the most terrifying things after installing FreeBSD is if you find that the machine just won't boot. This is particularly bad if you have important data on the disk (either another operating system, or data from a previous installation of FreeBSD).
At this point, seasoned
Still, all is probably not lost. The most frequent causes of boot failure are an incorrect boot installation or geometry problems. In addition, it's possible that the system might hang and never complete the boot process. All of these problems are much less common than they used to be, and a lot of the information about how to address them is a few years old, as they haven't been seen since.
It's possible to forget to install the
BTX loader 1.00 BTX version is 1.01 BIOS drive A: is diskO BIOS drive C: is diskl BIOS drive D: is disk1 BIOS 639kB/130048kB available memory FreeBSD/i386 bootstrap loader, Revision 0.8 (grog@freebie.example.com, Thu Jun 13 13:06:03 CST 2002) Loading /boot/defaults/loader.conf Hit [Enter] to boot immediately, or any other key for command prompt. Booting [kernel] in 6 seconds... press space bar here ok unload unload the current kernel ok set currdev=disk1s1a and set the location of the newone ok load /boot/kernel/kernel load the kernel ok boot then start it
This boots from the drive /dev/ad0s1a, assuming that you are using IDE drives. The correspondence between the name /dev/ad0s1a and disklsla goes via the information at the top of the example: C. After booting, install the correct bsdlabel -B or boot0cfg, and you should be able to boot from hard disk again.
Things might continue a bit further: you elect to install booteasy, and when you boot, you get the
It used to be relatively common that sysinstall couldn't calculate the correct geometry for a disk, and that as a result you could install a system, but it wouldn't boot. Since those days, sysinstall has become a lot smarter, but it's still barely possible that you'll run into this problem.
If you can’t figure out the correct geometry for your machine, and even if you don't want to run Microsoft on your machine, try installing a small Microsoft partition at the beginning of the disk and install FreeBSD after that. The install program sees the Microsoft partition and tries to
Alternatively, if you don't want to share your disk with any other operating system, select the option to use the entire disk (a in the
A number of problems may lead to the system hanging during the boot process. All the known problems have been eliminated, but there's always the chance that something new will crop up. In general, the problems are related to hardware probes, and the most important indication is the point at which the boot failed. It's worth repeating the boot with the verbose fag: again, refer to the description of the boot process on page 529. Interrupt the boot process with the space bar and enter:
Hit [Enter] to boot immediately, or any other key for command prompt. Booting [kernel] in 6 seconds... press space bar here ok set boot_verbose set a verbose boot ok boot then continue
This fag gives you additional information that might help
If you're using ISA cards, you may need to reconfigure the card to match the kernel, or change the file /boot/device.hints to match the card settings. See the example on page 609. Older versions of FreeBSD used to have a program called UserConfig to perform this function, but it is no longer supported.
If you get the system installed to the point where you can start it, but it doesn't run quite the way you want, don't reinstall. In most cases,
You might find that the installation completes successfully, and you get your system up and running, but almost before you know it, the root file system fills up. This is relatively unlikely if you follow my recommendation to have one file system for /, /usr and /var, but if you follow the default recommendations, it's a possibility. It could be, of course, that you just haven't made it big enough—FreeBSD root file systems have got bigger over the years. In the first edition of this book I recommended 32 MB "to be on the safe side." Nowadays the default is 128 MB.
On the other hand, maybe you already have an128 MB root file system, and it still fills up. In this case, check where you have put your /tmp and /var file systems. There's a good chance that they're on the root file system, and that's why it's filling up.
Sometimes the system gets into so much trouble that it can't continue. It should notice this situation and stop more or less gracefully. You might see a message like:
panic: free vnode isn't Syncing disks 14 13 9 5 5 5 5 5 5 5 giving up dumping to dev 20001 offset 0 dump 16 32 48 64 80 96 112 128 succeeded Automatic reboot in 15 seconds - press a key on the console to abort Reboooting...
Just because the system has panicked doesn't mean that you should panic too. It's a sorry fact of life that software contains bugs. Many commercial systems just crash when they hit a bug, and you never know why, or they print a message like General protection fault, which doesn't tell you very much either. When a UNIX system panics, it usually gives you more detailed information-in this example, the reason is free v node isn't. You may not be any the wiser for a message like this (it tells you that the file system handling has got confused about the current state of storage on a disk), but other people might. In particular, if you do get a panic and you ask for help on FreeBSD-questions, please don't just say "My system panicked, what do I do?" The first answer—if you get one— will be "What was the panic string??" The second will be "Where's the dump?"
After panicking, the system tries to write file system buffers back to disk so that they don't get lost. This is not always possible, as we see on the second line of this example. It started off with 14 buffers to write, but it only managed to write 9 of them, possibly because it was confused about the state of the disk. This can mean that you will have difficulties after rebooting, but it might also mean that the system was wrong in its
In addition to telling you the cause of the panic, FreeBSD will optionally copy the current contents of memory to the
dumpdev="NO" # Device name to crashdump to (if enabled)
To enable dumping, put something like this in /boot/loader.conf:
dumpdev="/dev/ad0s1b"
This enables the dumps to be taken even if a panic occurs before the system reads the /etc/rc.conf file. Make sure that the name of the dumpdev corresponds to a swap partition with at least as much space as your total memory. You can use pstat to check this:
# pstat –s Device 1024-blocks Used Avail Capacity Type /dev/ad0s1b 51200 50108 1028 98% interleaved /dev/da0s1b 66036 51356 14616 78% interleaved /dev/da2s1b 204800 51220 153516 25% interleaved Total 321844 152684 169160 47%
As long as this machine doesn't have more than about 192 MB of memory, it will be possible to take a dump on /dev/da2s1b.
In addition, ensure that you have a directory called /var/crash. After rebooting, the system first checks the integrity of the file systems, then it checks for the presence of a dump. If it finds one, it copies the dump and the current kernel to /var/crash.
It's always worth enabling dumping, assuming your gdb—see page 623 for more details.
To get the best results from a dump analysis, you need a debug kernel.This kernel is identical to a normal kernel, but it includes a lot of information that can be used for dump analysis. See page 614 for details of how to build a debug kernel. You never know when you might run into a problem, so I highly recommend that you use a debug kernel at all times. It doesn't have any effect on the performance of the system.
A really massive crash may
In either case, the hard disks aren't mounted; you might want to do repair work on them before any other access.
Use this option only if you have a good understanding of the system
The description at the beginning of this chapter applied to the most common installation method, from CD-ROM. In the following sections we'll look at the relatively minor differences needed to install from other media. The choices you have are, in order of
If your machine is no longer the youngest, you may be able to read the
The way you get the boot
# dd if=/cdrom/floppies/k:erri.flp of=/dev/fd0 bs=36b change the floppy # dd if=/cdrom/floppies/mfsroot.flp of=/dev/fd0 bs=36b change the floppy # dd if=/cdrom/floppies/drivers.flp of=/dev/fd0 bs=36b
This assumes that your software is on CD-ROM, and that it is mounted on the directory /cdrom. It also assumes that your
The dd implementation of some versions of UNIX, particularly older System V variants, may complain about the option bs=36b. If this happens, just leave it out. It might take up to 10 minutes to write the floppy, but it will work, and it will make you appreciate FreeBSD all the more.
If you have to create the boot floppy from Microsoft, use the program FDIMAGE.EXE, which is in the tools directory of the first CD-ROM.
In almost all cases where you don't boot from CD-ROM, you'll boot from floppy, no matter what medium you are installing from. If you are installing from CD-ROM, put the CD-ROM in the drive before booting. The installation may fail if you boot before inserting the CD-ROM.
Boot the system in the normal manner from the first floppy (the one containing the kern.flp image). After loading the kernel, the system will print the message:
Please insert MFS root floppy and press enter
After you replace the floppy and press enter, the boot procedure carries on as before.
If you're using the 2.88 MB image on a 2.88 MB floppy or an LS-120 drive, you have every thing you need on the one disk, so you don't get the prompt to change the disk. Depending on your hardware, you may later get a prompt to install additional drivers from the driver floppy.
The fun way to install FreeBSD is via the Internet, but it's not always the best choice. There's a lot of data to transfer, and unless you have a really
There are two ftp installation modes you can use:
Whichever mode of installation and whichever remote machine you choose, you need to have access to the remote machine. The easiest and most common way to ensure access is to use anonymous ftp. If you're installing from another FreeBSD machine, read how to install anonymous ftp on page 450. This information is also generally correct for other UNIX systems.
Put the FreeBSD distribution in the public ftp directory of the ftp server. On BSD systems, this will be the home directory of user ftp, which in FreeBSD defaults to /var/spool/ftp The name of the directory is the name of the release, which in this example we'll assume to be 5.0-RELEASE. You can put this directory in a subdirectory of /var/spool/ftp, for example /var/spool/ftp/FreeBSD/5.0-RELEASE, but the only optional part in this example is the parent directory FreeBSD.
This directory has a slightly different structure from the CD-ROM distribution. To set it up, assuming you have your distribution CD-ROM mounted on /cdrom, and that you are installing in the directory /var/spool/ftp/FreeBSD/5.0-RELEASE, perform the following steps:
# cd /var/spool/ftp/FreeBSD/5.0-RELEASE # mkdir floppies # cd floppies # cp /cdrom/floppies/* . don't omit the . at the end # cd /cdrom the distribution directory on CD-ROM # tar cf - . | (cd /var/spool/ftp/FreeBSD/5.0-EELEASE; tar xvf -)
This copies all the directories of /cdrom into /var/spool/ftp/FreeBSD/5.0-RELEASE. For a minimal installation, you need only the directory base. To just install base rather than all of the distribution, change the last line of the example above to:
# mkdir base # cp /cdrom/base/* base
On page 77 we saw the media select menu. Figure 5-16 shows the menu you get when you select . hostname is the name of the system, in this case presto.example.org, and pathname is the path relative to the anonymous ftp directory, which on FreeBSD systems is usually /var/spool/ftp.The install program knows its version number, and it attaches it to the name you supply.
In this case, we're installing Release 5.0 of FreeBSD, and it's in the directory . The next menu asks you to configure your network. This is the same menu that you would normally fill out at the end of the installation—see page 98 for details.
This information is used to set up the machine after installation, so it pays to fill out this information correctly. After entering this information, continue with Commit (on page 77).
(рис 5.19) Selecting ftp server
If you're installing from a V
Next, you give this information to sysinstall, as shown in Figure 5-17 . After entering this information, sysinstall asks you to configure an interface. This is the same procedure that you would otherwise do after installation—see page 98. After performing this configuration, you continue with Commit (on page 77).
On the Intel architecture you can also install from a primary Microsoft partition on the first disk. To prepare for installation from a Microsoft partition, copy the files from the distribution into a directory called C:\FREEBSD. For example, to do a minimal installation of FreeBSD from Microsoft using files copied from a CD-ROM, copy the directories floppies and base to the Microsoft directories C:\FREEBSD\FLOPPIES and C:\FREEBSD\BIN respectively. You need the directory FLOPPIES because that's where sysinstall looks for the boot.flp, the first image in every installation.
(рис 5.20) Specifying NFS file system
The only required directory is base. You can include as many other directories as you want, but be sure to maintain the directory structure. In other words, if you also wanted to install XF86336 and manpages, you would copy them to C:\FREEBSD\XF86336 and C:\FREEBSD\MANPAGES.
Installation from
Before starting, format all floppies in the drive you intend to use, even if they are preformatted.
The first two floppies you'll need are the Kernel floppy and the
In addition, you need at minimum as many floppies as it takes to hold all files in the base directory, which contains the binary distribution. Read the file LAYOUT.TXT paying special attention to the "Distribution format" section, which describes which files you need.
If you're creating the floppies on a FreeBSD machine, you can put ufs file systems on the floppies instead:
# fdformat -f 1440 fd0.1440 # bsdlabel -w fd0.1440 floppy3 # newfs -t 2 -u 18 -l 1 -i 65536 /dev/fd0
Next, copy the files to the floppies. The distribution files are split into chunks that will fit exactly on a conventional 1.44MB floppy. Copy one file to each floppy. Make very sure to put the file base.inf on the first floppy; it is needed to find out how many floppies to read.
The installation itself is straightforward enough: follow the instructions starting on page 63, select Floppy in the
In the previous chapters, we've looked at preparing to install FreeBSD. In this chapter, we'll finally do it. If you run into trouble, I'll refer you back to the page of Chapter 2 which discusses this topic. If you want to install FreeBSD on the same disk as Microsoft or another operating system, you should have already read Chapter 4 , Shared OS installation.
The following discussion relates primarily to installation on the i386 architecture. See page 78 for differences when installing on the AXP ("Alpha") processor.
To install FreeBSD you need the software in a form that the installation software understands. You may also need a boot
The first step in installing FreeBSD is to start a minimal version of the operating system. The simplest way is to boot directly from the installation CD-ROM. If your system doesn't support this kind of boot, boot from floppy. See page 85 for more details.
The description in this chapter is based on a real-life installation on a real machine. When you install FreeBSD on your machine, a number of things will be different, depending on the hardware you're running, the way you're installing the software and the release of FreeBSD you're installing. Nevertheless, you should be able to recognize what is going on.
Booting from CD-ROM is mainly a matter of setting up your system BIOS and possibly your SCSI BIOS. Typically, you perform one of the following procedures:
These settings are probably not what you want to use for normal operation. If you leave the settings like this, and there is a
The boot process itself is very similar to the normal boot process described on page 528. After it completes, though, you are put into the sysinstall main menu.
(рис 5.1) Main installation menu
Figure 5-1 shows the main sysinstall menu. sysinstall includes
To get started, select one of Standard, Express or Custom.The names imply that the Standard installation is the best way to go, the Express installation is for people in a hurry, and Custom installation is for when you want to specify exactly what is to be done.
In fact, the names are somewhat misleading. There isn't really that much difference between the three forms of installation. They all perform the same steps:
We looked at disk partitions and file systems on page 34. We'll look at the other points when we get to them. So what's the difference between the kinds of installation?
The big problem with Standard and Express installations is that they don't let you back up: if you pass a specific step and discover you want to change something, you have to abort the installation and start again. With the
(рис 5.2) Custom Installation options
The first item on the menu is to set installation options. There's probably not too much you'll want to change. About the only thing of interest might be the editor ec, which is a
(рис 5.3) Installation options
The first installation step is to set up space for FreeBSD on the disk. We looked at the technical background in Chapter 2, on page 39. In this section only, we’ll use the term partition to refer to a slice or BIOS partition, because that's the usual
Even if your disk is correctly partitioned, select the Partition menu: the installation routines need to enter this screen in order to read the partition information from the disk. If you like what you see, you can leave again immediately with q (quit), but you must first enter this menu. If you have more than one disk connected to your machine, you will next be asked to choose the drives that you want to use for FreeBSD.
#isDisk selection menu
This screen shows entries for each drive that sysinstall has detected; in this example, the system has one ATA (IDE) drive, /dev/ad0, and one SCSI drive,
If you intend to use more than one disk for FreeBSD, you have the choice of setting up all disks now, or setting the others up after the system is up and running. We'll look at the latter option in Chapter 11 , on page 199.
To select the disk on which you want to install FreeBSD, move the cursor to the appropriate line and press the space bar. The screen you get will probably look like Figure 5-5. Table 5-1 explains the meanings of the columns in this display. The first partition contains the
In this case, the Microsoft file system uses up the whole disk except for the last track, 1008 sectors (504 kB) at the end of the disk. Clearly there's not much left to share. We have the option of removing the Microsoft partition, which we'll look at here, or we can shorten it with FIPS.We looked at FIPS in Chapter 4, page 52, and we'll look at what to do with the resultant layout on page 66.
(рис 5.4) Partition editor menu
Don't forget that if you remove a partition, you lose all the data in it. If the partition contains anything you want to keep, make sure you have a readable backup.
You remove the partition with the d command. After this, your display looks like:
(рис 5.5)
The next step is to allocate a FreeBSD partition. There are two ways to do this: if you want to have more than one partition on the drive (for example, if you share the disk with another operating system), you use the c (create) command. We'll look at that on page 66. In this case, though, you want to use the entire disk for FreeBSD, so you choose the a option. The resultant display is effectively the same as in Figure 5-5 : the only difference is that the Desc field now shows freebsd instead of fat.
That's all you need to do here: leave /disk by pressing the q key.
Don't use the W (Write Changes) command here. It's intended for use only once the system is up and running.
| Column | Description |
|---|---|
| Offset | The number of the first sector in the partition |
| Size | The length of the partition in sectors |
| End | The number of the last sector in the partition |
| Name | Where present, this is the device name that FreeBSD assigns to the partition. In this example, only the second entry has a name. |
| Ptype | The partition type. Partition type 6 is the |
| Desc | Atextual description of the kind of partition. fat stands for File Allocation Table, a central part of the Microsoft |
| The partition | |
| Flags | Can be one or more of the following characters
= The partition is correctly aligned.> The partition finishes after cylinder 1024, which used to cause problems for Microsoft.A This is the active (B The partition C This is a FreeBSD compatibility partition.R This partition contains a root file system
|
On a PC, the next screen asks what kind of boot selector (in other words, MBR) you want. You don't get this on an Alpha.
(рис 5.6) Boot selector menu
If you plan to have only one operating system on this disk, select Standard .If you are sharing with another operating system, you should choose BootMgr instead. We'll look at this in more detail in the section on booting the system on page 529. Exit by pressing the tab key until the OK tab is highlighted, then press Enter.
| Choice | Description |
|---|---|
| BootMgr | Install the FreeBSD |
| Standard | Use a standard MBR. Youwill be able to boot only from the |
| None | Don't change the MBR. This is useful if you already have another |
If you are installing on a disk shared with another operating system, things are a little different. The section continues the example started in Chapter 4 . When you enter the
(рис 5.7) Shared partitions
This display shows the two Microsoft partitions, adOsl and ad0s2,which is what you see after using FIPS; if you have just installed Microsoft on one partition, the partition ad0s2 will not be present. If it is, you first need to remove it. Be very careful to remove the correct partition. It's always the second of the two partitions, in this case ad0s2.
Remove the partition by moving the highlight to the second partition and pressing d. After this, the display looks like:
(рис 5.8)
The next step is to allocate a FreeBSD partition with the c command. The menu asks for the size of the partition, and suggests a value of 35899920 sectors, the size of the unused area at the end. You can edit this value if you wish, but in this case it's what you want, so just press ENTER. You get another window asking you for the partition type, and suggesting type 165, the FreeBSD
(рис 5.9)
The new partition now has a partition type 8 and
After this, select a
The next step is to tell the installation program what to put in your FreeBSD partition. First, we'll look at the simple case of installing FreeBSD by itself. On page 75 we'll look at what differences there are when installing alongside another operating system on the same disk.
When you select Label, you get the screen shown in Figure 5-8 .
(рис 5.10) Label editor menu
In this example, you have 20GB of space to divide up. How should you do it? You don't have to worry about this issue, since sysinstall can do it for you, but we'll see below why this might not be the best choice. In this section we'll consider how UNIX file systems have changed over the years, and we'll look at the issues in file system layout nowadays.
When UNIX was young, disks were tiny. At the time of the third edition of UNIX, in 1972, the root file system was on a Digital RF-11, a fixed head disk with 512 kB. The system was growing, and it was no longer possible to keep the entire system on this disk, so a second file system became essential. It was mounted on a Digital RK03 with 2 MB of storage. To quote from a paper published in the Communications of the ACM in July 1974:
In our installation, for example, the
As time went on, UNIX got bigger, but so did the disks. By the early 80s, disks were large enough to put / and /usr on the same disk, and it would have been possible to merge / and /usr, but they didn't, mainly because of reliability concerns. Since that time, an additional file system, /var, has come into common use for frequently changed data, and just recently sysinstall has been changed to create a /tmp file system by default. This is what sysinstall does if you ask it to partition automatically:
(рис 5.11) Default file system sizes
It's relatively simple to estimate the size of the root file system, and sysinstall's value of 128 MB is reasonable. But what about /var and /tmp? Is 256 MB too much or too little? In fact, both file systems put together would be lost in the 18.7 GB of /usr file system. Why are things still this way? Let's look at the advantages and disadvantages:
In the early days of UNIX,
As a result of these considerations, I have changed my recommendations. In earlier editions of this book, I recommended putting a small root file system and a /usr file system on the first (or only) disk on the system. /var was to be a
This is still a valid layout, but it has a couple of problems:
As a result, I now recommend:
This layout allows for easy backup of the file systems, and it also allows for easy upgrading to a new system version: you just need to replace the root file system. It's not a perfect fit for all applications, though. Ultimately you need to make your own decisions.
Apart from files, you should also have at least one swap partition on your disk. It's very difficult to predict how much
It's almost impossible to know in advance what your system will require. Here are some considerations:
The dump routines can only dump to a single partition, so you need one that is big enough. If you have 512 MB of memory and two swap partitions of 384 MB each, you still will not be able to dump.
A couple of examples might make this clearer:
To view the current swap usage, use pstat. Here's a typical view of this machine's
$ pstat -s Device 1024-blocks Used Avail Capacity Type /dev/da0s1 122880 65148 57668 53% Interleaved
$ pstat –s Device 1024-blocks Used Avail Capacity Type /dev/ad0s1b 1048576 14644 1033932 1% Interleaved
It's not so important that the Athlon is using less swap: it's using less than 3% of its memory in swap, whereas the 486 used 4 times its memory. In a previous edition of this book, I had the example of a Pentium with 96 MB of memory, which used 43 MB of swap. Look at it from a different point of view, and it makes more sense: swap makes up for the lack of
If, however, you look at it from the point of view of acceptable performance, you will hear things like "you need at least one-third of your virtual memory in
In summary: be generous in allocating
For the file systems, the column Mount now shows the mount points, and the Newfs column contains the letters UFS1 for UNIX File System, Version 1, and the letter Y, indicating that you need to create a new file system before you can use it. At this point, you have two choices: decide for yourself what you want, or let the
With these considerations in mind, we'll divide up the disk in the following manner:
To create a file system, you press c. You get a prompt window asking for the size of the file system, and offering the entire space. Enter the size of the root file system
(рис 5.12) Specifying partition size
When you press ENTER, you see another prompt asking for the kind of partition. Select A File System:
(рис 5.13) Selecting partition type
When you press ENTER,you see another prompt asking for the mount point for the file system. Enter / for the root file system, after which the display looks like:
(рис 5.14) Allocated root file system
It's not immediately obvious at this point that soft updates are not enabled for this file system. Press s to enable them, after which the entry in the Newfs column changes from UFS1 to UFSl+S. See page 191 for reasons why you want to use soft updates.
Next, repeat the operation for the swap partition and the /home file system, entering the appropriate values each time. Don't change the value offered for the length of /home: just use all the remaining space. At the end, you have:
(рис 5.15) Completed partition allocation
You don't need to enable soft updates for /home; that happens automatically. That's all you need to do. Exit the menu by pressing q.
At this point in the installation, you have told sysinstall the overall layout of the disk or disks you intend to use for FreeBSD, and whether or how you intend to share them with other operating systems. The next step is to specify how you want to use the FreeBSD partitions. First, though, we'll consider some alternative scenarios.
If you have already started an installation and aborted it for some reason after creating the file systems, things will look a little different when you get to the label editor. I twill find the partitions, but it won't know the name of the mount points, so the text under Mount will be <none>. Under Newfs, you will find an *) instead of the text UFS1 Y. The label editor has found the partitions, but it doesn't know where to mount the file systems. Before you can use them, you must tell the label editor the types and mount points of the UFS partitions. To do this:
m (Mount). A window pops up asking for the mount point. Enter the name, in this example, first /, then press Enter. The label editor enters the name of the mount point under Mount, and under Newfs it enters UFS1 N—it knows that this is a UFS file system, so it just checks its consistency and doesn't overwrite it. Repeat this procedure for /home, and you're done. If you are sharing your disk with another system, you can also use this method to specify mount points for your Microsoft file systems. Select the Microsoft partition and specify the name of a mount point.UFS1 N changes to UFS1 Y. If you leave the N there, the commit phase will check the integrity of the file system with fsck rather than creating a new one.If you have another operating system on the disk, you'll notice a couple of differences. In particular, the label editor menu of Figure 5-8 (on page 68) will not be empty: instead, you'll see something like this:
(рис 5.16)
Be careful at this point. The file system shown in the list is the active Microsoft partition, not a FreeBSD file system. The important piece of information here is the fact that we have 17529 MB of free space on the disk. We'll create the file systems in that free space in the same way we saw on page 72.
The next step is to decide what to install. Figure 5-14 shows you the menu you get when you enter Distributions. A complete installation of FreeBSD uses about 1 GB of space, so there's little reason to choose anything else. Position the cursor on the line All, as shown, and press the space bar.
Next, sysinstall asks you if you want to install the Ports Collection. We'll look at the Ports Collection in Chapter 9 . You don't have to install it now, and it takes much more time than you would expect from the amount of space that it takes: the Ports Collection consists of over 150,000 very small files, and copying them to disk can take as long as the rest of the installation put together. On the other hand, it's a lot easier to do now, so if you have the time, you should install them.
Whatever you answer to this question, you are returned to the distribution menu of Figure 5-14. Select Exit, and you're done selecting your distributions.
(рис 5.17) Distribution selection menu
Now sysinstall knows the layout of the disk or disks you intend to use for FreeBSD, and what to put on them. Next, you specify where to get the data from.
The next thing you need to specify is where you will get the data from. Where you go now depends on your
At this point, sysinstall knows everything it needs to install the software. It's just waiting for you to tell it to go ahead.
(рис 5.18) Installation medium menu
So far, every thing you have done has had no effect on the
If you are installing with the
Last Chance! Are you SURE you want continue the installation? If you're running this on an existing system, we STRONGLY encourage you to make proper backups before proceeding. We take no responsibility for lost disk contents!
When you answer yes, sysinstall does what we've been preparing for:
After the file systems are mounted, and before installing the software, sysinstall starts processes on two other virtual
In addition, after sysinstall mounts the root file system, it starts an interactive shell on /dev/ttyv3. You can use it if something goes wrong, or simply to watch what's going on while you're installing. You switch to it with ALT-F4.
After installing all the files, sysinstall asks:
Visit the general configuration menu for a chance to set any last options?
You really have the choice here. You can answer Yes and continue, or you can reboot: the system is now run able. In all probability, though, you will have additional installation work to do, so it's worth continuing. We'll look at that in the following chapter.
Installing FreeBSD on an Alpha (officially Compaq AXP) has a few minor differences due to the hardware itself. In principle, you perform the same steps to install FreeBSD on the Alpha architecture that you perform for the Intel architecture. See page 42 for some differences.
The easiest type of installation is from CD-ROM. If you have a supported
>>>boot dvaO
Insert the mfsroot.flp floppy when prompted and you will end up at the first screen of the install program. You can then continue as for the Intel architecture on page 59.
To install over the Net, fetch the floppy images from the ftp site, boot as above, then proceed as for the Intel architecture.
Once the install procedure has finished, you will be able to start FreeBSD/Alpha by typing something like this to the
>>>boot dkcO
This instructs the show device command:
>>>show device dka0.0.0.4.0 DKA0 TOSHIBA CD-ROM XM-57 3476 dkc0.0.0.1009.0 DKC0 RZ1BB-BS 0658 dkc100.1.0.1009.0 DKC100 SEAGATE ST34501W 0015 dva0.0.0.0.1 DVA0 ewa0.0.0.3.0 EWA0 00-00-F8-75-6D-01 pkc0.7.0.1009.0 PKC0 SCSI Bus ID 7 5.27 pqa0.0.0.4.0 PQA0 PCI EIDE
This example comes from a Digital Personal Workstation 433au and shows three disks attached to the machine. The first is a CD-ROM called dka0 and the other two are disks and are called dkc0 and dkc100 respectively.
You can specify which kernel file to load and what boot options to use with the -file and -flags options to boot:
>>>boot -file kernel.old -flags s
To makeFreeBSD/Alpha boot automatically,use these commands:
>>>set boot_osflags a >>>set bootdef_dev dkcO >>>set auto_action BOOT
Paradoxically, upgrading an old version of FreeBSD is more complicated than installing from
What, you want to remove FreeBSD? Why would you want to do that?
Seriously, if you decide you want to completely remove FreeBSD from the system, this is no longer a FreeBSD issue, it's an issue of whatever system you use to replace it. For example, on page 63 we saw how to remove a Microsoft partition and replace it with FreeBSD; no Microsoft software was needed to remove it. In the same way, you don't need any help from FreeBSD if you want to replace it with a different operating system.
In this section, we'll look at the most common installation problems. Many of these are things that once used to happen and haven't been seen for some time: sysinstall has improved considerably, and modern hardware is much more reliable and easy to configure. You can find additional information on this topic in the section Known Hardware Problems in the file INSTALL.TXT on the first CD-ROM.
sysinstall is intended to be easy to use, but it is not very tolerant of errors. You may well find that you enter something by
If you select to install from CD-ROM, you may get the message:
No CD-ROM device found
This might even happen if you have booted from CD-ROM! The most common reasons for this problem are:
One of the most terrifying things after installing FreeBSD is if you find that the machine just won't boot. This is particularly bad if you have important data on the disk (either another operating system, or data from a previous installation of FreeBSD).
At this point, seasoned
Still, all is probably not lost. The most frequent causes of boot failure are an incorrect boot installation or geometry problems. In addition, it's possible that the system might hang and never complete the boot process. All of these problems are much less common than they used to be, and a lot of the information about how to address them is a few years old, as they haven't been seen since.
It's possible to forget to install the
BTX loader 1.00 BTX version is 1.01 BIOS drive A: is diskO BIOS drive C: is diskl BIOS drive D: is disk1 BIOS 639kB/130048kB available memory FreeBSD/i386 bootstrap loader, Revision 0.8 (grog@freebie.example.com, Thu Jun 13 13:06:03 CST 2002) Loading /boot/defaults/loader.conf Hit [Enter] to boot immediately, or any other key for command prompt. Booting [kernel] in 6 seconds... press space bar here ok unload unload the current kernel ok set currdev=disk1s1a and set the location of the newone ok load /boot/kernel/kernel load the kernel ok boot then start it
This boots from the drive /dev/ad0s1a, assuming that you are using IDE drives. The correspondence between the name /dev/ad0s1a and disklsla goes via the information at the top of the example: C. After booting, install the correct bsdlabel -B or boot0cfg, and you should be able to boot from hard disk again.
Things might continue a bit further: you elect to install booteasy, and when you boot, you get the
It used to be relatively common that sysinstall couldn't calculate the correct geometry for a disk, and that as a result you could install a system, but it wouldn't boot. Since those days, sysinstall has become a lot smarter, but it's still barely possible that you'll run into this problem.
If you can’t figure out the correct geometry for your machine, and even if you don't want to run Microsoft on your machine, try installing a small Microsoft partition at the beginning of the disk and install FreeBSD after that. The install program sees the Microsoft partition and tries to
Alternatively, if you don't want to share your disk with any other operating system, select the option to use the entire disk (a in the
A number of problems may lead to the system hanging during the boot process. All the known problems have been eliminated, but there's always the chance that something new will crop up. In general, the problems are related to hardware probes, and the most important indication is the point at which the boot failed. It's worth repeating the boot with the verbose fag: again, refer to the description of the boot process on page 529. Interrupt the boot process with the space bar and enter:
Hit [Enter] to boot immediately, or any other key for command prompt. Booting [kernel] in 6 seconds... press space bar here ok set boot_verbose set a verbose boot ok boot then continue
This fag gives you additional information that might help
If you're using ISA cards, you may need to reconfigure the card to match the kernel, or change the file /boot/device.hints to match the card settings. See the example on page 609. Older versions of FreeBSD used to have a program called UserConfig to perform this function, but it is no longer supported.
If you get the system installed to the point where you can start it, but it doesn't run quite the way you want, don't reinstall. In most cases,
You might find that the installation completes successfully, and you get your system up and running, but almost before you know it, the root file system fills up. This is relatively unlikely if you follow my recommendation to have one file system for /, /usr and /var, but if you follow the default recommendations, it's a possibility. It could be, of course, that you just haven't made it big enough—FreeBSD root file systems have got bigger over the years. In the first edition of this book I recommended 32 MB "to be on the safe side." Nowadays the default is 128 MB.
On the other hand, maybe you already have an128 MB root file system, and it still fills up. In this case, check where you have put your /tmp and /var file systems. There's a good chance that they're on the root file system, and that's why it's filling up.
Sometimes the system gets into so much trouble that it can't continue. It should notice this situation and stop more or less gracefully. You might see a message like:
panic: free vnode isn't Syncing disks 14 13 9 5 5 5 5 5 5 5 giving up dumping to dev 20001 offset 0 dump 16 32 48 64 80 96 112 128 succeeded Automatic reboot in 15 seconds - press a key on the console to abort Reboooting...
Just because the system has panicked doesn't mean that you should panic too. It's a sorry fact of life that software contains bugs. Many commercial systems just crash when they hit a bug, and you never know why, or they print a message like General protection fault, which doesn't tell you very much either. When a UNIX system panics, it usually gives you more detailed information-in this example, the reason is free v node isn't. You may not be any the wiser for a message like this (it tells you that the file system handling has got confused about the current state of storage on a disk), but other people might. In particular, if you do get a panic and you ask for help on FreeBSD-questions, please don't just say "My system panicked, what do I do?" The first answer—if you get one— will be "What was the panic string??" The second will be "Where's the dump?"
After panicking, the system tries to write file system buffers back to disk so that they don't get lost. This is not always possible, as we see on the second line of this example. It started off with 14 buffers to write, but it only managed to write 9 of them, possibly because it was confused about the state of the disk. This can mean that you will have difficulties after rebooting, but it might also mean that the system was wrong in its
In addition to telling you the cause of the panic, FreeBSD will optionally copy the current contents of memory to the
dumpdev="NO" # Device name to crashdump to (if enabled)
To enable dumping, put something like this in /boot/loader.conf:
dumpdev="/dev/ad0s1b"
This enables the dumps to be taken even if a panic occurs before the system reads the /etc/rc.conf file. Make sure that the name of the dumpdev corresponds to a swap partition with at least as much space as your total memory. You can use pstat to check this:
# pstat –s Device 1024-blocks Used Avail Capacity Type /dev/ad0s1b 51200 50108 1028 98% interleaved /dev/da0s1b 66036 51356 14616 78% interleaved /dev/da2s1b 204800 51220 153516 25% interleaved Total 321844 152684 169160 47%
As long as this machine doesn't have more than about 192 MB of memory, it will be possible to take a dump on /dev/da2s1b.
In addition, ensure that you have a directory called /var/crash. After rebooting, the system first checks the integrity of the file systems, then it checks for the presence of a dump. If it finds one, it copies the dump and the current kernel to /var/crash.
It's always worth enabling dumping, assuming your gdb—see page 623 for more details.
To get the best results from a dump analysis, you need a debug kernel.This kernel is identical to a normal kernel, but it includes a lot of information that can be used for dump analysis. See page 614 for details of how to build a debug kernel. You never know when you might run into a problem, so I highly recommend that you use a debug kernel at all times. It doesn't have any effect on the performance of the system.
A really massive crash may
In either case, the hard disks aren't mounted; you might want to do repair work on them before any other access.
Use this option only if you have a good understanding of the system
The description at the beginning of this chapter applied to the most common installation method, from CD-ROM. In the following sections we'll look at the relatively minor differences needed to install from other media. The choices you have are, in order of
If your machine is no longer the youngest, you may be able to read the
The way you get the boot
# dd if=/cdrom/floppies/k:erri.flp of=/dev/fd0 bs=36b change the floppy # dd if=/cdrom/floppies/mfsroot.flp of=/dev/fd0 bs=36b change the floppy # dd if=/cdrom/floppies/drivers.flp of=/dev/fd0 bs=36b
This assumes that your software is on CD-ROM, and that it is mounted on the directory /cdrom. It also assumes that your
The dd implementation of some versions of UNIX, particularly older System V variants, may complain about the option bs=36b. If this happens, just leave it out. It might take up to 10 minutes to write the floppy, but it will work, and it will make you appreciate FreeBSD all the more.
If you have to create the boot floppy from Microsoft, use the program FDIMAGE.EXE, which is in the tools directory of the first CD-ROM.
In almost all cases where you don't boot from CD-ROM, you'll boot from floppy, no matter what medium you are installing from. If you are installing from CD-ROM, put the CD-ROM in the drive before booting. The installation may fail if you boot before inserting the CD-ROM.
Boot the system in the normal manner from the first floppy (the one containing the kern.flp image). After loading the kernel, the system will print the message:
Please insert MFS root floppy and press enter
After you replace the floppy and press enter, the boot procedure carries on as before.
If you're using the 2.88 MB image on a 2.88 MB floppy or an LS-120 drive, you have every thing you need on the one disk, so you don't get the prompt to change the disk. Depending on your hardware, you may later get a prompt to install additional drivers from the driver floppy.
The fun way to install FreeBSD is via the Internet, but it's not always the best choice. There's a lot of data to transfer, and unless you have a really
There are two ftp installation modes you can use:
Whichever mode of installation and whichever remote machine you choose, you need to have access to the remote machine. The easiest and most common way to ensure access is to use anonymous ftp. If you're installing from another FreeBSD machine, read how to install anonymous ftp on page 450. This information is also generally correct for other UNIX systems.
Put the FreeBSD distribution in the public ftp directory of the ftp server. On BSD systems, this will be the home directory of user ftp, which in FreeBSD defaults to /var/spool/ftp The name of the directory is the name of the release, which in this example we'll assume to be 5.0-RELEASE. You can put this directory in a subdirectory of /var/spool/ftp, for example /var/spool/ftp/FreeBSD/5.0-RELEASE, but the only optional part in this example is the parent directory FreeBSD.
This directory has a slightly different structure from the CD-ROM distribution. To set it up, assuming you have your distribution CD-ROM mounted on /cdrom, and that you are installing in the directory /var/spool/ftp/FreeBSD/5.0-RELEASE, perform the following steps:
# cd /var/spool/ftp/FreeBSD/5.0-RELEASE # mkdir floppies # cd floppies # cp /cdrom/floppies/* . don't omit the . at the end # cd /cdrom the distribution directory on CD-ROM # tar cf - . | (cd /var/spool/ftp/FreeBSD/5.0-EELEASE; tar xvf -)
This copies all the directories of /cdrom into /var/spool/ftp/FreeBSD/5.0-RELEASE. For a minimal installation, you need only the directory base. To just install base rather than all of the distribution, change the last line of the example above to:
# mkdir base # cp /cdrom/base/* base
On page 77 we saw the media select menu. Figure 5-16 shows the menu you get when you select . hostname is the name of the system, in this case presto.example.org, and pathname is the path relative to the anonymous ftp directory, which on FreeBSD systems is usually /var/spool/ftp.The install program knows its version number, and it attaches it to the name you supply.
In this case, we're installing Release 5.0 of FreeBSD, and it's in the directory . The next menu asks you to configure your network. This is the same menu that you would normally fill out at the end of the installation—see page 98 for details.
This information is used to set up the machine after installation, so it pays to fill out this information correctly. After entering this information, continue with Commit (on page 77).
(рис 5.19) Selecting ftp server
If you're installing from a V
Next, you give this information to sysinstall, as shown in Figure 5-17 . After entering this information, sysinstall asks you to configure an interface. This is the same procedure that you would otherwise do after installation—see page 98. After performing this configuration, you continue with Commit (on page 77).
On the Intel architecture you can also install from a primary Microsoft partition on the first disk. To prepare for installation from a Microsoft partition, copy the files from the distribution into a directory called C:\FREEBSD. For example, to do a minimal installation of FreeBSD from Microsoft using files copied from a CD-ROM, copy the directories floppies and base to the Microsoft directories C:\FREEBSD\FLOPPIES and C:\FREEBSD\BIN respectively. You need the directory FLOPPIES because that's where sysinstall looks for the boot.flp, the first image in every installation.
(рис 5.20) Specifying NFS file system
The only required directory is base. You can include as many other directories as you want, but be sure to maintain the directory structure. In other words, if you also wanted to install XF86336 and manpages, you would copy them to C:\FREEBSD\XF86336 and C:\FREEBSD\MANPAGES.
Installation from
Before starting, format all floppies in the drive you intend to use, even if they are preformatted.
The first two floppies you'll need are the Kernel floppy and the
In addition, you need at minimum as many floppies as it takes to hold all files in the base directory, which contains the binary distribution. Read the file LAYOUT.TXT paying special attention to the "Distribution format" section, which describes which files you need.
If you're creating the floppies on a FreeBSD machine, you can put ufs file systems on the floppies instead:
# fdformat -f 1440 fd0.1440 # bsdlabel -w fd0.1440 floppy3 # newfs -t 2 -u 18 -l 1 -i 65536 /dev/fd0
Next, copy the files to the floppies. The distribution files are split into chunks that will fit exactly on a conventional 1.44MB floppy. Copy one file to each floppy. Make very sure to put the file base.inf on the first floppy; it is needed to find out how many floppies to read.
The installation itself is straightforward enough: follow the instructions starting on page 63, select Floppy in the
Для получения официальных документов о завершении программы дополнительного профессионального образования (удостоверения о повышении квалификации, дипломов о профессиональной переподготовке и MBA) необходимо предоставить:
Внимание! Вы можете не заказывать доставку бумажной версии официального документы, а скачать его в электронном виде и распечатать самостоятельно. Информация о выданном документе в течение 1 месяца загружается в Федеральную информационную систему «Федеральный реестр сведений о документах об образовании и (или) о квалификации, документах об обучении» - ФИС ФРДО.
Доступ на новый сайт осуществляется с использованием адреса электронной почты, который был указан вами при регистрации на "старом". Мы постарались перенести все ваши данные с прежнего ресурса, однако не исключена вероятность потери части информации.
При возникновении проблемы со входом, воспользуйтесь функцией сброса пароля
Если вы обнаружите несоответствия, пожалуйста, сообщите нам.