Linux 版 (精华区)

发信人: NightOwl (蜕变中...), 信区: Linux
标  题: [ZZ]作无盘工作站的方法
发信站: 紫 丁 香 (Sun Dec 12 17:42:35 1999), 转信

发信人: singer (歌者), 信区: Linux
标  题: 作无盘工作站的方法
发信站: BBS 水木清华站 (Wed Dec  8 12:46:51 1999) WWW-POST
作无盘工作站的方法
最近有些网友问作无盘工作站的的方法,我刚刚作完,有一些心得贴出来供大家参考。
用的系统是rh6.1。
作无盘工作站需要客户端和服务器端两方面的工作,下面分别叙述。

无盘工作站客户端

这部分的主要任务是做一个EPROM的启动文件,还包括一个处理linux内核的工具
mknbi-linux。有两个package可以用,etherboot和netboot, etherboot对网卡型号
有要求,支持的网卡种类不算少但不是全部,但基本上最常用的网卡都支持,比如
3c503/507/509/905b,NE1000/2000/PCIne2000,Intel eepro等等。Netboot可以用
ndis或pktdrv,这些在随卡带的驱动盘上一般都有,所以什么卡都能用。但这仅限于
网络启动,Linux内核启动之后不支持的还是不支持。所以对网卡的要求是Linux能识
别。
以下所述适用于etherboot;
1. 展开etherboot,进入src-32,编辑Config。有许多选项可以让你做多重启动、显示
信息、询问口令之类的事情,但是唯一需要的是用bootp代替dhcp,即在Config中定
义-DNO_DHCP_SUPPORT。因为在服务器端我们打算用bootp,所以这是必须的,否则启
动时会因为寻找dhcp server又找不到启动不了。如果你准备在服务器端使用dhcp,那
么这一步就不需要了。
2. make。对每种网卡都会生成两个文件 .rom和 .lzrom,后者是压缩过的。
3. 使用软盘启动验证所作的启动ROM没问题,假设你用的网卡是ne2000兼容的:
cat ../src/floppyload.bin ne.lzrom > /dev/fd0
用软盘启动,应该能探测到你的网卡并发出bootp请求。如果一切OK,你就可以把ROM文
件烧到EPROM里了。
4. cd ../netboot*;make;make install。make如果出错,解决办法是把系统中的bcc
改名,然后将gcc连接成bcc,再重新make。最后在系统中会增加一个程序
mknbi-linux,是用来处理linux内核的,在服务器端设置部分会讲它的用法。
客户端的工作完成了。

服务器端:

假设你的无盘工作站ip为10.0.0.1; 机器名为dc1.subnet.net,另一台无盘工作站ip为
10.0.0.2,机器名为dc2.subnet.net, 服务器ip为10.0.0.254,名为server.subnet.net

1. 修改/etc/hosts,增加dc1.subnet.net,dc2.subnet.net
2. 取得bootp-2.x.x,展开后注意把带的各种patch都打上。然后make; make install
3. 建立/etc/bootptab,like this
------------------------------------------------------------------------
         global.prof:\
                 :sm=255.255.255.0:\
                 :bf=/tftpboot/vmlinuz.nb:
         dc1:tc=global.prof:ha=0000c0863d7a:ip=10.0.0.1:
         dc2:tc=global.prof:ha=0800110244e1:ip=10.0.0.2:
    ---------------------------------------------------------------------
ha用无盘工作站网卡的MAC地址代替。
4. 修改inetd.conf,去掉bootpd和tftpd的#号,like this
---------------------------------------------------------
tftp   dgram   udp     wait    root   /usr/sbin/tcpd    tftpd –s /tftpboot
bootps dgram   udp     wait    root   /usr/sbin/tcpd    bootpd -i
----------------------------------------------------------
kill –HUP `cat /var/run/inetd.pif`
5. 建立/tftpboot/10.0.0.1,cd /tftpboot/10.0.0.1,
(cd /; tar cpf – lib sbin bin var etc dev)| tar xpf –
mkdir usr; mkdir tmp; chmod 1777 tmp; mkdir home;mkdir root; mkdir proc;

