📄 install-steps.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Allocating Disk Space</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Installing FreeBSD" href="install.html" /><link rel="PREVIOUS" title="Introducing Sysinstall" href="using-sysinstall.html" /><link rel="NEXT" title="Choosing What to Install" href="install-choosing.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="using-sysinstall.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 2 Installing FreeBSD</td><td width="10%" align="right" valign="bottom"><a href="install-choosing.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="INSTALL-STEPS" name="INSTALL-STEPS">2.5 Allocating DiskSpace</a></h1><p>Your first task is to allocate disk space for FreeBSD, and label that space so that <bclass="APPLICATION">sysinstall</b> can prepare it. In order to do this you need to knowhow FreeBSD expects to find information on the disk.</p><div class="SECT2"><h2 class="SECT2"><a id="INSTALL-DRIVE-BIOS-NUMBERING"name="INSTALL-DRIVE-BIOS-NUMBERING">2.5.1 BIOS Drive Numbering</a></h2><p>Before you install and configure FreeBSD on your system, there is an important subjectthat you should be aware of, especially if you have multiple hard drives.</p><p>In a PC running a BIOS-dependent operating system such as <spanclass="TRADEMARK">MS-DOS</span>® or <spanclass="TRADEMARK">Microsoft</span>® <span class="TRADEMARK">Windows</span>®,the BIOS is able to abstract the normal disk drive order, and the operating system goesalong with the change. This allows the user to boot from a disk drive other than theso-called ``primary master''. This is especially convenient for some users who have foundthat the simplest and cheapest way to keep a system backup is to buy an identical secondhard drive, and perform routine copies of the first drive to the second drive using <bclass="APPLICATION"><span class="TRADEMARK">Ghost</span>®</b> or <bclass="APPLICATION">XCOPY</b> . Then, if the first drive fails, or is attacked by avirus, or is scribbled upon by an operating system defect, he can easily recover byinstructing the BIOS to logically swap the drives. It is like switching the cables on thedrives, but without having to open the case.</p><p>More expensive systems with SCSI controllers often include BIOS extensions which allowthe SCSI drives to be re-ordered in a similar fashion for up to seven drives.</p><p>A user who is accustomed to taking advantage of these features may become surprisedwhen the results with FreeBSD are not as expected. FreeBSD does not use the BIOS, anddoes not know the ``logical BIOS drive mapping''. This can lead to very perplexingsituations, especially when drives are physically identical in geometry, and have alsobeen made as data clones of one another.</p><p>When using FreeBSD, always restore the BIOS to natural drive numbering beforeinstalling FreeBSD, and then leave it that way. If you need to switch drives around, thendo so, but do it the hard way, and open the case and move the jumpers and cables.</p><table class="SIDEBAR" border="1" cellpadding="5"><tr><td><div class="SIDEBAR"><a id="AEN1698" name="AEN1698"></a><p><b>An Illustration from the Files of Bill and Fred's Exceptional Adventures:</b></p><p>Bill breaks-down an older Wintel box to make another FreeBSD box for Fred. Billinstalls a single SCSI drive as SCSI unit zero and installs FreeBSD on it.</p><p>Fred begins using the system, but after several days notices that the older SCSI driveis reporting numerous soft errors and reports this fact to Bill.</p><p>After several more days, Bill decides it is time to address the situation, so he grabsan identical SCSI drive from the disk drive ``archive'' in the back room. An initialsurface scan indicates that this drive is functioning well, so Bill installs this driveas SCSI unit four and makes an image copy from drive zero to drive four. Now that the newdrive is installed and functioning nicely, Bill decides that it is a good idea to startusing it, so he uses features in the SCSI BIOS to re-order the disk drives so that thesystem boots from SCSI unit four. FreeBSD boots and runs just fine.</p><p>Fred continues his work for several days, and soon Bill and Fred decide that it istime for a new adventure -- time to upgrade to a newer version of FreeBSD. Bill removesSCSI unit zero because it was a bit flaky and replaces it with another identical diskdrive from the ``archive''. Bill then installs the new version of FreeBSD onto the newSCSI unit zero using Fred's magic Internet FTP floppies. The installation goes well.</p><p>Fred uses the new version of FreeBSD for a few days, and certifies that it is goodenough for use in the engineering department. It is time to copy all of his work from theold version. So Fred mounts SCSI unit four (the latest copy of the older FreeBSDversion). Fred is dismayed to find that none of his precious work is present on SCSI unitfour.</p><p>Where did the data go?</p><p>When Bill made an image copy of the original SCSI unit zero onto SCSI unit four, unitfour became the ``new clone''. When Bill re-ordered the SCSI BIOS so that he could bootfrom SCSI unit four, he was only fooling himself. FreeBSD was still running on SCSI unitzero. Making this kind of BIOS change will cause some or all of the Boot and Loader codeto be fetched from the selected BIOS drive, but when the FreeBSD kernel driverstake-over, the BIOS drive numbering will be ignored, and FreeBSD will transition back tonormal drive numbering. In the illustration at hand, the system continued to operate onthe original SCSI unit zero, and all of Fred's data was there, not on SCSI unit four. Thefact that the system appeared to be running on SCSI unit four was simply an artifact ofhuman expectations.</p><p>We are delighted to mention that no data bytes were killed or harmed in any way by ourdiscovery of this phenomenon. The older SCSI unit zero was retrieved from the bone pile,and all of Fred's work was returned to him, (and now Bill knows that he can count as highas zero).</p><p>Although SCSI drives were used in this illustration, the concepts apply equally to IDEdrives.</p></div></td></tr></table></div><div class="SECT2"><h2 class="SECT2"><a id="MAIN-FDISK" name="MAIN-FDISK">2.5.2 Creating Slices UsingFDisk</a></h2><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> No changes you make at this point will be written to the disk. If youthink you have made a mistake and want to start again you can use the menus to exit <bclass="APPLICATION">sysinstall</b> and try again or press <b class="KEYCAP">U</b> to usethe <span class="GUIMENUITEM">Undo</span> option. If you get confused and can not see howto exit you can always turn your computer off.</p></blockquote></div><p>After choosing to begin a standard installation in <bclass="APPLICATION">sysinstall</b> you will be shown this message:</p><pre class="SCREEN"> Message In the next menu, you will need to set up a DOS-style ("fdisk") partitioning scheme for your hard disk. If you simply wish to devote all disk space to FreeBSD (overwriting anything else that might be on the disk(s) selected) then use the (A)ll command to select the default partitioning scheme followed by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a partition marked "unused" and use the (C)reate command. [ OK ] [ Press enter or space ]</pre><p>Press <b class="KEYCAP">Enter</b> as instructed. You will then be shown a list of allthe hard drives that the kernel found when it carried out the device probes. <ahref="install-steps.html#SYSINSTALL-FDISK-DRIVE1">Figure 2-16</a> shows an example from asystem with two IDE disks. They have been called <tt class="DEVICENAME">ad0</tt> and <ttclass="DEVICENAME">ad2</tt>.</p><div class="FIGURE"><a id="SYSINSTALL-FDISK-DRIVE1" name="SYSINSTALL-FDISK-DRIVE1"></a><p><b>Figure 2-16. Select Drive for FDisk</b></p><p><img src="install/fdisk-drive1.png" /></p></div><p>You might be wondering why <tt class="DEVICENAME">ad1</tt> is not listed here. Why hasit been missed?</p><p>Consider what would happen if you had two IDE hard disks, one as the master on thefirst IDE controller, and one as the master on the second IDE controller. If FreeBSDnumbered these as it found them, as <tt class="DEVICENAME">ad0</tt> and <ttclass="DEVICENAME">ad1</tt> then everything would work.</p><p>But if you then added a third disk, as the slave device on the first IDE controller,it would now be <tt class="DEVICENAME">ad1</tt>, and the previous <ttclass="DEVICENAME">ad1</tt> would become <tt class="DEVICENAME">ad2</tt>. Because devicenames (such as <tt class="DEVICENAME">ad1s1a</tt>) are used to find filesystems, you maysuddenly discover that some of your filesystems no longer appear correctly, and you wouldneed to change your FreeBSD configuration.</p><p>To work around this, the kernel can be configured to name IDE disks based on wherethey are, and not the order in which they were found. With this scheme the master disk onthe second IDE controller will <span class="emphasis"><iclass="EMPHASIS">always</i></span> be <tt class="DEVICENAME">ad2</tt>, even if there areno <tt class="DEVICENAME">ad0</tt> or <tt class="DEVICENAME">ad1</tt> devices.</p><p>This configuration is the default for the FreeBSD kernel, which is why this displayshows <tt class="DEVICENAME">ad0</tt> and <tt class="DEVICENAME">ad2</tt>. The machine onwhich this screenshot was taken had IDE disks on both master channels of the IDEcontrollers, and no disks on the slave channels.</p><p>You should select the disk on which you want to install FreeBSD, and then press <spanclass="GUIBUTTON">[ OK ]</span>. <b class="APPLICATION">FDisk</b> will start,with a display similar to that shown in <ahref="install-steps.html#SYSINSTALL-FDISK1">Figure 2-17</a>.</p><p>The <b class="APPLICATION">FDisk</b> display is broken into three sections.</p><p>The first section, covering the first two lines of the display, shows details aboutthe currently selected disk, including its FreeBSD name, the disk geometry, and the totalsize of the disk.</p><p>The second section shows the slices that are currently on the disk, where they startand end, how large they are, the name FreeBSD gives them, and their description andsub-type. This example shows two small unused slices, which are artifacts of disk layoutschemes on the PC. It also shows one large <acronym class="ACRONYM">FAT</acronym> slice,which almost certainly appears as <tt class="DEVICENAME">C:</tt> in <spanclass="TRADEMARK">MS-DOS</span> / <span class="TRADEMARK">Windows</span>, and an extendedslice, which may contain other drive letters for <span class="TRADEMARK">MS-DOS</span> /
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -