將FREESCO安裝到硬碟上

本文將說明如何將FREESCO安裝(又稱為植入或是複製)在硬碟中,同時假設您已經成功的將FREESCO安裝在磁片上,且已經順利的將FREESCO正常運作。也假設您也已經在您的電腦中,安裝好要作為安裝FREESCO系統用的硬碟,以便我們接下去的安裝工作,亦即是將FREESCO安裝在硬碟中。下面的安裝步驟,我們是將硬碟安裝在電腦IDE primary排線的master位置,用Linux術語來說,就是指/dev/hda這個裝置。

有二種方式可以將FREESCO安裝在硬碟中。傳統的方式是將FREESCO安裝在硬碟現有的DOS分割區中。當我們已經將硬碟格式化後,放入FREESCO磁片開機,我們可以在FREESCO開機選單畫面中,選擇mv2hd選項。這個選項的作用,將會直接把FREESCO複製到硬碟中。對於這個方式,不是這篇文章討論的範圍。

另一種方式是將FREESCO安裝到linux格式的硬碟方式,在FREESCO 034版本以後,可以將FREESCO安裝在硬碟的 ext2 硬碟分割區中。ext2的資料系統是遠優於DOS的資料系統,在此不多做描述講解,請網友自行尋找相關的 ext2 文件說明。要將FREESCO安裝在ext2的硬碟分割區中,首先要先安裝ext2 package程式。一旦將ext2 package程式安裝完成後,ext2 package程式就可以製造可以安裝FREESCO系統的ext2硬碟分割區,並且將FREESCO系統安裝在此分割區中。這個方式才是本文要說明的安裝方式,同時我本人也推薦大家使用這種方式。

這表示我們可以將FREESCO真正的變成一個開放且合法的系統,不須將他安裝在DOS的資料分割底下,因為DOS不是免費的系統,對於使用非正版的網友來說,可能有觸法的危險。而後面的安裝說明,都是針對將FREESCO安裝在ext2硬碟分割區中的說明,請網友稍加注意瞭解,最好有一點Linux的概念。如果您還是想將FREESCO安裝在DOS的硬碟分割區中,減低不必要的煩惱,請參考 old tutorial for installing FREESCO這個網頁,裡面有詳細的說明。不過這個頁面的資料,並沒有隨時的更新,因此網友在閱讀網頁時,請依您實際的FREESCO版本安裝,基本上都是大同小異的。

將FREESCO安裝在ext2硬碟分割區中的唯一限制,就是版本的問題。因為不同版本的FREESCO,必須搭配相同版本的ext2 package程式。如034版本的FREESCO就要搭配034版本的ext2 package程式,以此類推後面更新的FREESCO版本。請到Lightnings release announcement網頁下載您安裝的FREESCO相同版本的ext2 package程式。

當FREESCO安裝在硬碟時,如果有swap的磁區是最好的一種方式,您可以規劃一個swap資料區,或是一個獨立的swap硬碟分割區,如果您有一顆多餘的硬碟可以拿來提供swap使用,那應該是最好的選擇了。關於swap的一些好處及說明,也請網友自行參考相關資料,這裡不在贅述。

swap的容量大小,一般都是規劃您電腦記憶體的2倍容量大小,而且FREESCO本身對於swap硬碟分割區的限制是不能超過127MB,超過這個限制的swap的容量,都會被FREESCO忽略浪費掉,所以我們的swap的容量不要超過這個值。如果您的電腦記憶體有很多的RAM,那切割swap分割區反而會拖慢您的系統速度,相關的swap拖慢系統的原因說明,請參考slow down your system. 網頁中的說明,在this post 討論區,有更多有關swap 的說明。

要安裝FREESCO在硬碟中請依照以下這幾個步驟:

[ Top ]


安裝 ext2 package

首先要做的第一件事是安裝ext2 package程式。 通常這個package程式可以從FREESCOsoft網頁下載, 但是這個頁面的程式版本更新速度較慢。請到FREESCO作者Lightning本身的Lightnings release announcement網頁上下載,可以找到最新版本的程式。

