PXE install O/S rhel5,6 also working at fedora12,13 , centos 5,6
먼저 설정 해 야 할 부분들 목록입니다.
network
tftp
dhcpd
pxelinux.cfg/default
/etc/exports
---------------------------------------------------------------------------------------------------------------------
PXE 가 동작 하는 원리


로 동작합니다.
그럼 이제 pxe 설정 파일 부분들에 대하여 다뤄 보겠습니다.
엄청난 삽질 끝에 완성 시키고 말았는데여... 헤헤;;

굉장히 난해한 부분 도 많고 응용 포인트 또한 많습니다. pxe 를 이용하여 백업 구성 하기 라는 논문도 있습니다. (고려대학교 석사 이름은 기억이..) 여튼.. 재미진? pxe 를 한번 해보도록 하겠습니다.


먼저 kickstart file 을 준비 합니다.
system-config-kickstart 로 생성을 할 수 있으며, http://centos.pe.kr/install/ks/in_form.php 에서도 생성 가능합니당..
GUI 도 없고 인터넷도 연결이 안됐는데 어떻게 해요? 라는 질문을 들었는데요. ksvalidator 를 이용하여 문법체크를 일일히.. 해주면서 처음부터 끝까지 치셔야 합니다.. 뭐 능숙한 분 이라면은 가능하겠지만, 저의 경우 ..응?  제가 구성한 kickstart 파일을 예제로 보도록 하지요!

이렇게 생성이 되었는데요. 그림이 이상하고 화질도 별로니. 텍스트로 복사 한 것을 보면은.

# Kickstart file automatically generated by anaconda.
text
install
nfs --server=192.168.23.134 --dir=/tftpboot/linux-install/ks
#nfs --server=192.168.23.134:/tftpboot/linux-install/ks/ks.cfg --dir=/tftpboot/linux-install/ks/
key --skip
lang en_US.UTF-8
keyboard us
xconfig --startxonboot
network --device eth0 --bootproto dhcp
rootpw --iscrypted $1$CqEsRSAw$SI9HASXx5KEdoOCdznwp80
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --enforcing
timezone --utc Asia/Seoul
bootloader --location=mbr
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --zerombr 

#rhel5 modify if you installing rhel6 about ext4 type or any other types

part /boot --fstype ext3 --size=256 --asprimary
part swap --size=2048 --asprimary
part / --fstype ext3 --size=1 --grow

%post
echo TEST O/S >> /etc/issue
%end

%packages
@admin-tools
@base


요렇게 생겼습니다. packages 부분은 알고 계시고 이미 숙지 하고 있다 그러면 뭐.. 일일히 쳐주셔도 됩니다.

때에 따라 추가가 가능하며 anaconda-ks.cfg 를 참고 하여 만드셔도 됩니다 ^_^;

kickstart 파일을 일단 루트에 저장해 두었습니다.
/etc/xinet.d/tftp 로 넘어 갑니다.

# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        disable = no > yes 로 변경 해주시구요
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot/ tftp 가 응답 할 폴더입니다. 설치시 참조할 경로를 보는 것이므로 /tftpboot 로 생성하시지 않으 셧다면 다른것으로 바꾸셔도 무방합니다.
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

전반적인 설정은 끝났습니다.. 응?; 참 쉽죠....?;;

이제 nfs 나 http 나 둘중 아무거나 선택 하셔도 되는데 nfs 부터 해보도록 합니당..
저의 경우 root 디렉토리에 ~/tftpboot/linux-install 로 만들어 줬습니다. (구글어디선가 보고 마냥 따라해서요..) 이 폴더가 tftp server_args 에 있는 곳에 응답합니다.
nfs 로 마운트 되어 있는 경로를 때려 박습니다. dvd 든 뭐든 다 알아들으세요 라고 하구요.

/etc/exports 를 엽니다. (vi, vim)
/tftpboot/linux-install/ks/ks.cfg 192.168.23.0*(ro,no_root_squash,sync)
/tftpboot/linux-install 192.168.23.0*(ro,no_root_squash,sync)
위 경로를 exporfs 에 추가 하였습니다.

DVD 가 어디 있는지 정보를 넣어 준 뒤 동일 네트워크 대역에 있는 시스템을 전원 연결하여 pxe boot 를 해주면 끝납니다.

만약 데스크탑의 서버에 VMware 가 깔린 곳에서 이런 설정을 해주신 경우 VM 의 네트워크 설정은 당연히 데스크탑과 통신이 되어야 하므로 브릿지 설정을 해주시고 (vmware 자동연동 기능이 있습니다.)시행 하셔야 됩니다.

참고가 되셧길 바라며, 질문 사항은 덧글로 주시면 언제든 대답 드립니다.

+ Recent posts