FreeBSD如何跑diskless
diskless 可以让 FreeBSD clIEnt PC 不需要硬碟就可以透过网路跑 FreeBSD 。
以下是两个成功的范例:
======== 范例一 =========
From: client.bbs@csie.nctu.edu.tw (client)
Newsgroups: tw.bbs.comp.386bsd
Subject: Re: 如何使 diskless 的 pc 也能跑 freebsd
Date: 27 May 1995 05:44:34 GMT
(1) /etc/bootptab 建立diskless pc 的资料
(2) /etc/servives 之bootpd 及 tftpd 是否打开
(3) /etc/inetd.conf 之tftpd 是否打开
(4) bootpd 放入 /etc/rc 差不多最后面
(若由inetd 来叫 ,时常抢不过 ka9q 的 bootpd)
(5) 建立diskless pc 的 root file system. ex:/home/diskless1
(6) 建立diskless pc 的swap file system.
建目录: ex:/home/swapfs
建swap file: 若diskless pc 的 ip: 140.115.10.222
则 touch /home/swapfs/swap.140.115.10.222
(7) 把 freebsd 整个系统 拷贝至 /home/diskless1
(8) export /home/diskless1 及 home/swapfs 给 diskless pc
(9) 建立 /tftpboot/cfg.140.115.10.222 file
rootfs server:/home/diskless1
swapfs server:/home/swapfs
swapsize 32000
(10)至/usr/src/sys/i386/boot/netboot make *.com 或 *.rom
make install
至/usr/mdec 取你要的 档案,开 diskless pc
大致上,是如此! 自己再try !
========================
======== 范例二 ========
From: upleong@csie.nctu.edu.tw (Bills)
Newsgroups: tw.bbs.comp.386bsd
Subject: 设定diskless pc step by step
Date: 16 Oct 1996 03:17:58 GMT
给大家分享一下. 实在太好玩了 。
假设有两台机器,
serverxy 是提供 diskless开机之server, ip: 140.113.141.191
clientab 为 diskless之机器 ip: 140.113.141.204
以下范例是在同一domain之下测试成功的(注: 好像是在不同domain也可以)
所有要修改或增加的档案:
a. /etc/inetd.conf
b. /etc/services
c. /tftpboot/cfg.xxx.yyy.zzz.www
d. /etc/bootptab
e. /swapfs/swap.xxx.yyy.zzz.www
f. /sys/i386/conf/boot/netboot/*.com
g. /rootfs/clientab ;这里是整个系统
h. /etc/exports
Server端的设定:
(一)修改 /etc/inetd.conf 加入tftpd, 修改/etc/services 增加tftpd,
bootpd的功能, 其中diskless的机器之root file system在 /rootfs/clientab 。
/etc/inetd.conf:
tftp dgram udp wait nobody /usr/libexec/tftpd
tftpd -l /tftpboot /rootfs/clientab
/etc/services:
tftp 69/tcp #Trivial File Transfer
tftp 69/udp #Trivial File Transfer
bootps 67/tcp dhcps #Bootstrap Protocol Server
bootps 67/udp dhcps #Bootstrap Protocol Server
bootpc 68/tcp dhcpc #Bootstrap Protocol Client
bootpc 68/udp dhcpc #Bootstrap Protocol Client
(三)以后启动 bootpd, 可以加入/etc/rc.local之中, 其设定档为/etc/bootptab 。
/etc/rc.local:
/usr/libexec/bootpd -s /etc/bootptab
(二)修改 bootptab, 把该改的该一下就好了, 详细之参数可参考handbook或man 。
/etc/bootptab:
.default:
:td=/tftpboot:hd=/clientab:bf=kernel: ;bf可设定boot file name
:sm=255.255.255.0:
:hn:
:ds=140.113.1.1, 140.113.17.5: ;改为你的domain name server
:ip=140.113.141.204: ;diskless client之 IP
:gw=140.113.141.254:
:dn=dorm10.nctu.edu.tw: ;改一下domain name
:vm=rfc1048:
clientab:ht=ether:ha=0000b46b0369:tc=.default:
;ht为client的网路种类
;ha为网路卡的hardware address
(四)设定 tftpboot的 config file, 这是开机时 client从 server得到资讯的地方 。
档案名皆为 cfg.[client ip addr] 。eg. cfg.140.113.141.191
/tftpboot/cfg.140.113.141.204: ;档案名记得要改...
rootfs 140.113.141.191:/rootfs/clientab ;rootfs放在server的
; /rootfs/clientab目录下
swapfs 140.113.141.191:/swapfs ;swap file放在/swapfs下
swapsize 20000 ;swap size in KB
hostname clientab.dorm13.nctu.edu.tw ;client的host name
ip 140.113.141.204 ;client的ip address
kernel kernel ;kernel叫什么, 因为一开机就
; 是NFS mount rootfs, kernel
;要有NFS support 才能动
(五)建一个 swap file的档案, 改名为 swap.[client IP address]
推荐阅读
- imessage短信删除怎么恢复?如何恢复误删的短信内容
- FreeBSD光盘运行版的制作过程
- 91 FreeBSD连载:提升静态网页服务能力的综合方式
- 新手如何做到窄路会车
- 在FreeBSD中使用windows的simsun字体
- 3 用FreeBSD构建家庭网络世界
- 大蒜叶片干枯如何防治
- 磁盘配额 FreeBSD 中使用QUOTA来限制用户空间
- 鼠年宝宝起名字大全 如何选好字
- 苹果手机如何查历史浏览记录