2009/12/16 13:12
OS 자동화 설치 관련 정리 Linux2009/12/16 13:12
Master 서버에 필요한 것..
- OS: CentOS 5.3
- DHCP 서버 구성
- tftp 서비스 활성화
- 설치할 OS 파일
1. nfs server 구성
# cat /etc/exports
/os *(ro,sync)
/mnt *(ro,sync)
/os : kickstart 설정 파일이 있음
/mnt : OS 이미지 파일이 마운트 되어 있음
# chkconfig --list nfs
nfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
2. tftp 구성
# rpm -q tftp-server-0.49-2.el5.centos
tftp-server-0.49-2.el5.centos
# chkconfig --list tftp
tftp on
# mkdir /tftpboot/boot
# mkdir /tftpboot/pxelinux.cfg
OS 시디안에 있는 initrd.img, vmlinux 파일을 /tftpboot/boot 로 복사.
/tftpboot/pxelinux.cfg/default 파일 작성
# cat default
default install
prompt 0
label install
kernel boot/vmlinuz
append initrd=boot/initrd.img ramdisk_size=7000 ks=nfs:<nfs server ip>:/os/ks.cfg
http://www.kernel.org/pub/linux/utils/boot/syslinux/ 에서 파일을 다운받아 압축을 풀어보면
pxelinux.0 파일이 있는 이 파일을 /tftpboot 아래로 복사한다.
3. DHCP 서버 구성
# cat /etc/dhcpd.conf
ddns-update-style interim;
allow booting;
allow bootp;
subnet 192.168.114.0 netmask 255.255.255.0 {
option routers 192.168.114.2;
option subnet-mask 255.255.255.0;
option domain-name "domain.org";
option domain-name-servers 192.168.114.132;
# we want the nameserver to appear at a fixed address
group {
filename "pxelinux.0";
next-server 192.168.114.132;
host node01 {
option host-name "node01";
hardware ethernet 00:0C:29:5D:2B:50;
fixed-address 192.168.114.200;
}
}
}
특정 MAC 을 지정하여 IP 주소를 할당하도록 구성 되어 있음.
4. 기타
- 시스템을 켜면 자동으로 OS 설치가 시작되는데 이미 OS 가 설치된 시스템들은 로컬 디스크로 부팅하게끔 하려면 아래와 같은 설정을 추가한다.
/tftpboot/pxelinux.cfg 아래에 IP주소를 16진수로 변환한 값을 이름으로 가지는 파일 작성
# cat C0A872C8
default local
prompt 0
label local
localboot 0
- kickstart 설정 파일은 system-config-kickstart 를 실행하여 쉽게 작성할 수 있음.
- 엑셀에서 10진수를 16진수로 변환방법 : =DEC2HEX(십진수)