mkdir mnt
6. touch fastboot; chattr +i fastboot
(fstab 中 / 和 /usr 的最后一项设成0,也许不需要这一步了,但我没试过)
以下是一个shell script,可用于自动执行以上操作。
----------------------------------------------------------
 #!/bin/sh
       if [ $# != 1 ]
       then
               echo Usage: $0 client-IP-addr
               exit 1
       fi
       cd /
       umask 022
       mkdir -p /tftpboot/$1
       # just make these ones
       for d in home mnt proc tmp usr
       do
               mkdir /tftpboot/$1/$d
       done
       chmod 1777 /tftpboot/$1/tmp
       touch /tftpboot/$1/fastboot
       chattr +i /tftpboot/$1/fastboot
       # copy these ones
       (cd /; tar cpf  - bin lib sbin dev etc var) | (cd /tftpboot/$1; tar
xpf -)
----------------------------------------------------------------------------
--
-
7. 删除var下一切不需要的东西, 减小空间。删除lib/modules下一切不需要的模块。
8. 修改etc/sysconfig/network,etc/sysconfig/network-scripts/ifcfg-eth0,
etc/fstab,etc/conf.module
fstab中指明root在服务器server上,like this
---------------------------------------------------
server:/tftpboot/10.0.0.1   /       nfs   default  0  0
server:/usr                 /usr    nfs   default  0  0
----------------------------------------------------
9. 配置etc/rc.d/rc3.d,关掉一切不需要的网络服务。
10. 删除etc/rc.d/rc6.d/K??network。
11. 修改etc/rc.d/rc.sysinit,寻找“mount –a –t nonfs,smbfs…"改成
“mount.–a –t nosmbfs…"
12. mkdir /tftpboot/10.0.0.2; cd /tftpboot/10.0.0.2;
(cd ../10.0.0.1; tar cpf - *) | tar xpf –
13. 修改etc/sysconfig/network,etc/sysconfig/network-scripts/ifcfg-eth0,
etc/fstab,etc/conf.module
14. cd /etc; vi exports;
----------------------------------------------------------------------------
-
/usr               dc*.subnet.net(ro)
/tftpboot/10.0.0.1 dc1.subnet.net(rw,no_root_squash)
/tftpboot/10.0.0.2 dc2.subnet.net(rw,no_root_squash)
----------------------------------------------------------------------------
-
exportfs –a
15. 编译一个新内核,必须包含以下特性:
NFS filesystem 支持
Root on NFS 支持
Bootp 支持
无盘工作站所用的网卡型号支持
编译出新内核之后,用mknbi-linux处理,
 mknbi-linux bzImage vmlinuz.nb
将vmlinuz.nb放在/tftpboot下即可。
服务器端的工作就完成了。
注意事项:
1. 如果你打算在服务器端用dhcp,需要自己配置,参看dhcp的文档。
2. Rh6.1自带一个bootparamd,也应该能完成同样的工作,但manual中语焉不详,不知
   该如何设置。
3. 服务器端 / 和 /usr 最好单独分区。
4. etherboot的文档上说对有些网卡比如PCI NE2000兼容网卡,可能需要调整Makefile
中的vendor信息和ID信息,我没试过。启动你的无盘工作站,一切无误的话,它应该顺
利起来。启动过程中如果有一些地方failed,可以在起来之后在无盘工作站上按一般方
法设置。
--

--
       @@@@           @@@@
     @@@@@ @@   N   @@ @@@@@
   \ @@@@ @ @@  i  @@ @ @@@@ /
      @@@  @@   g   @@  @@@
        @@@     h     @@@
      \         t         /

※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: 202.118.179.51]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:1.936毫秒