목차

Diskless Client 구성

이강우 2021/04/01 10:44

이 작업에 앞서 아래 항목들이 선행되어야 한다.

PXE서버에 필요 패키지 설치

[root@dlp ~]# yum -y install dracut-network nfs-utils

PXE서버에 Client용 시스템 구성


[root@dlp ~]# mkdir -p /var/lib/tftpboot/centos7/root
[root@dlp ~]# yum groups -y install "Server with GUI" --releasever=7 --installroot=/var/lib/tftpboot/centos7/root/
# generate encrypted root password (remeber it)
[root@dlp ~]# python -c 'import crypt,getpass; \
print(crypt.crypt(getpass.getpass(), \
crypt.mksalt(crypt.METHOD_SHA512)))'
Password:
$6$EC1T.oKN5f3seb20$y1WlMQ7Ih424OwOn.....
[root@dlp ~]# vi /var/lib/tftpboot/centos7/root/etc/shadow
# set root password generated above
root:$6$EC1T.oKN5f3seb20$y1WlMQ7Ih424OwOn.....:16372:0:99999:7:::
[root@dlp ~]# vi /var/lib/tftpboot/centos7/root/etc/fstab
none    /tmp        tmpfs   defaults   0 0
tmpfs   /dev/shm    tmpfs   defaults   0 0
sysfs   /sys        sysfs   defaults   0 0
proc    /proc       proc    defaults   0 0

[root@dlp ~]# wget -P /var/lib/tftpboot/centos7/ \
http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz \
http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/initrd.img
[root@dlp ~]# vi /var/lib/tftpboot/pxelinux.cfg/default
# create new
default centos7

label centos7
    kernel centos7/vmlinuz
    append initrd=centos7/initrd.img root=nfs:10.0.0.30:/var/lib/tftpboot/centos7/root rw selinux=0 

Client용 NFS 마운트 포인트 설정

[root@dlp ~]# vi /etc/exports
/var/lib/tftpboot/centos7/root 10.0.0.0/24(rw,no_root_squash)

[root@dlp ~]# systemctl start rpcbind nfs-server
[root@dlp ~]# systemctl enable rpcbind nfs-server

참조링크