Posted
Filed under Computer/Linux

AutoYast를 이용한 SuSE 를 설치하는것을 적어 두었는데...
Kickstart를 이용한 Redhat 계열 리눅스 설치하는것이 없어서 한번 적어본다.
(SuSE 진행하는 방법에 약간의 internet을 이용하여 한번 주섬주섬 모아 시도해봤는제 한방에 잘 되었다. ㅋㅋ )

우선 rhel CD를 구하고, dhcp, tftp, nfs를 설정한다.
(nfs 대신에 http, ftp 등을 설정해도 된다.)

[] tftp설정
tftp 서버가 깔려 있어야 한다.
[root@rhel1 kickstart]# rpm -qa |grep tftp
tftp-server-0.42-3.1

/etc/xinet.d/tftp에서 disable=yes를 no로 바꾼다.
[root@rhel1 kickstart]# cat /etc/xinetd.d/tftp
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
xinetd를 실행시켜준다.
/etc/init.d/xinetd start

[] /tftpboot 설정
DVD 버전을 카피하는것이 편하다.
mkdir -p /tftpboot/boot
cp -fra /media/cdrom/image/pxeboot/* /tftpboot/boot
mkdir -p /tftpboot/pxelinux.cfg
vi /tftpboot/pxelinux.cfg/default
--------------------------------------------------
default test
prompt 0
label test
    kernel boot/vmlinuz
    append  initrd=boot/initrd.img ramdisk_size=7000 ks=nfs:<nfs server ip>:/mnt/test-ks.cfg
------------------------------------------------------
ks=nfs 대신에 http나 ftp를 쓰면 각 protocol로 사용가능하다.
만약에 client의 mac 주소를 이용하여 각 노드마다 설정값을 조금씩 틀리게 하고 싶다면 맥주소를 설정해준다.
만약에 client NIC device가 여러개라면 하나를 지정해줘야만 정상 작동되고 지정하지 않으면 부팅되다가 어느 device로 PXE을 이용하여 install할지 물어본다.
이때는 "ksdevice=eth0" 을 추가하여 지정해주는것이 편리하다.
--------------------------------------------------
default test
prompt 0
label test
    kernel boot/vmlinuz
    append  initrd=boot/initrd.img ramdisk_size=7000 ksdevice=eth0 ks=nfs:<nfs server ip>:/mnt/test-ks.cfg
------------------------------------------------------

예로 client(test server)의 맥이 00:0c:29:e4:fe:a8라면 다음 처럼 해준다.
cd /tftpboot/pxelinux.cfg/
cp default 01-00-0c-29-e4-fe-a8

그리고 pxelinux.0 란 파일을 인터넷에서 찾아서 /tftpboot 안에 카피해준다.



[] dhcp 설정
dhcp 가 깔려있나 살펴본다.
[root@rhel1 /]# rpm -qa |grep dhcp
dhcp-3.0.5-7.el5

/etc/dhcpd.conf 파일을 수정해준다.
vi /etc/dhcpd.conf

10.10.10.1 이 NFS 및 pxe서버라고 하자.
그리고 10.10.10.10으로 test서버를 설치하고 싶다고 하자.
아래 내용은 각 서버의 설정을 맥을 기준으로 설정값을 지정할때 사용하는 dhcpd.conf 이다.
---------------------------------------------------
##########################
# CEPluster DHCP Seting  #
# Copyright 20070503 cep #
# PXE & DHCP & TFTP Use  #
##########################
##Default Setting
not authoritative;
ddns-update-style none; # required for ISC v3.0
allow booting;
allow bootp;
allow unknown-clients;
default-lease-time 21600;
max-lease-time 43200;
 
shared-network CEPluster {
        subnet 10.10.10.0 netmask 255.255.255.0 {
                option routers 10.10.10.1; # gateway
                option subnet-mask 255.255.255.0;
                option domain-name "cep.kr";
                option domain-name-servers 10.10.10.1; #name server
        }
}
group {
        next-server 10.10.10.1; # PXE Server
        if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
                filename "pxelinux.0";
        }
 
        host  test {
                hardware ethernet 00:0c:29:e4:fe:a8;
                fixed-address 10.10.10.11;
        }
}
-------------------------------------------------

dhcp 자동할당 IP 범위를 줘서 설정할경우에는 아래를 사용
---------------------------------------------------
##Default Setting
not authoritative;
ddns-update-style none; # required for ISC v3.0
allow booting;
allow bootp;
allow unknown-clients;
default-lease-time 21600;
max-lease-time 43200;
 
shared-network CEPluster {
        subnet 10.10.10.0 netmask 255.255.255.0 {
                option routers 10.10.10.1; # gateway
                option subnet-mask 255.255.255.0;
                option domain-name "cep.kr";
                option domain-name-servers 10.10.10.1; #name server
        }
}
group {
        next-server 10.10.10.1; # PXE Server
        if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
                filename "pxelinux.0";
        }
 
pool {
                deny members of "ms-clients";
                deny members of "linux-dhcp";                
                range dynamic-bootp 10.10.10.10  10.10.10.200 ;(dhcp로 할당할 아이피 범위)
        }
}
-------------------------------------------------

/etc/init.d/dhcpd start

[] NFS 서버 설정
nfs 설치 여부 확인
[root@rhel1 /]# rpm -qa |grep nfs
nfs-utils-lib-1.0.8-7.2.z2
nfs-utils-1.0.9-24.el5

mkdir -p /mnt/kickstart
[root@rhel1 /]# cat /etc/exports
/mnt/cdrom *(ro,sync,no_root_squash)
/mnt/kickstart *(rw,sync,no_root_squash)

ks 파일을 /mnt/kickstart에 카피해준다.
cp test-ks.cfg /mnt/kickstart

이 test-ks.cfg파일은 linux를 한대를 깔면 /root/anaconda-ks.cfg 생성된다. 이파일을 카피해서 사용하게 되면 이 깔린 OS와 같은 환경이 설정이 된다. 그러므로 본인이 설치하고 싶은 형태로 적당히 수정해서 사용하면 된다.

nfs 가동
/etc/init.d/nfs start

그리고 client 노드에서 PXE부팅이 되도록 BIOS에서 설정을 해준다.
그리고 시스템을 부팅하면 자동으로 설치가 끝날것이다.

2009/07/03 18:05 2009/07/03 18:05
[로그인][오픈아이디란?]