Linux diskless workstation setup instance

Source: Internet
Author: User
Article title: Linux diskless workstation instance setup. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The client is a blade that supports PXE startup and uses Linux 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 on my machine.
  
Max-lease-time-1;
Default-lease-time-1; # Note: the IP address never expires.
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.20.255.255;
# Option dhcp-class-identifier "PXEClient ";
# Option vendor-encapsulated-options 01: 04: 00: 00: 00: 00: ff;
# Options 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"; # Note: Start the image file
}
  
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 ";
}
}
  
Note: the dhcp client obtains the IP address and uses the TFTP protocol to download the startup image file from the server. I use syslinux
  
The pxelinux in the toolkit serves as the loder for remote startup.
  
3) configure the tftp server
  
To use pxelinux as a boot tool, you must support the tftp server with the TSIZE parameter. Download from http://www.kernel.org/pub/software/network/tftp.
  
Use the tftp service through xinetd. the 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
  
First install the syslinux software package. Download from http://www.kernel.org/pub/linux/utils/boot/syslinux.
  
Copy pxelinux.0 to the/tftpboot/directory and create the/tftpboot/syslinux. cfg/directory. Stores configuration files in this directory.
  
Pxelinux uses the hexadecimal representation of the IP address as the name of the configuration file of the IP address. Such as blade01
  
The IP address 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 = 10.10.11.120:/remote/blade01 vga = normal
  
5) configure nfs
  
Create a root directory for each blade and specify to start from the nfs export directory in the pxelinux configuration file of the blade.
  
Standard directories should be created in the root directory, and the usr, home, and public directories that need to be re-mounted must also be export.
  
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. taking blade01 as an example, its nfs root is/remote/blade01.
  
  
The/remote/blade01/etc/fstab file is as follows:
#/Etc/fstab: static file system information.
#
#
10.10.11.120:/remote/blade01/nfs ULTS ults, intr 0 1
10.10.11.120:/remote/root nfs ULTS ults, intr 0 1
10.10.11.120:/remote/home nfs ULTS ults, intr 0 1
10.10.11.120:/bin nfs ULTS ults, intr 0 1
10.10.11.120:/usr nfs ULTS ults, intr 0 1
10.10.11.120:/sbin nfs ULTS ults, intr 0 1
10.10.11.120:/lib nfs ULTS ults, intr 0 1
None/proc defaults, intr 0 1
  
At the same time, you also need to modify the network configuration file for each blade, configure the IP address, and start two NICs ..
  
7) compile the kernel
  
The Kernel for the blade should support the DHCP protocol of Kernel Level Auto Configuration, NFS and nfs root,
  
Assume that the compiled kernel is vmlinuz, and copy it to the/tftpboot/directory.
  
Reference:
Http://syslinux.zytor.com/pxe.php
Http://syslinux.zytor.com/faq.php
Http://www.cn-cio.org/xx/show.php? Article _id = 1680
Http://www-900.ibm.com/developerWorks/cn/linux/l-tip-prompt/l-pex/index.shtml
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.