Membuat server PXE network booting dengan Debian Lenny

(server HP Proliant yang akan diinstall melalui PXE Boot)

Salah satu server HP Proliant di kantor mengalami kerusakan CDROM, sehingga tidak bisa booting melalui CD yang memuat sistem operasi linux.  Untuk ini saya memfungsikan server IBM lain untuk dijadikan server PXE network booting.

(server PXE menggunakan IBM)

PXE atau “Pre-boot eXecution Environment” bermanfaat untuk  recovery sistem dan instalasi system, menggunakan network booting. Dengan PXE kita dapat booting sistem dan mendapatkan IP address dari DHCP dan menjalankan kernel melalui network.

Berikut Instalasi PXE network booting pada salah satu server yang dapat berfungsi untuk instalasi sistem operasi server lain yang jika tidak memiliki cdrom.

Server PXE : Sudah terinstall Debian Lenny5.0  dengan IP address 10.190.159.263

Server client : Akan diinstall Debian Lenny 5.0 melalui network boot PXE dengan IP Address didapat dari DHCP server PXE

===================================

Instalasi

pxe-boot:/home/gtoms# apt-get install tftpd-hpa
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
inetutils-inetd
Recommended packages:
inet-superserver
The following NEW packages will be installed:
inetutils-inetd tftpd-hpa
0 upgraded, 2 newly installed, 0 to remove and 8 not upgraded.
Need to get 117kB of archives.
After this operation, 287kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://kambing.ui.ac.id lenny/main inetutils-inetd 2:1.5.dfsg.1-9 [82.2kB]
Get:2 http://kambing.ui.ac.id lenny/main tftpd-hpa 0.48-2.3 [34.6kB]
Fetched 117kB in 1s (99.0kB/s)
Preconfiguring packages …
Selecting previously deselected package inetutils-inetd.
(Reading database … 13312 files and directories currently installed.)
Unpacking inetutils-inetd (from …/inetutils-inetd_2%3a1.5.dfsg.1-9_i386.deb) ...
Selecting previously deselected package tftpd-hpa.
Unpacking tftpd-hpa (from …/tftpd-hpa_0.48-2.3_i386.deb) ...
Processing triggers for man-db …
Setting up inetutils-inetd (2:1.5.dfsg.1-9) ...
Not starting internet superserver: no services enabled. (warning).
Setting up tftpd-hpa (0.48-2.3) ...
invoke-rc.d: initscript inetutils-inetd, action “force-reload” failed.
tftpd-hpa disabled in /etc/default/tftpd-hpa
pxe-boot:/home/gtoms#

pxe-boot:/home/gtoms# nano /etc/default/tftpd-hpa

#Defaults for tftpd-hpa
RUN_DAEMON=”yes”
OPTIONS=”-l -s /var/lib/tftpboot”

pxe-boot:/home/gtoms# mkdir -p /var/lib/tftpboot
pxe-boot:/home/gtoms#

pxe-boot:/home/gtoms# /etc/init.d/tftpd-hpa start
Starting HPA’s tftpd: in.tftpd.
pxe-boot:/home/gtoms#

pxe-boot:/home/gtoms# apt-get install dhcp3-server
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
dhcp3-client dhcp3-common
Suggested packages:
resolvconf avahi-autoipd dhcp3-server-ldap
The following NEW packages will be installed:
dhcp3-server
The following packages will be upgraded:
dhcp3-client dhcp3-common
2 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 846kB of archives.
After this operation, 782kB of additional disk space will be used.
Do you want to continue [Y/n]? y
——————-skip—————————-

pxe-boot:/home/gtoms#nano /etc/dhcp3/dhcpd.conf

option domain-name-servers 202.51.xx.xx, 202.51.xx.xx;
default-lease-time 86400;
max-lease-time 604800;
authoritative;

subnet 10.190.159.0 netmask 255.255.255.0 {
range 10.190.159.237 10.190.159.240;
filename “pxelinux.0”;
next-server 10.190.159.236;
option subnet-mask 255.255.255.0;
option broadcast-address 10.190.159.255;
option routers 10.190.159.1;
}

pxe-boot:/home/gtoms# /etc/init.d/dhcp3-server restart

Konfigurasi PXE

pxe-boot:/home/gtoms# mkdir /var/lib/tftpboot/pxelinux.cfg
pxe-boot:/home/gtoms# nano /var/lib/tftpboot/pxelinux.cfg/default

DISPLAY boot.txt

DEFAULT lenny_i386_install

LABEL lenny_i386_install
kernel debian/lenny/i386/linux
append vga=normal initrd=debian/lenny/i386/initrd.gz —LABEL lenny_i386_linux
kernel debian/lenny/i386/linux
append vga=normal initrd=debian/lenny/i386/initrd.gz —

LABEL lenny_i386_expert
kernel debian/lenny/i386/linux
append priority=low vga=normal initrd=debian/lenny/i386/initrd.gz —

