1. nfs (network file system) -> 네트워크으로 파일시스템 공유 2. nfs lock -> 네트워크로 파일시스템 공유 중일때 다른 사람이 사용하지 못하도록한다. 중복성 3. vmlinuz 파일 -> 리눅스 커널을 컴파일한 결과인 바이너리 파일이다. bzimage를 사용하여 gzip으로 압축해 놓고 리눅스 부팅시 압축을 해제하여 메모리에 로딩되어 리눅스의 운영이 시작. 4. initrd.img 파일 -> 커널 모듈을 모아놓은 이미지로 커널이 로딩되기전에 메모리에 미리 로딩되어 진다. ( 마우스 드라이버, 그래픽카드 모듈 등 ) 5. syslinux 파일 -> MS-DOS/Windows FAT 파일 시스템에서 실행 리눅스 운영 체제 용 부트 로더입니다. 그것은 리눅스 처음 설치를 단순화하기위한, 구조 및 기타 특수 목적의 부팅 디스크 생성에 있습니다. 6. pxelinux.0 파일 -> syslinux 패키지에 포함되어 있는 파일로 대부분의 시스템에는 기본적으로 설치가 되어 있다. pxelinux.0는 네트워크 부트 로더로 리눅스의 grub / lilo 와 같은 역활을 한다. 7. menu.c32 파일 -> pxe 설치 시 메뉴선택 할 수 있게 하는 파일 8. anaconda.cfg 파일 -> pxe 설치 시 리눅스 설정 파일 리눅스 설치 후 /root/폴더에 설치 설정내역들이 자동으로 저장된다
# vi /etc/dhcpd.conf # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.sample allow bootp; allow booting; class "pxeclients" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.168.10.137; ( 자신의 아이피 / TFTP서버 ) filename "pxelinux.0"; ( pxelinux.0 로드 ) } max-lease-time 60; default-lease-time 60; ddns-update-style ad-hoc; option subnet-mask 255.255.255.0; subnet 192.168.10.0 netmask 255.255.255.0 { option routers 192.168.10.2; ( 게이트웨이 ) option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.10.10 192.168.10.165; ( DHCP 할당 대역 ) }
# vi /etc/xinetd.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 { socket_type = dgram protocol = udp ( UDP 방식 ) wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no ( yes -> no으로 할성화 ) per_source = 11 cps = 100 2 flags = IPv4 }
# mkdir /tftpboot 폴더 생성 1. syslinux 설치 -> yum install syslinux 2. pxelinux.0 옮기기 # cp /usr/lib/syslinux/pxelinux.0 /tftpboot 3. menu.c32 옮기기 # cp /usr/lib/syslinux/menu.c32 /tftpboot 4. vmlinuz 옮기기 # cp /media/images/pxeboot/vmlinuz /tftpboot 5. initrd.img 옮기기 # cp /media/images/pxeboot/initrd.img /tftpboot 6. anaconda.cfg 옮기기 # cp /root/anaconda.cfg /tftpboot/kickstart/anaconda.cfg 7. pxelinux.0 파일을 읽어드릴 config 파일 생성 # mkdir /tftpboot/pxelinux.cfg 폴더 생성 # vi /tftpboot/pxelinux.cfg/default 파일 생성 default menu.c32 timeout 100 menu background splash.jpg menu color border 0 #ffffffff #00000000 menu color sel 7 #ffffffff #ff000000 menu color title 0 #ffffffff #00000000 menu color tabmsg 0 #ffffffff #00000000 menu color unsel 0 #ffffffff #00000000 menu color hotsel 0 #ff000000 #ffffffff menu color hotkey 7 #ffffffff #ff000000 menu color timeout_msg 0 #ffffffff #00000000 menu color timeout 0 #ffffffff #00000000 menu color cmdline 0 #ffffffff #00000000 menu tabmsg Press ENTER to Install or TAB to edit a menu entry menu title #### OS Installer Boot Menu #### label 2 menu label oel5.9 kernel vmlinuz/oel5.9/vmlinuz append ksdevice=eth0 initrd=initrd/oel5.9/initrd.img network ks=nfs:192.168.10.130:/tftpboot/kickstart/oel59.cfg l abel 1 menu label oel5.8 kernel vmlinuz/oel5.8/vmlinuz append ksdevice=eth0 initrd=initrd/oel5.8/initrd.img network ks=nfs:192.168.10.130:/tftpboot/kickstart/oel58.cfg - menu label : 메뉴 선택 라벨명 - kernel : /tftpboot/ 폴더에서 절대경로 vmlinuz 파일 위치 - ksdevice=eth0 : kickstart 부팅할 때 사용할 eth 장치명 - initrd=initrd.img : /tftpboot/ 폴더에서 절대경로 initrd.img 파일 위치 - network ks=nfs:192.168.10.137:/tftpboot/kickstart/oel58.cfg : NFS서버 아이피 : anaconda.cfg 절대 경로 # vmlinuz와 initrd.img 파일은 같은 버전 파일이여야 한다.
# yum install -y nfs-uils -> nfs 패키지 설치 # vi /etc/exports /media/ *(ro) ( 리눅스 설치 ISO 파일 절대 경로 ) /tftpboot/kickstart/ *(ro) ( anaconda.cfg 파일 절대 경로 ) # exportfs -v -> nfs 공유 설정 확인
# mkdir /tftpboot/kickstart # cp /root/anaconda.cfg /tftpboot/kickstart # chmod 777 /tftpboot/kickstart/anaconda.cfg # vi /tftpboot/kickstart/anaconda.cfg install -> install & upgrade 설정 text -> 설치 모드 설정 (Default 그래픽 모드로 설치) nfs --server=192.168.10.137 --dir=/media -> nfs : nfs으로 설치 -> --server= : nfs서버 아이피 -> --dir=/media : 리눅스 설치 ISO 이미지 절대 경로 -> url 설치, cdrom 설치 등 있음. # 예) url --url http://centos.mirror.cdnetworks.com/centos/5.4/os/i386 # 예) nfs --server=192.168.0.1 --dir=/mnt/md0 lang en_US.UTF-8 langsupport --default=en_US.UTF-8 en_US.UTF-8 ko_KR.UTF-8 -> 언어 선택 -> langsupport에 ko_RK,UTF-8을 추가해주면 한국어 지원 keyboard us -> 키보드 설정 mouse none -> 마우스 설정 network --onboot yes --device eth0 --bootproto dhcp --noipv6 -> 네트워크 설정 -> eth0 디바이스를 DHCP으로 설정, ONBOOT=yes, ipv6 사용 안함 예) # network --device eth0 --bootproto static --ip 192.168.0.10 --netmask 255.255.255.0 --gateway 192.168.0.1 --nameserver 168.126.63.1 --hostname test rootpw --iscrypted $1$5aH5feJ4$hV4mobHAt8w39MKlqIWOM. -> root 패스워드 설정 firewall --disabled -> firewall 설정 -> disabled & enabled selinux --disabled -> SElinux 설정 authconfig --enableshadow --enablemd5 -> 시스템에서 사용될 인증 옵션 설정. (default 값) timezone --utc Asia/Seoul -> timezone 설정 bootloader --location=mbr --driveorder=sda --append="rhgb quiet" -> 부트로더 설정 clearpart --all --initlabel --linux -> 시스템에 있는 모든 파티션을 삭제 part / --fstype ext3 --size=4096 --ondisk=sda part swap --size=8192 --ondisk=sda part /tmp --fstype ext3 --size=4096 --ondisk=sda part /var --fstype ext3 --size=10240 --ondisk=sda part /usr --fstype ext3 --size=30720 --ondisk=sda part /home --fstype ext3 --size=1 --grow --ondisk=sda -> 파티션 설정 -> grow 옵션은 사용 가능한 용량을 전부 선택 %packages -> %packages 아래 부터 패키지 설치 설정 -> @는 패키지 그룹을 설치 -> -는 패키지 설치 하지 않음 @development-tools xinetd ntp net-snmp net-snmp-devel -NetworkManager %post -> %post 아래부터 OS 설치 완료 후 실행할 스크립트 설정 mkdir test chmod 755 /test chkconfig --level 345 sshd on chkconfig --level 345 vsftpd on chkconfig --level 345 NetworkManager off chkconfig --level 345 iptables off #!/bin/bash mkdir -p /root/.ssh ; chmod 700 /root/.ssh cat <<EOF> /root/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA8eBPI9xSBQydKno3fvMieEF5VkVonf/RftJyseqZnenxzPMWSe +t7frwoQKlV1wYEU8Y7sHUFpRS5QmPhDWxJJr94THqzskoAWcDD5UEuAEs3vSqPhx5hfyxVFLhYeprgTIp7lxMdz96y4i74ukB7j1XtcjZVPIZiKNcyyDxEXs= root@tmadm2 EOF chmod 644 /root/.ssh/authorized_keys cat <<_EOF > /root/complete.sh #!/bin/bash echo -e "\n\nHOSTNAME Setup : /etc/hosts /etc/sysconfig/network " mkdir -p /root/bin rm -f /etc/yum.repos.d/CentOS-*.repo wget http://osdev/ADD/scripts/daemon.sh -O /root/bin/daemon.sh wget http://osdev/ADD/scripts/linux.sh -O /root/bin/linux.sh wget http://osdev/ADD/scripts/security.sh -O /root/bin/security.sh wget http://osdev/ADD/scripts/base_user.sh -O /root/bin/base_user.sh wget http://osdev/ADD/repos/CentOS6.repo -O /etc/yum.repos.d/CentOS6.repo chmod 755 /root/bin/*.sh /root/bin/linux.sh /root/bin/security.sh /root/bin/daemon.sh rm -f /root/bin/security.sh /root/bin/daemon.sh VENDOR=\`/usr/sbin/dmidecode | grep "Vendor" | sed 's/Vendor://g;s/ //g;s/\\t//g' \` if [ "\$VENDOR" == "HP" ] ; then yum -y install hpacucli hp-health chkconfig hp-health on ; service hp-health start elif [ "\$VENDOR" == "Dell" ] ; then yum -y install srvadmin-omilcore srvadmin-storage fi _EOF cat <<EOF>> /etc/hosts 192.168.10.10 osdev EOF chmod 755 /root/complete.sh
1. xinetd (tftpd) 2. dhcpd 3. portmap ( Linux 5버전 ) 3. rpcbind ( Linux 6버전 ) 4. nfs