基本概念如下:個人電腦會經由 bootp 協定從啟動伺服器中來取得它的 IP 位址。 用 0.0.0.0 為初始 IP 位址,而它的核心程式會經由 tftp 協定。
跳過區段的啟動 (經由路由器router) 並不是個簡單問題,所以,不是將伺服器以及無磁碟機的機器放置在同一個網路 區段,就只有建構一個 UDP 輔助位址在你的 router 到伺服器的位址上。細節請參考你的 router 產器手冊。
以下是我們的步驟
取得 nfsboot 套件 (可從你較喜歡的 linux mirror 鏡射站的 /pub/Linux/system/Linux-boot
目錄取得)。它包含了一個給 wd8013卡可直接燒錄用的 booteprom 映像檔。
還有其他方法可以準備個人電腦部份:
這個映像檔包含了 bootp 以及 tftp 客戶端程式。 你也需要準備一個 linux 核心程式碼,它含有 nfs-root 選項。
參考 patch(1)
它可以在 bootpd-2.4.tar.gz
套件中找到
(可從你較喜歡的 linux mirror 鏡射站的 /pub/Linux/system/Network/boot.net
目錄內)。取得這個套件,
編譯並安裝它。如果你其他的 Unix 機器也是用 Slackware Linux 的,那麼標準的供應版本就
有 bootpd 了,所以你可以跳過這部份。 daemon 可以直接發出命令來執行
bootpd -s
或是使用 inetd,但你需修改:
# tftp dgram udp wait root /usr/sbin/in.tftpd tftpd /export
# bootps dgram udp wait root /usr/sbin/in.bootpd bootpd
bootps 67/tcp # BOOTP server
tftp 69/udp # TFTP server
kill -HUP <process id of inetd>.
由先, bootpd 有個叫 bootptab 的建構檔,它通常被放在 /etc 內。你必須修改 它,加上你的無磁碟機器的閘道 IP 位址、 dns 伺服器,以及乙太網路位址(es)。 範例如下 /etc/bootptab:
global.prof:\
:sm=255.255.255.0:\
:ds=192.168.1.5:\
:gw=192.168.1.19:\
:ht=ethernet:\
:bf=linux:
machine1:hd=/export/root/machine1:tc=global.prof:ha=0000c0863d7a:ip=192.168.1.140:
machine2:hd=/export/root/machine2:tc=global.prof:ha=0800110244e1:ip=192.168.1.141:
machine3:hd=/export/root/machine3:tc=global.prof:ha=0800110244de:ip=192.168.1.142:
global.prof 是 host 項目的一般樣本,其中
之後,每一台機器應該有下面這行
TFTP (Trivial File Transfer Protocol
) 是一個檔案傳輸協定,就像 ftp 一樣,但
它比比較簡化,因此可以容易地在 EPROM 裏來編碼。 TFTP 的使用方法有二種:
/export/root/machine1
。
當使用安全的 tftp 時, /export 被當成根目錄,而 /export 變成 / ,且 hd 欄就變成 /root/machine1
了。
這包含 Slackware供應版內的 a, ap, n, 及 x 部份。要安裝更多的套件也可以;但 是上面的套件已足夠一個無磁碟 X 終端機的需求了。首先你需要一個已在運轉的 Linux 系統。在遠端機器裏找一個磁碟空間並 export 它成為可讀寫並掛上它到 Linux 機器的檔案系統上的某一處 (例如 /mnt)。開始 Linux 設定並改變root 選項從 / 變為 /mnt。然後設立如上面所說的套件,如果你只是要執行一個無磁碟的 Linux 那 麼就不需要做其他改變。另一方面,如果你計畫使用超過一個以上的無磁碟機器, 那麼上面的設定就需要些許的修改,因為有些檔案以及目錄必須只有機器本身使用。 我們可以以移開 /usr 目錄(它包含非私人的資料)的方式跳過這個問題, 然後建立一個分開的子目錄給每一個無磁碟機器。例如,如果 /export/linux/machine1 被掛在 /mnt 上,那麼在初始設定後目錄結構會像這樣
/export/linux/machine1/bin
/export/linux/machine1/sbin
/export/linux/machine1/lib
/export/linux/machine1/etc
/export/linux/machine1/var
/export/linux/machine1/usr
改變後你會有
/export/linux/machine1/bin
/export/linux/machine1/sbin
/export/linux/machine1/lib
/export/linux/machine1/etc
/export/linux/machine1/var
/export/linux/usr
現在為其他的機器建立目錄。從現在開始我們假設你的無磁碟機器分別叫做 machine1、machine2、 machine3等等; 使用以下的 bash 命令手稿來設立其他的目錄
cd /export/linux
for x in machine2 machine3 ; do
mkdir $x; cd $x
(cd ../machine1; tar cf - *) | tar xvf -
done
然後做下列的 export:
下面範列是依照 SunOs 4.1.3 的 exports 檔案的語法來做:
# This file is /etc/export
# for remote linux X terminals by Buci
# this line is only once
/export/root/usr -access=linuxnet
# these lines once for every host
/export/root/machine1 rw=machine1,root=machine1
/export/root/machine2 rw=machine2,root=machine2
/export/root/machine3 rw=machine3,root=machine3
請不要忘了執行 exportfs -a
現在該是建構 tftp 伺服器的時候了。如果你不需要一個安全的 tftp 那很簡單, 因為你的客戶端已經可以從 /export 目錄來啟動。
如果一個安全的 tftp 被採用,那麼你可以在 /tftpboot 目錄下做個完整的 /export/linux 目錄結構。 (用一個實體核心程式及連結給其他機器的符號連結), 或是讓 /export 目錄成為安全的 tftpd 的根目錄。或者如果你有一另外的 tftpboot 目錄,那麼,同樣地,你只需要原來的目錄結構,然後用一個實體核心程式來 符號連結其他機器) 。 你可以執行下列命令來完成這個設定:
mkdir -p /tftpboot/export/linux/machine1
cd /tftpboot/export/linux/machine1
cp /export/linux/machine1/<name of the kernel> .
然後執行下面:
mkdir -p /tftpboot/export/linux/machine2
cd ../machine2
ln -s ../machine2/<name of the kernel>
最後,你必須插入
/sbin/mount nfs_server:/export/linux/usr /usr
到
/export/linux/<machinex>/etc/rc.d/rc.S
的第一行。在這裏 <machinex> 指的是 machine1, machine2等等。