Linux Diskless Workstation Setup Example

Linux diskless workstation setup example The
client is a blade that supports PXE booting, and Linux is used as the server. The server configuration is as follows:


1) Install the DHCP server dhcpd 2) Configure the /etc/dhcpd.conf file, the following is the file max


on my machine


-lease-time -1;
default-lease-time -1; #Note: IP addresses never expire
option subnet-mask 255.0.0.0;
option routers 10.0.0.1;
option domain-name-servers 10.10.10.10;
# option netbios -name-servers 10.10.10.10;
option broadcast-address 10.255.255.255;
# option dhcp-class-identifier "PXEClient";
# option vendor-encapsulated-options 01:04:00:00:00:00:ff;
# option option-135 "start";

subnet 10.0.0.0 netmask 255.0.0.0 {
range 10.10.12.131 10.10.12.150;

host blade01 {
hardware ethernet 00:e0:43:00:02:00;
fixed-address 10.10.12.131;
filename "/tftpboot/pxelinux.0"; #注:启动映象文件
}

host blade02 {
hardware ethernet 00:e0:43:00:02:02;
fixed-address 10.10.12.132;
filename "/tftpboot/pxelinux.0";
}

host blade03 {
hardware ethernet 00:e0:43:00:02:04;
fixed-address 10.10.12.133;
filename "/tftpboot/pxelinux.0";
}

host blade04 {
hardware ethernet 00:e0:43:00:02:06;
fixed-address 10.10.12.134;
filename "/tftpboot/pxelinux.0";
}

host blade05 {
hardware ethernet 00:e0:43:00:02:08;
fixed-address 10.10.12.135;
filename "/tftpboot/pxelinux.0";
}
}


  Description: After the dhcp client obtains the IP address, the TFTP protocol is used to download the boot image file from the server. I use

  the pxelinux in the syslinux toolkit as the loder for remote startup.

3) Configure tftp server

  Using pxelinux as the boot tool requires a tftp server that supports the TSIZE parameter.
  To use tftp service through xinetd, my /etc/xinetd.conf file is as follows

...
service tftp
{
socket_type = dgram
protocol = udp
wait = yes

user = root
server = /usr/sbin/in.tftpd
}


4 ) Configure PXELINUX

  to install the syslinux package first.
  Copy pxelinux.0 to the /tftpboot/ directory, and then create the /tftpboot/syslinux.cfg/ directory. Configuration files are stored in this directory.

  pxelinux uses the hexadecimal representation of the ip address as the filename of the configuration file for that ip address. For example, the

  ip address of blade01 is 10.10.12.131, the configuration file name is 0A0A0C83, and the content is:


default linux

label linux
kernel vmlinuz
append ip=dhcp root=/dev/nfsroot nfsroot=10.10.11.120:/remote/blade01 vga=normal


5) Configure nfs

  to create a root directory for each blade, specify the eXPort from this nfs in the pxelinux configuration file of the blade directory to start.

  The standard directories should be built in the root directory, and the usr, home, public and other directories that need to be re-mounted should also be exported.

  My /etc/exports file:


# /etc/exports: the Access control list for filesystems which may be exported
# to NFS clients. See exports(5).

/remote/blade01 blade01(rw,async,no_root_squash)
/remote/ blade02 blade02(rw,async,no_root_squash)
/remote/blade03 blade03(rw,async,no_root_squash)
/remote/blade04 blade04(rw,async,no_root_squash)
/remote/blade05 blade05(rw,async,no_root_squash)
/remote/root * (rw,async,no_root_squash)
/remote/home *(rw,async,no_root_squash)
/usr *(ro,async,no_root_squash)
/sbin *(ro,async,no_root_squash)
/bin *(ro,async,no_root_squash)
/lib *(ro,async,no_root_squash)
/home *(ro,async,no_root_squash)


6) Modify its /etc/fstab file for each blade, take blade01 as an example, its nfs root is /remote/blade01
/remote/blade01/etc/fstab file is as follows:
# /etc/fstab: static file system information .
#
#
10.10.11.120:/remote/blade01 / nfs defaults,intr 0 1
10.10.11.120:/remote/root /root nfs defaults,intr 0 1
10.10.11.120:/remote/home /home nfs defaults,intr 0 1
10.10.11.120:/bin /bin nfs defaults,intr 0 1
10.10.11.120:/usr /usr nfs defaults,intr 0 1
10.10.11.120:/sbin /sbin nfs defaults,intr 0 1
10.10.11.120:/lib /lib nfs defaults,intr 0 1
none /proc proc defaults,intr 0 1At


  the same time, modify its network configuration file for each blade, configure the ip address, start two network cards, and so on. .


7) Compile the kernel The kernel used for the

  blade should support the DHCP protocol of Kernel Level Auto Configuration, support NFS, and support NFS ROOT.

  Assuming that the compiled kernel is vmlinuz, copy it to the /tftpboot/ directory.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326368773&siteId=291194637