BOOT ON LAN
In order to make pi1 / pi2 computers bootable from LAN the following
action
has been performed :
0/ pi1 / pi2 configuration
- pi1 : on board Gigabit INTEL
, 100 on PCI
in this case booting is done over 1Gbit
cards
- pi2 : on board INTEL 100, Gigabit
on PCI
in this case booting is done over
network : 200.28.147.*
1/ Setup BIOS :
- goto menu item BOOT
and set "PXE Boot to LAN" to
Enabled, save end exit BIOS
- enter BIOS again choose BOOT
item from menu and highlight "Boot
Device Priority" position, press ENTER
"1st Boot Device" should be
highlited, press ENTER, blue
box with available boot devices apears one should be NIC card
and it should be choosen
2/ prepare proper kernel, the following options must be checked in
make xconfig :
- Ustawic sobie jakas swoja wersje ( postfix ktory sie dopisze do
wersji ) - zeby nie nadpisac aktualnej, jesli maja ten sam numerek
- IP_PNP : kernel level autoconfiguration ( Networking / Networking
options / IP : kernel level autoconfiguration )
- NFS FS
- NIC card must be compiled into kernel ( not as module ) ( Device
drivers / Network )
- ROOT_NFS option ( Network File Systems / Root file system on NFS
- dopiero po wlaczeniu IP_PNP )
- ext3
Kompilacja jadra :
make
make modules
make modules_install
make install
3/ install and configure DHCP and TFTP on server machine
- get dhcpd and tftp-server rpm's ( from Fedora Core 2 cdrom ) and
install them, then edit file
/etc/dhcpd.conf
and put there following lines :
option
subnet-mask
255.255.255.0;
option
domain-name
"lco.cl";
#option
domain-name-servers 200.28.147.2;
#option
time-servers 193.0.81.18;
ddns-update-style interim;
ignore
client-updates;
deny
unknown-clients;
subnet
192.168.0.0 netmask 255.255.255.0 {
host pi1 {
hardware ethernet
00:0C:F1:AB:BC:33;
fixed-address 192.168.0.44;
next-server 192.168.0.43;
filename "pxelinux.0";
#option
root-path "192.168.0.43:/disk01/pxeclient";
}
}
Note -
this is for case where server
machine have 2 interfaces one connected to WLAN and second to PXE boot
machine, in
case of single card setup one line was
different :
filename "/tftpboot/pxelinux.0";
and the rest was :
subnet 200.28.147.0 netmask
255.255.255.0 {
host pi2 {
hardware ethernet 00:07:E9:68:21:00;
fixed-address 200.28.147.186;
next-server 200.28.147.185;
filename "pxelinux.0";
}
}
RUN :
service dhcpd start
- next step is to setup tftp-server , in order
to do so, create directory /tftpboot and copy there all files :
bash-2.05b$ ls /tftpboot
README.txt
pxeboot.img.gz teros-tftpboot.tar.bz2
pxeboot.msg
initrd-2.6.6.img
pxelinux.0 vmlinuz
initrd-2.6.7-1.494.2.2.img
pxelinux.0.bak vmlinuz-2.6.6
pxelinux.cfg vmlinuz-2.6.7-1.494.2.2
Configure tftp -
edit file /etc/xinetd.d/tftp , make sure it contains the red line :
service tftp
{
disable = no
socket_type
= dgram
protocol
= udp
wait
= yes
user
= root
server
= /usr/sbin/in.tftpd
server_args
= -s /tftpboot
per_source
= 11
cps
= 100 2
flags
= IPv4
}
and start tftp-server by :
chkconfig
tftp on
/sbin/service xinetd
reload
4/ configure NFS :
- add directory in which system is placed to /etc/exports :
pi1:/etc/exports:
/data2/bootonlan/pxeclient pi2(rw,no_root_squash)
/data2/bootonlan/pxeclient 192.168.0.43(rw,no_root_squash)
pi2:/etc/exports :
/disk01/pxeclient 200.28.147.185(rw,no_root_squash)
/disk01/pxeclient 192.168.0.44(rw,no_root_squash)
RUN:
exportfs -u
exportfs -av
- on server machine export directory
/disk01/pxeclient containing linux root files system, after executing
script mkbootready.sh in /disk01/pxeclient directory (script
mkbootready.sh can be found in $SRCDIR/install/ )
RUN :
mkbootready.sh /disk01/pxeclient
/etc/init.d/nfs start
5/ prepare file /tftpboot/pxelinux.cfg/default
- put the following lines there idicating where / can be
mounted ( in any case - local area network LAN or
two machines connected together )
# Perform a local boot by default
default net
# Always prompt
prompt 0
# Display the bootup message
display pxeboot.msg
# Boot automatically after 30 seconds in tenths of a second
timeout 1
label local_0
localboot 0
label local_1
localboot 0x81
label net
kernel vmlinuz-2.6.6
append ip=dhcp root=/dev/nfs
nfsroot=192.168.0.43:/disk01/pxeclient
# or in some cases better without DHCP :
# append ip=192.168.0.44 root=/dev/nfs
nfsroot=192.168.0.43:/disk01/pxeclient
6/ restart remote computer, expect following lines in
/var/log/messages file of boot-server:
Nov 28 11:48:37 localhost kernel: e1000: eth1 NIC
Link is Down
Nov 28 11:48:39 localhost kernel: e1000: eth1 NIC
Link is Up 100 Mbps Full Duplex
Nov 28 11:48:45 localhost kernel: e1000: eth1 NIC
Link is Down
Nov 28 11:48:47 localhost kernel: e1000: eth1 NIC
Link is Up 1000 Mbps Full Duplex
Nov 28 11:48:51 localhost dhcpd: DHCPDISCOVER from
00:07:e9:68:21:00 via eth0
Nov 28 11:48:51 localhost dhcpd: DHCPOFFER on
200.28.147.186 to 00:07:e9:68:21:00 via e
Nov 28 11:48:53 localhost dhcpd: DHCPREQUEST for
200.28.147.186 (200.28.147.185) from 0
Nov 28 11:48:53 localhost dhcpd: DHCPACK on
200.28.147.186 to 00:07:e9:68:21:00 via eth
Nov 28 14:48:53 localhost in.tftpd[30463]: tftp:
client does not accept options
Nov 28 11:48:59 localhost kernel: e1000: eth1 NIC
Link is Down
Nov 28 11:49:02 localhost kernel: e1000: eth1 NIC
Link is Up 1000 Mbps Full Duplex
Nov 28 11:49:05 localhost dhcpd: DHCPDISCOVER from
00:07:e9:68:21:00 via eth0
Nov 28 11:49:05 localhost dhcpd: DHCPOFFER on
200.28.147.186 to 00:07:e9:68:21:00 via e
Nov 28 11:49:05 localhost dhcpd: DHCPREQUEST for
200.28.147.186 (200.28.147.185) from 0
Nov 28 11:49:05 localhost dhcpd: DHCPACK on
200.28.147.186 to 00:07:e9:68:21:00 via eth
Nov 28 11:49:05 localhost rpc.mountd: authenticated
mount request from pi2:800 for /dat
Nov 28 11:49:05 localhost kernel: e1000: eth1 NIC
Link is Down
Nov 28 11:49:07 localhost kernel: e1000: eth1 NIC
Link is Up 1000 Mbps Full Duplex
Nov 28 11:58:22 localhost kernel: e1000: eth1 NIC
Link is Down
Nov 28 11:58:33 localhost dhcpd: dhcpd shutdown
succeeded
Nov 28 11:59:28 localhost kernel: e1000: eth1 NIC
Link is Up 100 Mbps Full Duplex
Nov 28 11:59:35 localhost kernel: e1000: eth1 NIC
Link is Down
Nov 28 11:59:37 localhost kernel: e1000: eth1 NIC
Link is Up 1000 Mbps Full Duplex
Nov 28 12:00:59 localhost kernel: e1000: eth1 NIC
Link is Down
Nov 28 12:01:01 localhost kernel: e1000: eth1 NIC
Link is Up 1000 Mbps Full Duplex
Nov 28 12:01:04 localhost kernel: e1000: eth1 NIC
Link is Down
Nov 28 12:01:06 localhost kernel: e1000: eth1 NIC
Link is Up 1000 Mbps Full Duplex
7/ pi1 :
/data2/bootonlan/pxeclient/
( safe copy kept in
/data1/bootonlan/pxeclient )
8/ Fedora Core 7
UWAGA : /dev/ musi byc skopiowany na dzialajacym systemie
, inaczej jest pusty, trzeba dodac opcje dla kernela selinux=0 !!!
W tej chwili to juz dziala , nawet z heplx43, zapiski z
konfiguracji smok2 tutaj
9/ Możliwe problemy
- UWAGA : /dev/ musi byc skopiowany na dzialajacym systemie !!!
, inaczej jest pusty, trzeba dodac opcje dla kernela selinux=0 !!!
W tej chwili to juz dziala , nawet z heplx43, zapiski z
konfiguracji smok2 tutaj
To sie zdarza czesto na tych nowszych systemach, ktore dev tworza sobie "w locie"
wystapilo tez na SL5.5 itp, Np u mnie objrawialo sie tym ze zawisl po takich
komunikatach :
Warning: unable to open an initial console.
SELinux: Disabled at runtime.
SELinux: Unregistering netfilter hooks
audit(1295361972.627:2): selinux=0 auid=4294967295
hostname used greatest stack depth: 1444 bytes left
start_udev used greatest stack depth: 1260 bytes left
- Jesli przy boocie pojawia sie :
"Looking up
port of RPC 10003/2 on"
To zwykle oznacza, że driver karty
sieciowej nie zostal wkompilowany na stałe w kernel tylko jako moduł
pewnie i dlatego wogóle na nim sieć nie działa
- W nowszych wersjach nie dziala poprawnie
shutdown bo eth0 zamyka sie za wczesnie i przez to zawisa i już nie nie
moze zrobić ( podcina gałąź na której siedzi ).
Żeby to poprawić trzeba albo zmienić kolejność wyłaczania tak żeby eth0
sie na samiutkim końcu wyłączał albo po prostu przeedytowac
/etc/init.d/network i
w stop) skasować wszystko i wstawić samo "exit 1;" i już po prostu sieć
się nie wyłączy i shutdown będzie poprawnie działał