Unix System Admin

Download Report

Transcript Unix System Admin

PXE netboot installation of Linux/SuSE
• Objectives
– Creating PXE netboot installations
• Contents
–
–
–
–
–
–
DHCP server manual setup
TFTP server yast setup
boot files from CD1
Syslinux package
Net bootloader config
Wake on LAN
• Practicals
– Perform one PXE installation
• Summary
DHCP Server for TFTP booting
• Beside the regular DHCP settings we need to annonce tvtp
server
– tftp server IP address
next-server
– Net boot image
filename
– Booting client MAC address
option domain-name ”net05.se";
option domain-name-servers 192.168.1.1;
option routers 192.168.1.1;
option ntp-servers 192.168.1.2;
default-lease-time 14400;
ddns-update-style none;
subnet 192.168.1.0 netmask 255.255.255.0 {
# Range specify which IP addresses to deliver
# range 192.168.1.200 192.168.1.250;
default-lease-time 14400;
max-lease-time 172800; }
group {
next-server 192.168.1.60; filename "pxelinux.0";
host Zert120 { hardware ethernet 00:07:E9:64:73:E3; }
host Bert120 { hardware ethernet 00:B0:D0:39:63:8C;
fixed-address 192.168.1.102; }
}
Setup of a TFTP Server
• Install the tftp package (dependent on xinetd)
– TFPT server by H. Peter Anvin
• Recommendation is to install & configure tftp with yast
and check files afterwards!
– TFTP root directory shour be set as: /srv/tftpboot
• Create the directory # /srv/tftpboot/pxelinux.cfg
• TFTP is xinetd dependent, check /etc/xinetd.d/tftp:
• Restart the DHCP server
# /rcdhcpd restart
• Restart the xinetd server
# /rcxinetd restart
service tftp
{
socket_type =
protocol = udp
wait = yes
user = root
server =
/usr/sbin/in.tftpd
server_args = -s
/tftpboot
disable = no
}
dgram
Preparing the tftp-root with boot files
• First we need the boot files copied into the tftp-root
# cd /export/network-install/SuSE/9.3/CD1
# cp -a boot/loader/linux boot/loader/initrd /srv/tftpboot
# cp -a boot/loader/message /srv/tftpboot boot/loader/memtest /srv/tftpboot
• Install the syslinux package (with yast)
– Syslinux contains the nessesary pxeboot.0 file
– Copy alsothe pxebootloader file to tftp-root
# cp -a /usr/share/syslinux/pxelinux.0 /srv/tftpboot
• The isolinux.cfg is syslinux boot manager options, whcih
we need in order to boot over the net, renamed as default:
# cd /export/network-install/SuSE/9.3/CD1
# cp -a boot/loader/isolinux.cfg /srv/tftpboot/pxelinux.cfg/default
Modify the /srv/tftpboot/pxelinux.cfg/default file
• Edit the default and disable graphic bootloader, remove
these: gfxboot readinfo framebuffer
• You then need to add these at proper labels:
– insmod=e100
– netdevice=eth0
– install=nfs://ip_instserver/path_instsource/CD1
• For automatic start of installation in end of file
– default linux
– timeout 100
• A sample label can look like this (linux)
# install
label linux
kernel linux
append initrd=initrd ramdisk_size=65536 insmod=e100 netdevice=eth0 \
install=nfs://192.168.1.60/exports/network-install/SuSE/9.3/CD1 \
autoyast=nfs://192.168.1.60/exports/network-install/SuSE/9.3/my-host.xml
Preparing client and Wake on LAN
• Boot order in client BIOS need to be set
1. NetBoot
2. Disk
– Note that there can be problem after the reboot, netboot willeventually start a
new installation over and over again!
• Installing netdiag allows the wake on LAN
– By issuing command ether-wake mac_of_target
– Target host wakes up and can boot on PXE
• During client boot
– Broadcast for DHCP server
– Getting first IP address
– Fetching boot image from tftp server and start loading boot manager
–#Boot
arrives
and after timeoutbootmanager loads the default label
cp manager
autoinst.xml
/media/floppy/autoinst.xml
kernel linux
– Attempt to mount install and autoyast
– Installation continues in normal order