Diskless Boot - LinuxUserGroupUWSP/RackMesa GitHub Wiki
#Prerequisites
- PXE
- NFS or distributed filesystem
#Installation Use --installroot to install packages to the shared system.
yum groups -y install "Minimal Install" --releasever=7 --installroot=/var/lib/tftpboot/centos7/root/
Create a root password.
python -c 'import crypt,getpass;
print(crypt.crypt(getpass.getpass(),
crypt.mksalt(crypt.METHOD_SHA512)))'
vi /var/lib/tftpboot/centos7/root/etc/shadow
root:<password>
Create client fstab.
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
Configure NFS to share system files.
vi /etc/exports
/var/lib/tftpboot/centos7/root 10.0.0.0/24(rw,no_root_squash)
Download the CentOS 7 kernel images.
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
vi /var/lib/tftpboot/pxelinux.cfg/default
Add the CentOS 7 option to the menu.
default centos7
label centos7
kernel centos7/vmlinuz
append initrd=centos7/initrd.img root=nfs:<nfs-server>:/var/lib/tftpboot/centos7/root rw selinux=0
Allow NFS connections.
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=mountd
firewall-cmd --reload
Start the NFS server.
systemctl start rpcbind nfs-server