請以root權限登入FREESCO中,並且依下面的指令輸入:請參考前面的文章安裝package程式一文的說明。

[root@Freesco] pkg -i http://www.freesco.net/packages/ext2-0.3.5-lewis

ext2 package程式會安裝開始,並且會詢問您是否想要觀看反安裝/安裝描述檔案內容:

Installing...                           ext2-0.3.5-lewis
Do you want to view the install/uninstall script (y/n) [n]?

如果您對本描述安裝檔案內容沒有興趣觀看, 請直接按Enter鍵繼續下面的安裝步驟:

Prepare and move FREESCO v0.3.5 to an ext2 hard drive partition.

Checking versions...                    Pv0.3.5
Checking required temp space...         Ok
Checking required disk space...         Ok
Checking dependencies...                Ok
Checking if package is installed...     Ok
Checking for existing libraries...      Ok
 *****************-- This is an official FREESCO package --********************
     _/_/_/ _/_/_/  _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ EEEEE X   X TTTTT 22222
    _/     _/  _/  _/     _/     _/     _/     _/  _/  E      X X    T       2
   _/_/   _/_/_/  _/_/   _/_/   _/_/_/ _/     _/  _/   EEEE    X     T   22222
  _/     _/ _/   _/     _/         _/ _/     _/  _/    E      X X    T   2
 _/     _/  _/  _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/     EEEEE X   X   T   22222
 ******************************************************************************
        ***--    loading this package will not damage your system   --***
!!!  However it is entirely possible to damage your system with this package !!!

 This package is designed to create and move FREESCO to an ext2 partition.

        If you are not comfortable with using the Linux cfdisk utility
        and formating hard drives then do NOT install this package.

        This package leaves no changes to your floppy, so if you reboot
        you will have to install this package again.

Do you want install this package (y/n) [y]?

請直接按Enter鍵後,package程式將開始下載並進行安裝:

