#The “pxeos” enables you to create a new operating system under /tftpboot and places the vmlinux and initrd p_w_picpaths there.
Options for “pxeos”:
-a: Adds new O.S.
-i: Description of O.S.
-p: Protocol to use
-D: If set to 1, then it indicates it’s diskless
-s: NFS server
-L: Location of your O.S., this should contain the vmlinuz and initrd somewhere in it.
#生成NFS引导的内核文件
lpxeos -a -i centoskernel -p NFS -D 1 -s 192.168.159.120 -L /diskless/centos/test4 centoskernel
#查看pxeos是否成功
lpxeos -l
#查看NFS引导的内核文件是否生成
lll /tftpboot/linux-install/centoskernel/
#查看pxeos生成的配置文件
lmore /tftpboot/linux-install/pxelinux.cfg/pxeos.xml
The “pxeboot” command adds clients to the diskless environment and creates the HEX file for the host in the /tftpboot directory
Options for “pxeboot”:
-a: Adds new host
-O: Name of O.S. (You should have already created this with the system-config-netboot or pxeos)
-r: Size of ram disk
-S: Snapshot name of the diskless client.
-e: The interface through which the pxe boot will take place.
-N: NIS domain
-s: Serial console settings to view remote consoles during boot up
#生成diskless client所需要的启动文件,指定IP为192.168.159.130
lpxeboot -a -O centoskernel -r 28753 -S test4 -e eth0 -s console=ttyS0,115200n8r 192.168.159.130
#也可以不用pxeboot命令,而用01+MAC地址作为文件名(注意小写,由于PXE的寻址规律)
default centoskernel
label centoskernel
kernel centoskernel/vmlinuz
append console=ttyS0,9600n8 initrd=centoskernel/initrd.img root=/dev/ram0 init=diskle***c NFSROOT=192.168.159.120:/servers_drbd/centos/coreclient/test4 ramdisk_size=28753 ETHERNET=eth0 SNAPSHOT=test4