本文档摘录修订自man diskless,未实操验证,备用,改天再试
假设client网卡物理地址是00:02:56:00:73:31,网卡型号是fxp0,准备分配的ip地址是10.0.0.123
服务器的ip地址是10.0.0.1
1. Add an entry to /etc/ethers corresponding to the client's Ethernet
address:
00:02:56:00:73:31 myclient
2. Assign an IP address for myclient in /etc/hosts:
10.0.0.123 myclient
3. ensure that /etc/inetd.conf is
configured to run tftpd(8) in the directory /tftpboot.
/export/myclient/root目录下面先放2个文件pxeboot和bsd(bsd.sp或bsd.mp改名后的文件)
tftp dgram udp wait root /usr/libexec/tftpd tftpd -s /export/myclient/root
4. An example entry in
dhcpd.conf(5):
subnet 10.0.0.0 netmask 255.255.255.0 {
host myclient {
filename "pxeboot";
option root-path "/export/myclient/root"; #第3步骤已经设置,这里可以省略
hardware ethernet 00:02:56:00:73:31;
fixed-address 10.0.0.123;
}
}
Note that procedures for AMD64 and i386 clients vary somewhat. See
pxeboot(8) for more detailed information.
5. Add myclient to the bootparams database /etc/:
myclient root=server:/export/myclient/root \
swap=server:/export/myclient/swap
Note that some bootparam servers are somewhat sensitive. Some
require fully qualified hostnames or partially qualified hostnames
(which can be solved by having both fully and partially qualified
entries). Other servers are case sensitive.
6. Build the swap file for myclient:
# mkdir -p /export/myclient/root/swap
# cd /export/myclient
# dd if=/dev/zero of=swap bs=1m count=120
This creates a 120 Megabyte swap file and an empty /swap directory.
A smaller swap file may be created if the boot is for maintenance
(i.e. temporary) purposes only.
7. Populate myclient's root filesystem on the server. How this is done
depends on the client architecture and the version of the OpenBSD
distribution. It can be as simple as copying and modifying the
server's root filesystem, or perhaps the files can be taken from the
standard binary distribution.
8. Export the required filesystems in /etc/exports:
/usr -ro myclient
/export/myclient -maproot=root -alldirs myclient
限制局域网访问的例子如下
#
# NFS exports Database
# See exports(5) for more information. Be very careful, misconfiguration
# of this file can result in your filesystems being readable by the world.
/work -alldirs -ro -network=10.0.0 -mask=255.255.255.0
--------------------------------------------------------
If the server and client are of the same architecture, then the
client can share the server's /usr filesystem (as is done above).
If not, a properly fleshed out /usr partition will have to be built
for the client in some other place.
9. Copy and customize at least the following files in
/export/myclient/root:
# cd /export/myclient/root/etc
# cp /etc/fstab fstab
# cp /etc/hosts hosts
# echo myclient > myname
# echo inet 10.0.0.123 > hostname.fxp0
Note that "fxp0" above should be replaced with the name of the
network interface that the client will use for booting.
10. Correct at least the critical mount points in the client's fstab(5)
(which will be /export/myclient/root/etc/fstab):
10.0.0.1:/export/myclient/root / nfs rw 0 0
10.0.0.1:/export/myclient/swap none swap sw,nfsmntpt=/swap
10.0.0.1:/usr /usr nfs ro 0 0
10.0.0.1:/export/myclient/root/var /var nfs rw,nosuid,nodev 0 0
The above example works even if /usr and /var are not on separate
partitions. It allows them to be mounted with NFSv3, if the server
allows it, and to specify per-partition mount options, such as
``nodev''.
11. Make sure the correct processes are enabled on the server. See
rc.conf(8) for details of how to start these processes at boot.
mountd(8), nfsd(8), portmap(8), and rarpd(8).
tftpd(8) via inetd(8) dhcpd(8)
12. Net boot the client.
nfs(nfsd(8), portmap(8))参考以下文档配置
http://www.openbsd.org/faq/faq6.html#NFS
以上文档clinet启动之后无法login?
添加用户方法如下?
# chroot /export/myclient/root
# passwd root
Changing local password for root.
New password:
Retype new password:
# exit