http://www.freesco.net/packages/ext2-0.3.5-lewis.tgz (315K)
/tmp/7661~/ext2-0.3.5-le  [########################]     315K |   53.10K/s
323666 bytes transferred in 5.94 sec (53.09k/sec)
Unpacking ext2-0.3.5-lewis.tgz .. Done

        Now that this package is installed you have two choices.
        The first is to setup for a new install or to repair an
        existing installation. Use

        rc_ext2 setup
        or
        rc_ext2 repair

        You also can use any of the included binaries directly from
        the command line. Binaries and scripts included are: lilo
        mke2fs mkswap e2fsck cfdisk sfdisk fdisk mv2ext2 rc_ext2
Successfully installed...               ext2-0.3.5-lewis

現在ext2 package已經下載完成並且完成安裝。

如果您之前在使用單磁片版本時運作FREESCO,並且有使用ramdisk,建議您立刻將ramdisk功能關閉。因為當您從硬碟運作FREESCO後,ramdisk就會顯得渺小且微不足道。當從硬碟跑FREESCO時,ramdisk的唯一的好處是可以將 /tmp 掛載在ramdisk中,讓/tmp掛載點有更多的空間。要關閉ramdisk功能,請到FREESCO安裝設定功能選項中的第19選項,把他關閉disable即可,然後記得reboot系統。

如果您在rc_user檔案中,有設定在開機時,自動安裝ramdisk package程式,就要將這些設定的內容去除。一旦取消ramdisk功能,將package程式安裝在ramdisk那裡是不可能的,而以後所有的package程式都可以安裝在硬碟當中。

[ Top ]


設定 ext2 package

ext2 package程式目前以完成安裝,接下來就是設定它的相關功能。請依下列命令輸入:

[root@Freesco] rc_ext2 setup

畫面將會顯示有關於ext2 package程式的一些基本信息:

     _/_/_/ _/_/_/  _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ EEEEE X   X TTTTT 22222
    _/     _/  _/  _/     _/     _/     _/     _/  _/  E      X X    T       2
   _/_/   _/_/_/  _/_/   _/_/   _/_/_/ _/     _/  _/   EEEE    X     T   22222
  _/     _/ _/   _/     _/         _/ _/     _/  _/    E      X X    T   2
 _/     _/  _/  _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/     EEEEE X   X   T   22222



        This is a utility to automate moving FREESCO v0.3.5 from a floppy
        to a hard drive ext2 file system. This utility will use fdisk,
        cfdisk, sfdisk, mke2fs, mkswap, lilo, and mv2ext2. All of these
        binaries and scripts are included in this package and can be used
        directly from the command line if you need them. If there is any
        step during this install that is already done then just skip that
        step. This especially applies if you make a mistake and need to
        run the utility again.

        <ENTER> to continue

直接按Enter 鍵,開始進行設定工作:

        You are now going to run the Linux command line cfdisk utility.
        You have to have or create at least one primary ext2 partition
        and optionally one swap partition. You also need to make sure and
        toggle the bootable flag for your primary partition.

        Make sure to write the new configuration to the disk before you
        exit the utility.

        NOTE: By default this utility creates ext2 partitions. So if
        you want to create a swap partition, first create the partition and
        then change the partitions ID to "swap".
        The maximum size of a swap partition is 127MB.

        Run the Linux cfdisk utility (y/n)? [n]

依照我們先前的規劃,我們要將硬碟分割成2個硬碟分割區,一個是主分割區,用來安裝FREESCO程式及一些外加功能的package程式,另一個分割區是swap分割區。如果網友有在linux下分割過硬碟的經驗,應該不難理解。而這個硬碟分割程式就是cfdisk程式。

直接按y 鍵,執行cfdisk程式,如果這顆硬碟之前有安裝過windows,應該會看到和下面相似的內容:

                                  cfdisk 2.11n

                              Disk Drive: /dev/hda
                             Size: 1281181696 bytes
               Heads: 64   Sectors per Track: 63   Cylinders: 620

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    hda1                    Primary   Win95 FAT32                       1279.92











     [Bootable]  [ Delete ]  [  Help  ]  [Maximize]  [ Print  ]
     [  Quit  ]  [  Type  ]  [ Units  ]  [ Write  ]

                 Toggle bootable flag of the current partition

我們要做的第一件事,就是去除所有的舊硬碟分割區。請使用上/下按鍵,選擇要刪除的硬碟分割區。被選擇的分割區會呈現反白狀態,如果您只有一個分割區,那按上/下鍵就不會有作用。請按左/右鍵並且在下面的功能選項選擇"Delete"選項,並按下Enter鍵。當所有的分割區都被刪除完成後,我們就可以開始一個全新的硬碟分割了。

開始計算主要硬碟分割的容量大小。swap分割區限制的最容量是127MB。設定比127MB更大並不會導致任何錯誤,但是FREESCO將只會使用127MB,其他多餘的部分只是一種浪費,沒有任何意義,所以我們只需要切一塊127MB swap分割區即可,剩餘都切給主分割區吧。在本例中硬碟的大小是1279.92MB,減去127MB還剩下1152.92MB,所以分給主分割區的容量應該是1152.92MB。

製造分割區,請按左/右按鍵,從功能選項中選擇"New"選項。首先您將被詢問要做primary分割區或是logical分割區,依內定選擇primary分割區。接下來會要求您輸入primary分割區的容量大小,請輸入之前計算的1152.92MB。最後會被問及要從哪裡開始或是硬碟的結尾區,安置primary分割區,請直接接受系統內定值,並按下Enter鍵即可。現在畫面應該會顯示出分割區的相關資料,須注意的是,列出的分割區容量與您輸入的容量很靠近,但是有點差異,這是正常的別擔心。接下來的一件事,就是將這個分割區設定成可開機的分割區。請按左/右鍵,從功能選項中選擇"Bootable"項目,並且按下Enter鍵即可。這時您應該可以在螢幕上的Flags那一個欄位看到"Boot"字樣在hda1那一行。

重覆上面的設定過程切割swap分割區,當指定swap分割區時大小,請使用所有剩餘的空間(如由cfdisk告知的建議值),您應該會看到類似下面的內容:

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    hda1        Boot        Primary   Linux                             1151.93
    hda2                    Primary   Linux                              128.00

現在您需要設定改變had2 swap分割區,它的文件系統類型。請先選擇分割區(請使用上/下按鍵,選擇您想要設定的硬碟分割區)並且以左/右按鍵選擇"Type"項目,然後按下Enter鍵。這時畫面會秀出所以有可以設定的分割區資料型態,並被要求輸入資料型態的數字代碼,我們要輸入數字82,以設定swap分割區的資料型態,然後我們又會回到主畫面,然後hda2看起來像下面的文字:

    hda2                    Primary   Linux swap                         128.00

現在已經做完了硬碟分割的工作,按左/右鍵選擇"Write"選項,而我們將會被系統詢問,是否要將硬碟分割表寫入硬碟中?按y鍵同意寫入硬碟分割表。分割區資料這時將會被寫入硬碟,並且設定選單畫面會再度顯示。如果之前您選擇"Quit"選項,硬碟分割表將不會被改變,您也不會看到如下的畫面:

Disk has been changed.
Reboot the system to ensure the partition table is correctly updated.

WARNING: If you have created or modified any
DOS 6.x partitions, please see the cfdisk manual
page for additional information.

繼續下面的設定:

        Do you want to format a hard drive partition (y/n)? [n]

我們必須在使用硬碟分割區之前,先要格式化分割區,所以按 "y"鍵,並按下Enter。

        Format the FREESCO ext2 hard drive partition.

        NOTE: Even if you have an existing ext2 partition that
        was formatted with a lib6 Linux distribution. You need
        to reformat it to be compatible with FREESCO. Also if your
        drive might have bad blocks, add the -c flag.

        (<ENTER>) to skip this step
        EXAMPLE: /dev/hda1
        EXAMPLE: -c /dev/hda1


        What hard drive partition do you want to format ?

您必須先要指定格式化哪個分割區。如果您想要格式化主分割區是 /dev/hda1,就請輸入 /dev/hda1並按下Enter鍵。如果您想在格式化主分割區的同時,順便檢查分割區是否有壞軌,就請-c參數後,再使輸入 /dev/hda1,如 -c /dev/had1。輸入按Enter鍵後,格式化將會開始,如下所示內容:

mke2fs 1.27 (8-Mar-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
140544 inodes, 280720 blocks
14036 blocks (5.00%) reserved for the super user
First data block=0
9 block groups
32768 blocks per group, 32768 fragments per group
15616 inodes per group
Superblock backups stored on blocks:
        32768, 65536, 98304, 131072, 163840, 196608, 229376, 262144

Checking for bad blocks (read-only test): done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

        Do you want to format another hard drive partition (y/n)? [n] 

因為只有一個分割區,所以接受內定值 ("n") 並且按 Enter鍵。

        Do you want to format a swap partition (y/n)? [n]

現在您將被問及是否想要格式化您的swap分割區。按 "y" 並 Enter。

        You can now format a Linux swap partition if you created one with
        the fdisk utility. You will need to specify the disk partition
        that you created the swap file in. Also if this partition might
        have bad blocks, you can add the -c flag.

        (<ENTER>) to skip this step
        EXAMPLE: /dev/hda2
        EXAMPLE: -c /dev/hda2


        What swap partition do you want to format ?

跟上一步驟主分割區格式化一樣,swap分割區是/dev/had2,所以請輸入/dev/had2或是 -c /dev/had2,按Enter鍵後,將會直接開始swap分割區格式化。格式化完成後,系統將會提示您如何在FREESCO功能設定選項中定義swap分割區。內容文字如下所示:

Formatting swap space, please wait.....
Setting up swapspace version 0, size = 127987712 bytes

        Now that your swap has been formatted you need to enable
        it in the advanced setup. Rather than specifying a size you
        have to specify the device in the advanced setup swap section.
        This can be done at any time once you have finished.

        EXAMPLE: swap size = 127   (WRONG)
        EXAMPLE: swap size = /dev/hda2


        <ENTER> to continue.

按Enter鍵繼續下個步驟,系統會詢問您是否要將FREESCO複製到您的硬碟中。

        Copy FREESCO to your ext2 disk partition now (y/n)? [n]

這就是我們一開始就想要做的事情啊!所以按"y"鍵,並按下Enter。

        This script will install FREESCO on a EXT2 partition ONLY !!!!!!!

Choices: Clean install, delete previous copy
         Overwrite existing install leaving extra files intact
         Save previous copy as router.bak
         Restore previous copy router.bak to router
         Abort

Your choice (c/o/s/r/a) [a]? 

這時您將會被系統詢問您要做哪種型態的安裝方式?請參考畫面上的說明。一般我們都選擇C選項(Clean),選擇乾淨的安裝系統。按下"c"鍵並按Enter後,FREESCO將被複製到硬碟中。請參考下面的畫面文字:

Copying Freesco files to                         /dev/hda1
/>>>/>/>>>>>>>>///////>//////////
>
Copying kernel, ramdisk, and license....        Done
Copying ext2 file system tools.....             Done
Copying additional libraries.....               Done
Copying lilo configuration files......          Done

FINISHED

現在您將被詢問是否想要編輯lilo,如果直接按Enter鍵,會跳過這個步驟。

        Now you can edit the configuration for lilo

        After you are finished editing the configuration script.
        Exit and save with <ALT>+<X> or <F10> and then <y>



        Do you want to edit the /etc/lilo.conf file (y/n)? [n]

接下來會被詢問是否安裝多重開機啟動檔LiLO:

        The final step to booting FREESCO is to install a boot loader.
        This is done with the lilo command.

        NOTE: if you have a boot loader from another Linux distribution
        loaded on another partition, you should probably not use this
        command. You should add the correct entries into that OS for
        FREESCO and run the lilo command from there.



        Do you want to run LiLO (y/n)? [n]

除非您知道什麼是多重開機啟動檔LiLO,可以按 "y" 鍵Enter後設定多重開機啟動檔LiLO。否則請直接按"n" 鍵跳過吧。

Added normal *
Added setup
Added debug
Added shell
Added floppy
<ENTER> to continue

現在終於將FREESCO安裝完成了,請參考以下的畫面說明:

        You are now finished. If you are BRAVE and there were no errors
        then reboot and see if it works. If you made some mistakes during
        this install or there were errors. Just use

        rc_ext2 setup

SPECIAL NOTE:
        If you ever change the kernel or ramdisk you will have to run
        the lilo command BEFORE you reboot with the new kernel
        or ramdisk.

        Have fun ;)
        Lightning

現在重新啟動FREESCO,請先將軟碟機中的單磁片版FREESCO取出。如果一切順利如預期,FREESCO開機功能選單應該會由硬碟執行,並且在8秒鐘內啟動,您應該會看到如下的文字畫面:

Mounting boot device....                        Done hda1

以及:

Testing ext2 file system....                    Done

現在FREESCO已經從您的硬碟中正常順利的運作了,唯一還要去做的,就是去啟用swap硬碟分割區這件事。

[ Top ]


啟用硬碟的 swap 分割區

最後一步就是將swap分割區啟用。以root權限登入到登錄到您的FREESCO中,並進入功能設定選單中(ADVANCE SETTING MENU)。選擇功能選項第15功能選項 (Swap file)。您可以指定交swap的容量(MB)或是指定swap分割區。比如說前面以linux方式分割的swap分割區,在這裡可以輸入/dev/had2後,按Enter鍵,swap分割區就已經被設定在/dev/had2了。第15選項內容如下所示文字:

 15 Swap file size in MB or Linux native swap device (0 = disable)

本例子中的swap分割區是/dev/had2,因此鍵入/dev/had2,並且按下Enter鍵。退出功能設定選單(ADVANCE SETTING MENU)且儲存改變的設定。回到FREESCO命令提示列下,重新起動您的FREESCO(可以輸入reboot指令)。當FREESCO再次啟動後,您應該看到swap分割區/dev/had2被啟用,如下面文字所示:

Enabling swap partition....                     Done /dev/hda2

現在已經啟用硬碟swap分割區/dev/had2,並且您已經將FREESCO安裝在硬碟中了。

[ Top ]


回FREESCO安裝設定介紹

回DIY首頁