DHCP.
dhcpd.conf:
# расскоментировать для DHCPD 3.0
# ddns-update-style none;
group {
# IP address of TFTP/NFS server
next-server 10.0.0.3;
# The name of the file to be downloaded by the ROM
filename "/tftpboot/pxelinux.0";
# A default server directory to be used as / by the clients
#option root-path "/clients/shared/root";
# IP addresses of DNS servers
#option domain-name-servers XX.XX.XX.XX, YY.YY.YY.YY;
# IP addresses of routers
#option routers AA.AA.AA.AA, BB.BB.BB.BB;
# An entry for one specific client
host sample-client {
# Ethernet address of the client machine
hardware ethernet EE:EE:EE:EE:EE:EE;
# IP address to assign
fixed-address 10.0.1.1;
# Override root-path option for this machine
# Our initial configuration will use separate
# root directories for each client.
option root-path "/clients/10.0.1.1/root";
}
}
NFS.
/etc/exports на сервере:
/clients/10.0.1.1/root 10.0.1.1/255.255.255.255(rw,no_root_squash)
/clients/10.0.1.1/usr 10.0.1.1/255.255.255.255(rw,no_root_squash)
/clients/10.0.1.1/var 10.0.1.1/255.255.255.255(rw,no_root_squash)
/clients/10.0.1.1/tmp 10.0.1.1/255.255.255.255(rw,no_root_squash)
/home 10.0.0.0/255.0.0.0(rw)
/etc/fstab для клиента:
10.0.0.3:/clients/10.0.1.1/root / nfs rw,hard,intr,nolock 0 0
10.0.0.3:/clients/10.0.1.1/usr /usr nfs rw,hard,intr,nolock 0 0
10.0.0.3:/clients/10.0.1.1/var /var nfs rw,hard,intr,nolock 0 0
10.0.0.3:/clients/10.0.1.1/tmp /tmp nfs rw,hard,intr,nolock 0 0
10.0.0.3:/home /home nfs rw,hard,intr,nolock 0 0
Проверка NFS:
mount 127.0.0.1:/clients/10.0.1.1/root /mnt
/clients/shared/root/etc/init.d/netboot-dirs - скрпит монтирование разделов по NFS загрузке для клиента:
#!/bin/sh
IP=`ifconfig eth0 | grep inet | sed 's/.*inet //;s/ netmask.*//'`
/bin/mount 10.0.0.3:/clients/$IP/var /var
/bin/mount 10.0.0.3:/clients/$IP/tmp /tmp
etc/init.d/netboot-dirs создание /var и /tmp разделов в ОЗУ для клиента:
#!/bin/sh
# File: etc/init.d/netboot-dirs
# Initialize a 1MB /var
/sbin/mke2fs -q /dev/ram12 1024
/bin/mount /dev/ram12 /var
/bin/chown 0:0 /var
/bin/chmod 755 /var
# Create some needed dirs
cd /var
/bin/mkdir -p --mode=755 run lib log/news spool/cron/crontabs
/bin/mkdir -p --mode=1777 tmp lock
# Initialize a 4MB /tmp
# -N option tunes this for small files
/sbin/mke2fs -q -N 2048 /dev/ram11 4096
/bin/mount /dev/ram11 /tmp
/bin/chown 0:0 /tmp
/bin/chmod 1777 /tmp
URL: http://www.linux-mag.com/2002-10/netbooting_01.html
Обсуждается: https://www.opennet.ru/tips/info/924.shtml