The following sections will guide you through preparing for and actually installing FreeBSD. If you find something missing, please let us know about it by sending email to the FreeBSD documentation project mailing list <freebsd-doc@FreeBSD.org>.
There are various things you should do in preparation for the installation. The following describes what needs to be done prior to each type of installation.
The first thing to do is to make sure your hardware is supported by FreeBSD. The list of supported hardware should come in handy here. ;-) 條列出您已經安裝的任何"特殊"裝置卡是很有幫助的, 例如:SCSI 控制器、Ethernet 轉接器、或是音效卡。 這些條列出來的東西應包含必要的設定參數, 像是中斷(IRQ)和 IO port 的位置。
You may need to prepare some floppy disks. These disks will be used to boot your computer in to the FreeBSD install process. This step is not necessary if you are installing from CD-ROM, and your computer supports booting from the CD-ROM. If you do not meet these requirements then you will need to create some floppies to boot from.
Note: If you are not sure whether your computer can boot from the CD-ROM it does not hurt to try. Just insert the CD-ROM as normal and restart your computer. You might need to adjust some options in your BIOS so that your computer will try and boot from the CD-ROM drive before the hard disk.
Tip: Even if you have the CD-ROM it might make sense for you to download the files. There have been occasions where bugs in the FreeBSD installer have been discovered after the CDs have been released. When this happens the copies of the images on the FTP site will be fixed as soon as possible. Obviously, it is not possible to update the CDs after they have been pressed.
Acquire the boot floppy images
These are files with a .flp extension. If you have a CD-ROM release of FreeBSD then you will find the files in the floppies subdirectory. Alternatively, you can download the images from the floppies directory of the FreeBSD FTP site or your local mirror.
The names of the files you will need varies between FreeBSD releases (sometimes) and the architecture you will be installing on. The installation boot image information on the FTP site provides up-to-the-minute information about the specific files you will need.
Prepare the floppy disks
You must prepare one floppy disk per image file you had to download. It is imperative that these disks are free from defects. The easiest way to test this is to format the disks for yourself. Do not trust pre-formatted floppies.
Important: If you try to install FreeBSD and the installation program crashes, freezes, or otherwise misbehaves one of the first things to suspect is the floppies. Try writing the floppy image files to some other disks, and try again.
Write the image files to the floppy disks.
The image files, such as kern.flp, are not regular files you copy to the disk. Instead, they are images of the complete contents of the disk.
This means that you can not use commands like DOS' copy to write the files. Instead, you must use specific tools to write the images directly to the disk.
If you are creating the floppies on a computer running DOS then we provide a tool to do this called fdimage.
If you are using the floppies from the CD-ROM, and your CD-ROM is the E: drive then you would run this:
E:\> tools\fdimage floppies\kern.flp A:
Repeat this command for each .flp file, replacing the floppy disk each time. Adjust the command line as necessary, depending on where you have placed the .flp files. If you do not have the CD-ROM then fdimage can be downloaded from the tools directory on the FreeBSD FTP site.
If you are writing the floppies on a Unix system (such as another FreeBSD system) you can use the dd(1) command to write the image files directly to disk. On FreeBSD you would run:
# dd if=kern.flp of=/dev/rfd0
在 FreeBSD 系統,/dev/rfd0 是指第一個磁碟片 (A: 槽)。 /dev/rfd1 就是 B: 槽,以此類推。 Other Unix variants might have different names for the floppy disk devices, and you will need to check the documentation for the system as necessary.
如果您的 CDROM 是一種不被支援的類型,那麼請跳到MS-DOS Preparation。
要成功的從 Walnut Creek's FreeBSD CDROMs 安裝(其他類型的 CDROM 可能也可以跑得很好。可是我們不能很確定, 因為我們不可能絕對的知道它們是怎麼樣被製造出來的), 並不需要有太多的預先準備工作。您也可以從DOS啟動進入 CD 的安裝, 使用 Walnut Creek's 支援的install.bat 批次檔, 或者您可以製作一張裡面有 makeflp.bat 指令的開機片。
If the CD has El Torito boot support and your system supports booting directly from the CDROM drive (many older systems do NOT), simply insert the first CD of the set into the drive and reboot your system. You will be put into the installation menu directly from the CD.
If you are installing from an MS-DOS partition and have the proper drivers to access your CD, run the install.bat script provided on the CDROM. This will attempt to boot the FreeBSD installation directly from DOS.
Note: You must do this from actual DOS (i.e., boot in DOS mode) and not from a DOS window under Windows.
對這所有之中最簡單的介面(從 DOS ),鍵 view 。DOS 選單的工具會引導您,告訴您有那些選項是可用的。
如果您正從UNIX的系統製作一張開機磁片,看看 Creating the Boot Floppies 的範例,會教您如何製作開機磁片。
一旦您已經從 DOS 或磁碟片開機,您應該可以在 Media 選單中選擇 CDROM 當作 media 的類別,並從 CDROM 載入全部必須的資料。 這樣就不需要其他種類的 media。
當您的系統已經完全安裝完,並且您已經從硬碟重新啟動後, 您可以藉著鍵入以下的指令隨時 mount CDROM:
# mount /cdrom
Before removing the CD from the drive again, you must first unmount it. This is done with the following command:
# umount /cdrom
別只是將它從 drive 上移除!
Note: 在啟動安裝之前,確定光碟在光碟機中, 那麼安裝精靈會找到它。這麼做能確保 CDROM 在安裝的過程會被探測器偵測到、系統自動設為已知的裝置。 (只要您是以 CDROM 作為安裝的 media)
最後,如果您希望別人能藉由 FTP 您的電腦的 CDROM 來安裝 FreeBSD, 那也很容易。在電腦完全安裝好之後,您只要在 password 檔中加入下面幾行字(使用vipw指令):
ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent
任何人都可以經由網路連到您的機器(要有登入的許可)選擇 media 為 FTP,並在 FTP 位置選單中選擇"其他"之後,鍵入: ftp://your machine
Note: If you choose to enable anonymous FTP during the installation of your system, the installation program will do the above for you.
如果您必須從磁碟片安裝 (我們建議您不要這樣做)。 也許是因為您的硬體不被支援,或者是您喜歡做艱難的事, 您首先要準備的是一些安裝時所必須的磁片。
至少,您必須有足夠多 1.44MB 或 1.2MB 的磁片,拿來存所有的 bin (binary distribution) 目錄。 如果您在DOS環境下準備這些磁片, 那麼這些磁片一定要用 MS-DOS 的 FORMAT 指令來製作格式。 如果是在 Windows 環境下,則使用 Windows 檔案管理員的 "Format" 指令。
不要相信廠商對磁片已經預先製作格式! 自己再格式化磁片一次,一定要確定磁片是格式化過的。 在過去有許多使用者安裝時發生問題,都是因為磁片未正確格式化, 這就是為什麼我要在這邊特別強調這點的緣故。
如果您正在另一部 FreeBSD 的機器製作磁片, 即使您並不需要在每一張磁片放置 DOS 檔案系統,格式化還是必要的。 您可以使用 disklabel 和 newfs 指令來放置UFS檔案系統在磁片上, 而不必像下面所說的一長串的指令(針對 3.5吋 1.44MB 的磁碟片):
# fdformat -f 1440 fd0.1440
# disklabel -w -r fd0.1440 floppy3
# newfs -t 2 -u 18 -l 1 -i 65536 /dev/rfd0Note: 針對 5.25吋 1.2MB 的磁片,則改為fd0.1200 和 floppy5。
然後您就可以 mount 和 write 這些磁片像其他檔案系統一樣。
在您格式化這些磁片之後,您將必須拷貝檔案到磁片中。 這些 distribution 檔案都被切割成剛好可存進五片 1.44MB 磁碟片。 查閱您所有的磁片,找出所有有可能適合的檔案。 直到您找到所有需要的配置並且將它們以這種方式安置。 每一個配置都應該有一個子目錄在磁片上,例如: a:\bin\bin.aa、 a:\bin\bin.ab 諸如此類。
當您進入選擇安裝的 media,選擇 "Floppy", 立即到下一步。
為了要在 MS-DOS 磁碟槽安裝,從 distribution 拷貝檔案到 c:\freebsd。目錄下。這個 CDROM 的樹狀架構的目錄一定是只有部分目錄被複製到, 因此我們建議使用 DOS 的 xcopy 指令。 例如,準備一個最簡單的 FreeBSD 的安裝:
C:\> md c:\FreeBSD
C:\> xcopy e:\bin c:\FreeBSD\bin\ /s
C:\> xcopy e:\manpages c:\FreeBSD\manpages\ /s假設 C: 是有足夠空間的磁區, E: 是已被 mount 的 CDROM。
If you do not have a CDROM drive, you can download the distribution from ftp.FreeBSD.org. Each distribution is in its own directory; for example, the bin distribution can be found in the 4.3/bin directory.
對很多 distributions 來說,如果您希望從 MS-DOS 安裝的話 (您有足夠的空間), 安裝c:\freebsd 下的每個檔案 -- 這個 BIN dist 只是最低限度的需求。
從磁帶安裝也許是最簡單的方式,比線上使用 FTP 或使用 CDROM 還快。 安裝的程式假設是簡易的被壓縮在磁帶上, 所以在拿到所有您有興趣的配置的檔案後,簡易的壓縮他們, 如下面的指令:
# cd /freebsd/distdir
# tar cvf /dev/rwt0 dist1 ... dist2當您開始要安裝,您應該要確定您有留足夠的空間在一些暫時的目錄中 (那些允許您可以選擇的) 提供您在磁帶上產生的所有 內容。為了可以隨意讀取磁帶, 這個安裝方法需要大量的暫時儲存空間。 您應該假設需要的暫時儲存空間就如同原本在磁帶上的一樣多。
Note: 當要開始安裝,以開機片開機之前, 磁帶一定要在裝置中。否則安裝時探測裝置或許會偵測不到。
您可以用三種連接方式來做網路安裝。 Serial port (SLIP or PPP)、Parallel port (PLIP (laplink cable))、 或是 Ethernet (a standard ethernet controller (includes some PCMCIA)).
SLIP support 是相當原始的,並且被限制在主要對 hard-wired 的連接, 就像一部手提式電腦與另一部電腦之間的 serial cable。現在的 SLIP 的安裝還沒提供 dialing 功能,這個連接應該是 hard-wired;PPP 提供了這一種應該首先盡可能被用於SLIP的設備。
如果您正使用 modem,那麼 PPP 是您唯一的選擇。 當您在安裝的過程中,要確定您能很容易的獲得完整且快速的關於您的 service provider 的資訊。
如果您正使用 PAP 或 CHAP (in other words, if you can connect to the ISP in Windows without using a script),then all you will need to do is type in dial at the ppp prompt. 否則,當 PPP 連結者只提供一種最簡單的末端連結, 您必須知道如何使用您的 modem "AT commands" 想知道更深入的資訊可以查詢 user-ppp handbook 與 FAQ。如果您有一些問題, 使用您所在環境裡 set log local ... 指令查詢, 結果會顯示在螢幕上....
>如果 hard-wired 連接到另一個 FreeBSD (2.0版以後)是可以做到的, 也許您也想利用 "laplink" 平行埠 cable 來安裝。 平行埠的資料傳輸速度比起傳統的 serial line 快很多(提升到50k/sec), 安裝速度也就加快了。
最後,為了達到最迅速的網路安裝, 一個乙太網路的轉接器是不錯的選擇!FreeBSD 支援大部分常見的 PC 乙太網路卡,在 Supported Hardware 中有提供一份這些卡(和他們需要的設定) 的列表。如果您正使用一張有被支援的 PCMCIA 乙太網路卡, 請在手提電腦開機 前 插好它。很不幸的, 當正在安裝的過程,FreeBSD 並不支援隨插即用的 PCMCIA 卡。
您必須知道您的 IP 在網路上的位址、關於您的位址類別的 netmask 值、您的機器的名字。 If you are installing over a PPP connection and do not have a static IP, fear not, the IP address can be dynamically assigned by your ISP. 您的系統的管理者可以告訴您什麼是最適合您的網路設定。 如果您是使用名字去查詢其他的 hosts 而不是用 IP 位址,您需要一個 name server。或許再加上 gateway 的位址 (如果您正使用 PPP,就是您的 provider 的 IP 位址) to use in talking to it。 If you want to install by FTP via a HTTP proxy (see below), you will also need the proxy's address. 如果您完全不知道或不知道大部分剛剛所問的這些問題的答案, 您應該在嘗試安裝之前,先 問問您的系統管理者這些答案。
NFS 安裝相當地直接:簡單的拷貝 FreeBSD distribution 檔案 到一個伺服器的某處,並且指出 NFS 媒體,並選它。
如果這個伺服器只支援"特權階級"的存取 (就像 Sun 工作站的一般預設),您必須在可以安裝之前, 去主選單設定這個選項。
如果您有一塊相當差的乙太網路卡,提供相當慢的轉換速度。 您也許希望能選到最適合的選項。
為了達到 NFS 安裝,這個伺服器必須提供 subdir 掛上,例如, 如果您的FreeBSD 4.3 目錄存在: ziggy:/usr/archive/stuff/FreeBSD 然後 ziggy 將必須允許直接掛上 /usr/archive/stuff/FreeBSD, 而不僅是 /usr 或 /usr/archive/stuff。
在 FreeBSD 的 /etc/exports 檔案,是由 -alldirs 選項控制。 其他的NFS伺服器也許有不同的方式。如果您從伺服器那得到 Permission Denied 這個訊息, 可能是因為您沒有正確地 enable 它。
您可以從任何的 mirror 主機,包含有更新版本的 FreeBSD, 來做 FTP 安裝。一個擁有幾乎全世界所有可選擇的位置的選單是由 FTP 位置選單所提供。
如果您正在從其他 FTP 位置安裝而不是從選單中的位置, 您或許會在找尋您的伺服器適當的配置上發現某種問題。 您也可以藉由在選單選擇 "Other" 來指定您擁有的 URL。 一個 URL 也可以是一個直接的 IP address,所以以下所述的可以在欠缺 name server 時運作:
ftp://209.55.82.20/pub/FreeBSD/4.3-RELEASE
您有三種 FTP 安裝模式可以選擇: active or passive FTP or via a HTTP proxy.
對所有 FTP 轉換,使用 "Active" 模式。 這個經過防火牆將不會運作,但是通常可以在舊的、沒有提供 passive 模式的 ftp 伺服器中運作。 如果您的連接當在 passive 模式(預設),試試 active!
對所有 FTP 轉換,使用 "Passive" 模式。 這模式允許使用者通過不讓亂數port位址連接進入的防火牆。
This option instructs FreeBSD to use the HTTP protocol (like a web browser) to connect to a proxy for all FTP operations. The proxy will translate the requests and send them to the FTP server. This allows the user to pass through firewalls that do not allow FTP at all, but offer a HTTP proxy. In this case, you have to specify the proxy in addition to the FTP server.
Note: There is another type of FTP proxy other tha HTTP proxies. This type is very uncommon, though. If you are not absolutely certain, you can assume that you have a HTTP proxy as described above.
對一個 proxy FTP 伺服器,您應該要提供您真正想要的伺服器 的名稱當作一部份的 username (在 @ 符號之後)。然後 proxy 伺服器 "fakes" 真正的伺服器。 舉個例子:您想從 ftp.FreeBSD.org 安裝,使用 proxy FTP 伺服器 foo.bar.com,port 是 1234。
在這個情形下,您到選單目錄,設定 FTP username 為 ftp@ftp.freebsd.org,password 設為您的 e-mail 位址。 安裝的 media,設定為 FTP (或著 passive FTP,如果這個 proxy 支援它), 設定 URL ftp://foo.bar.com:1234/pub/FreeBSD。
Since /pub/FreeBSD from ftp.FreeBSD.org is proxied under foo.bar.com, you are able to install from that machine (which will fetch the files from ftp.FreeBSD.org as your installation requests them.
If you have used features in your BIOS to renumber your disk drives without re-cabling them then you should read Section 10.2 first to avoid confusion.
一旦您知道正確的安裝前準備步驟, 您應該就可以免除所有的困擾順利安裝 FreeBSD!
雖然不應該經歷任何困難,但是總是有機會遇到。 如果情況是這樣,那麼您可能希望回去之前重新研讀相關的事先準備部分, 也許有些有用的提示在您第一次研讀時漏掉了。 If you are having hardware problems, or FreeBSD refuses to boot at all, read the Hardware Guide for a list of possible solutions.
FreeBSD 開機片中包含所有的線上文件,應該足以讓您順利完成安裝, 假如不能,我們想知道您遇到什麼樣的問題。將您的意見 mail 到 FreeBSD documentation project mailing list <freebsd-doc@FreeBSD.org>。FreeBSD 安裝程式(sysinstall)的目標是 self-documenting 到讓令人厭煩的 "一個步驟一個步驟" 的引導手冊不再被需要。我們需要時間達到這個目標, 但這是可以做到的。 :-)
同時,您會發現下面的"典型的安裝步驟"是有用的:
以 kern.flp 磁碟片開機,當詢問, 取走它並且插入 mfsroot.flp 磁碟片並按 return。 在一段開機程序之後會花三十秒到三分鐘 (這跟您的硬體有關), 您應該會看到一個初始設定的選單。如果 kern.flp 磁碟片沒有開機完成,或著在某個步驟當掉,請去 硬體手冊中的 Q&A 部分找尋可能的原因。
按 F1。您應該會在選單系統上看到一些基本的使用指令, 和一般的引導步驟。如果您以前沒有使用過這個選單系統, 請仔細的研讀它!
選擇選項並設定您自己的特別喜好。
選擇「初學者」、「專家」或「自訂」安裝, 依照您在安裝過程中需要多少的協助來決定, 在安裝時的每個步驟給您最高等級的控制權, 或者快速簡單的完成安裝 (可能的話使用合理的預設)。 如果您從未使用過 FreeBSD,那麼最建議您用初學者的安裝方式。
最後的選單給您 menu-driven access 各種系統的預設值讓您能更深入的規劃您的 FreeBSD 安裝。一些項目, 像網路,也許是特別重要的,尤其是您已經做過 CDROM/磁帶/磁片安裝, 卻還沒設定過您的網路介面 (假設您有)。 適當的配置某些介面將會使您的 FreeBSD 第一次從硬碟開機的時候網路就可以使用。