分割您的硬碟指的僅是將您的硬碟空間切分成幾塊。分割之後,每一塊都是獨立於其餘部分的單獨空間。這和在一個大房幾里砌堵牆有幾分相似 如果您在其中一間房間裡安置傢俱,不會對其它房間有任何影響。
If you already have an operating system on your system (Windows 9x, Windows NT/2000/XP, OS/2, MacOS, Solaris, FreeBSD, …) and want to stick Linux on the same disk, you will need to repartition the disk. Debian requires its own hard disk partitions. It cannot be installed on Windows or MacOS partitions. It may be able to share some partitions with other Linux systems, but that's not covered here. At the very least you will need a dedicated partition for the Debian root.
You can find information about your current partition setup by using a partitioning tool for your current operating system, such as fdisk or PartitionMagic. Partitioning tools always provide a way to show existing partitions without making changes.
在一般情況下,改動一個已經建立檔案系統的分割區,會導致其中的資料遭到損毀。因而,您每次都應當在重新分割之前先做好備份。繼續拿房幾作比喻,在移動牆壁時,您最好在把擋路的傢俱都移開,否則就要冒著傢俱被破壞的危險。
如果您的電腦配有不只一塊硬碟,您或許可以考慮把其中一塊硬碟專門分配給 Debian 使用。這樣的話,您就不用在開機安裝系統前再對那塊硬碟進行分割區了,安裝程式內建的分割區程式會漂亮地完成這個任務。
If your machine has only one hard disk, and you would like to completely replace the current operating system with Debian GNU/Linux, you also can wait to partition as part of the installation process (節 6.3.2, “分割區與選擇掛載點”), after you have booted the installation system. However this only works if you plan to boot the installer system from tapes, CD-ROM or files on a connected machine. Consider: if you boot from files placed on the hard disk, and then partition that same hard disk within the installation system, thus erasing the boot files, you'd better hope the installation is successful the first time around. At the least in this case, you should have some alternate means of reviving your machine like the original system's installation tapes or CDs.
倘若您的機器已經有多個分割區,並且透過刪除或替換它們其中的一個或多個就能為安裝程式提供足夠的空間,那麼您一樣也可以把分割區操作延後,到安裝時再使用 Debian 安裝程式內建的分割工具。不過,您還是應該繼續讀完下面的文件,因為可能會有些特殊情形。例如,分割表中現有分割區的順序問題,這也許會令您不得不在安裝前先切割好分割區。
如果您的電腦上有被 DOS 和 Windows 使用的 FAT 或 NTFS 檔案系統,您可以等到用 Debian 安裝程式中的分割工具來重新調整檔案系統的大小。
如果您的情況不屬於上面任何一種,那麼您需要在開始安裝之前,事先為 Debian 騰出可用於分割區的空間。要是有分割區是為其它作業系統準備的,您最好用該作業系統自己的分割軟體來建立這些分割區。我們建議您不要用其它作業系統裡的工具為 Debian 建立 Linux 分割區。也就是說,您應當僅建立要保留的作業系統自身的分割區。
倘若您打算在同一台機器上安裝多個作業系統,您應當在安裝 Linux 之前,先把所有其它系統都裝好。Windows 和其它作業系統的安裝過程可能會讓您無法開機 Linux,也可能會慫恿您重新格式化不屬於它們自己的分割區。
儘管您可以在這些操作之後再恢復回來,也可以避免它們,但是首先安裝本地系統就能夠幫您免除這些煩惱。
如果您現在有一塊硬碟,這塊硬碟上僅有一個分割區 (這是桌面電腦的常見設定),同時您希望能多重開機原有的作業系統和 Debian,那麼您就需要:
備份電腦裡所有的資料。
從原有作業系統的安裝媒介(如光碟和磁帶)開機。
使用原有系統裡的分割區工具來建立屬於原來系統的分割區。為 Debian GNU/Linux 預留一個分割區,或者騰出一塊空間。
把原有作業系統安裝到屬於它的新分割區上。
開機到原有作業系統,以確保一切正常,再下載 Debian 安裝程式的開機檔案。
啟動 Debian 安裝程式,並繼續安裝 Debian。
如果您想在已有的 FAT 或 NTFS 分割區上動手,那麼建議您或者按照下面介紹的方案操作,或者使用 Windows 或 DOS 自己的工具軟體。否則的話,真的沒必要從 DOS 或者 Windows 分割,一般來說,Linux 的分割軟體會做得更好。
But if you have a large IDE disk, and are not using LBA addressing, overlay drivers (sometimes provided by hard disk manufacturers), or a new (post 1998) BIOS that supports large disk access extensions, then you must locate your Debian boot partition carefully. In this case, you will have to put the boot partition into the first 1024 cylinders of your hard disk (usually around 524 megabytes, without BIOS translation). This may require that you move an existing FAT or NTFS partition.
One of the most common installations is onto a system that already contains DOS (including Windows 3.1), Win32 (such as Windows 95, 98, Me, NT, 2000, XP), or OS/2, and it is desired to put Debian onto the same disk without destroying the previous system. Note that the installer supports resizing of FAT and NTFS filesystems as used by DOS and Windows. Simply start the installer and when you get to the partitioning step, select the option for partitioning, select the partition to resize, and specify its new size. So in most cases you should not need to use the method described below.
在您繼續之前,您應該先想好如何分割硬碟。本節所述的方法只會把一個分割區一分為二。分出來的其中一塊放至原來的作業系統,而另一塊則歸 Debian 使用。在 Debian 的安裝過程中,您會有機會把您認為合適的那部分硬碟歸為 Debian 使用。例如,用作置換分割區或者放置檔案系統。
辦法就是在更改分割區資料之前,把這個分割區中的所有的資料移到分割區的前面部分,這樣資料就會分毫無損。有一點很重要,即在移動資料之後,和重新分割區之前這段時間內,盡量不要往分割區的後端寫入資料。否則就會減少從能該分割區分割出去的空間大小。
第一件需要的東西是一份 fips 的拷貝。您可以從離您最近的 Debian 鏡像裡的 tools/ 目錄下載它。解開這個 zip 壓縮檔案,把 RESTORRB.EXE、FIPS.EXE 和 ERRORS.TXT 複製到一張開機軟碟裡。您可以用在 DOS 下面用 sys a: 來製作開機磁片。fips 含有相當不錯的文件,您也許會想看看。倘若您正在用磁碟壓縮驅動程式或者磁碟管理員,那麼您絕對有必要讀一下這份文件。在您為這顆硬碟清理零碎磁區之前請先做一張開機片並好好閱讀該文件。
下一件要做的事,是把所有的資料移動到分割區的前面。DOS 自 6.0 後就包含了 defrag 程式,它可以很方便地完成這個任務。請參閱 fips 文件查看其他可用來執行此任務的軟體列表。要提醒的是,如果您用的是 Windows 9x,那麼必須在 Windows 裡執行 defrag,原因是 DOS 不能識別 Windows 95 及其以後版本所使用的支援長檔名的 VFAT 分割區。
零碎磁區清理程式 (defragmenter) 運行完畢後 (如果硬碟容量較大需要等比較久),用您在軟碟機裡製作的 fips 軟碟重新開機。只須輸入 a:\fips 然後按照提示操作。
請注意,如果覺得 fips 不好用,還有許多其它的分割工具可供差遣。
如果您用 Linux 的工具軟體來為 DOS 硬碟分割區或更動了 DOS 分割區大小,請注意,有許多人在這樣做了以後,於使用新分割出來的或者大小被改變的 FAT 分割區的過程中發現各式各樣的問題。舉例來說,有些人回報發現性能下降,有的人則在使用 scandisk 時發現有一致性 (consistent) 的問題, 還有其它在 DOS 或 Windows 中發現的各種古怪的錯誤。
Apparently, whenever you create or resize a partition for DOS use, it's a good idea to fill the first few sectors with zeros. You should do this prior to running DOS's format command by executing the following command from Linux:
# dd if=/dev/zero of=/dev/hdXX bs=512 count=4