LABEL lenny_i386_rescue
kernel debian/lenny/i386/linux
append vga=normal initrd=debian/lenny/i386/initrd.gz  rescue/enable=true—

PROMPT 1
TIMEOUT 0


pxe-boot:/home/gtoms# cd /var/lib/tftpboot/

pxe-boot:/var/lib/tftpboot# nano /var/lib/tftpboot/boot.txt

DISPLAY boot.txt

DEFAULT lenny_i386_install

LABEL lenny_i386_install
kernel debian/lenny/i386/linux
append vga=normal initrd=debian/lenny/i386/initrd.gz —LABEL lenny_i386_linux
kernel debian/lenny/i386/linux
append vga=normal initrd=debian/lenny/i386/initrd.gz —

LABEL lenny_i386_expert
kernel debian/lenny/i386/linux
append priority=low vga=normal initrd=debian/lenny/i386/initrd.gz —

LABEL lenny_i386_rescue
kernel debian/lenny/i386/linux
append vga=normal initrd=debian/lenny/i386/initrd.gz  rescue/enable=true—

PROMPT 1
TIMEOUT 0

pxe-boot:/var/lib/tftpboot# wget http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0—2010-01-26 14:33:56—  http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0
Resolving ftp.uk.debian.org… 83.142.228.128
Connecting to ftp.uk.debian.org|83.142.228.128|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 15820 (15K)
Saving to: `pxelinux.0’

100%[=================================>] 15,820      32.4K/s   in 0.5s

2010-01-26 14:33:57 (32.4 KB/s) – `pxelinux.0’ saved [15820/15820]

pxe-boot:/var/lib/tftpboot# mkdir -p /var/lib/tftpboot/debian/lenny/i386

pxe-boot:/var/lib/tftpboot# cd /var/lib/tftpboot/debian/lenny/i386

pxe-boot:/var/lib/tftpboot/debian/lenny/i386# wget http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/linux—2010-01-26 14:34:51—  http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/linux
Resolving ftp.uk.debian.org… 83.142.228.128
Connecting to ftp.uk.debian.org|83.142.228.128|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1468976 (1.4M)
Saving to: `linux’

100%[==================================>] 1,468,976    124K/s   in 13s

2010-01-26 14:35:04 (112 KB/s) – `linux’ saved [1468976/1468976]

pxe-boot:/var/lib/tftpboot/debian/lenny/i386# wget http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz—2010-01-26 14:35:26—  http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz
Resolving ftp.uk.debian.org… 83.142.228.128
Connecting to ftp.uk.debian.org|83.142.228.128|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 5989468 (5.7M)
Saving to: `initrd.gz’

100%[===============================>] 5,989,468    126K/s   in 52s

2010-01-26 14:36:17 (114 KB/s) – `initrd.gz’ saved [5989468/5989468]

pxe-boot:/var/lib/tftpboot# apt-get install tree
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
tree
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 29.2kB of archives.
After this operation, 94.2kB of additional disk space will be used.
Get:1 http://kambing.ui.ac.id lenny/main tree 1.5.2-1 [29.2kB]
Fetched 29.2kB in 0s (156kB/s)
Selecting previously deselected package tree.
(Reading database … 13440 files and directories currently installed.)
Unpacking tree (from …/archives/tree_1.5.2-1_i386.deb) ...
Processing triggers for man-db …
Setting up tree (1.5.2-1) ...
pxe-boot:/var/lib/tftpboot#

pxe-boot:/var/lib/tftpboot# tree /var/lib/tftpboot/
/var/lib/tftpboot/
|—boot.txt
|—debian
|   `—lenny
|       `—i386
|           |—initrd.gz
|           `—linux
|—initrd.gz
|—linux
|—pxelinux.0
`—pxelinux.cfg
`—default

4 directories, 7 files
pxe-boot:/var/lib/tftpboot#

Setelah konfigurasi selesai tinggal menjalankan server client yang hendak diinstall dan memiliki fitur booting melalui PXE pada konfigurasi BIOS server tersebut. Server client ini akan mendapat IP address dari DHCP server PXE dan akan membooting melalui jaringan network dan menampilkan menu pada file boot.txt yang telah dikonfigurasi diatas.

2 thoughts on “Membuat server PXE network booting dengan Debian Lenny

  1. Kalman

    Kedan,

    Kayaknya gw kenal tuh gambar yang diatas tuh. hehehe.

    Pa kabar kedan, sorry baru baca artikel ente. kayaknya dah aktif nulis lagi neh.

    maen dong ke PB, sebelom ni kantor bubar/pindah ke cideng

  2. wisnu

    maaf mau tanya… jika Debian di ganti dengan windows bisa ga’ yaa??
    maksudnya yang di install lewat PXE network booting adalah windows…
    ada tutorial nya ga’ mas? atau link yang bermanfaat gitu???

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.