Post List

2014/07/03

Network Booting OS 설치 #2 - syslinux


부트로더인 syslinux 를 설치한다.
[root@localhost tftpboot]# rpm -qa syslinux
[root@localhost tftpboot]# yum install syslinux

... ...

================================================================================
 Package                 Arch         Version               Repository     Size
================================================================================
Installing:
 syslinux                x86_64       4.02-16.el6_5         updates       331 k
Installing for dependencies:
 syslinux-nonlinux       i686         4.02-16.el6_5         updates       513 k

Transaction Summary
================================================================================
Install       2 Package(s)

Total download size: 844 k
Installed size: 2.0 M
Is this ok [y/N]: y

... ...

Running Transaction
  Installing : syslinux-4.02-16.el6_5.x86_64                                1/2 
  Installing : syslinux-nonlinux-4.02-16.el6_5.i686                         2/2 
  Verifying  : syslinux-nonlinux-4.02-16.el6_5.i686                         1/2 
  Verifying  : syslinux-4.02-16.el6_5.x86_64                                2/2 

Installed:
  syslinux.x86_64 0:4.02-16.el6_5                                               

Dependency Installed:
  syslinux-nonlinux.i686 0:4.02-16.el6_5                                        

Complete!
[root@localhost tftpboot]# 

설치 완료.




TFTP에 필요한 Directory 를 만들고 부트로더를 카피한다.


mkdir /tftpboot  # 이미 있으면 무시
mkdir /tftpboot/pxelinux.cfg

cp /usr/share/syslinux/pxelinux.0 /tftpboot/
cp /usr/share/syslinux/menu.c32 /tftpboot/
cp /usr/share/syslinux/memdisk /tftpboot/
cp /usr/share/syslinux/mboot.c32 /tftpboot/
cp /usr/share/syslinux/chain.c32 /tftpboot/



파일 확인



[root@localhost tftpboot]# ll /tftpboot
total 180
-rw-r--r--  1 root root 20448 Jul  3 16:00 chain.c32
-rw-r--r--  1 root root 35676 Jul  3 16:00 mboot.c32
-rw-r--r--  1 root root 24988 Jul  3 16:00 memdisk
-rw-r--r--  1 root root 61056 Jul  3 16:00 menu.c32
-rw-r--r--  1 root root 26595 Jul  3 16:00 pxelinux.0
drwxr-xr-x  2 root root  4096 Jul  3 15:55 pxelinux.cfg
-rw-r--r--. 1 root root     8 Jul  3 05:48 testme
[root@localhost tftpboot]# 



이제 OS 를 설치하기 위해 디렉토리를 만들고 파일을 복사한다.

CentOS ISO 파일이 /media/Centos_6.5_Final 에 mount 되어 있다고 가정한다.

[root@localhost CentOS_6.5_Final]# mkdir /tftpboot/centos6
[root@localhost CentOS_6.5_Final]# mkdir /tftpboot/centos6/i386
[root@localhost CentOS_6.5_Final]# cp /media/CentOS_6.5_Final/* -r /tftpboot/centos6/i386/
[root@localhost CentOS_6.5_Final]# 





PXE 환경설정 파일 생성
vi /etc/httpd/conf.d/pxeboot.conf

Alias /centos6/i386 /tftpboot/centos6/i386

<directory /tftpboot/centos6/i386>
 Options Indexes FollowSymLinks
 Order Deny,Allow
 Deny from all
 Allow from 127.0.0.1 192.168.88.0/24
</directory>




PXE Menu 파일 생성



vi /tftpboot/pxelinux.cfg/default


default menu.c32
prompt 0
timeout 300
ONTIMEOUT local
menu title =========== PXE Boot Menu by Jay ===========

label 1
menu label ^1) Install CentOS 6.5 i386
kernel centos6/i386/images/pxeboot/vmlinuz
append initrd=centos6/i386/images/pxeboot/initrd.img method=http://192.168.88.245/centos6/i386 devfs=nomount

label 2
menu label ^2) Boot from local drive localboot


서버를 재시작 한다.

[root@localhost CentOS_6.5_Final]# /etc/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
[root@localhost CentOS_6.5_Final]# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@localhost CentOS_6.5_Final]# 


이제 tftp 를 포함해서 CentOS 쪽 설정은 끝났다.

남은 것은 Router 설정과 테스트 뿐이다.





No comments:

Post a Comment

Popular Posts