How to install Linux
content:
Introduction Basic Principle Steps Conclusion Reference Information About the author
In the Linux area:
Tutorial Tools & Product Codes & Component Articles
Tangk73@hotmail.com) December 2002. Introduction Under normal circumstances, we all use the floppy drive or optical drive to guide Linux, and then install Linux through the local optical drive. However, this installation method cannot be applied in several cases:
No software drives and optical drive: Many companies are generally without cost-drive or floppy drives, which cannot be installed locally; non-standard floppy drives and optical drives: Although notebooks will configure optical drives, but not necessarily a standard IDE The device is somewhat through the USB interface, and some are through the 1394 interface (such as the Q10 of Samsung). The Linux kernel booted during the Linux installation generally does not take the driver of these interfaces, so it is impossible to install Linux locally; in addition, in some occasions, such as machine rooms, a large number of computers need to install Linux at the same time, if they pass through the CD-ROM One way is installed, not only low efficiency, but also is not conducive to maintenance. The author encountered the second case during the work. A Samsung Q10 notebook needs to install Redhat Linux 8.0, but after the optical drive is guided, the installer cannot access the disc. In response to this problem, the author passes the information and exploits to find the method of installing Linux on Q10. In the discussion below, if you don't make a special statement, you will use Q10 as an example, show how to remotely install Linux via PXE Bootrom. 2. Basic Principle 1) What is the PXE PXE (pre-boot Execution Environment) is a protocol designed by Intel, which allows the computer to start over the network. The protocol is divided into both ports of Client and Server. In the ROM of the NIC, when the computer boots, the BIOS tested the PXE Client into the memory execution, and displays the command menu. After the user is selected, the PXE Client will be placed at the far end. The operating system is downloaded locally through the network. The successful operation of the PXE protocol needs to solve the following two questions:
Since it is transmitted over the network, then the computer is started, and its IP address is configured; through what protocol Download the Linux kernel and root file system For the first question, you can solve the DHCP Server, give a PXE Client by DHCP Server Assign an IP address, DHCP Server is a protocol for dynamically assigning IP addresses to DHCP Client, but since it is assigned an IP address to the PXE Client, it is necessary to increase the corresponding PXE unique configuration when configuring DHCP Server. As for the second problem, TFTP Client already exists in the ROM where the PXE Client is located. The PXE Client uses the TFTP Client to download the required files on the TFTP protocol to TFTP Server. In this way, the conditions of the PXE protocol have been there, let's take a look at the working process of the PXE protocol. 2) Working process
In the above figure, the PXE Client is a computer that needs to install Linux, TFTP Server and DHCP Server are running on another Linux Server. Bootstrap files, configuration files, Linux kernels, and Linux root file systems are placed under the root directory of the TFTP server on Linux Server. PXE Client requires three binary files: Bootstrap, Linux kernel and Linux root file system. The bootstrap file is an executable, providing users with a simple control interface and download the appropriate Linux kernel as well as the LINUX root file system based on the user's choice. 3. Step With the previous background knowledge, you can officially operate, follow the steps: 1) Configure the DHCP Server to select the ISC DHCP-3.0, DHCP Server configuration file is /etc/dhcpd.conf, configuration The contents of the file are as follows: Option Space PXE;
Option pxe.mtftp-ip code 1 = ip-address;
Option pxe.mtftp-cport code 2 = unsigned inter 16;
Option pxe.mtftp-sport code 3 = unsigned integer 16;
Option pxe.mtftp-tmout code 4 = unsigned integer 8;
Option PXE.mtftp-delay code 5 = unsigned integer 8;
Option PXE.Discovery-Control Code 6 = unsigned integer 8;
Option PXE.Discovery-mcast-addr code 7 = IP-address;
Class "PXEClients" {
Match if Substring (Option Vendor-Class-Identifier, 0, 9) = "PXECLIENT";
Option vendor-class-identifier "pxeclient";
Vendor-option-space PXE;
# At Least One of The Vendor-Specific PXE Options Must Be Set in
# otder for the client boot roms to realize That We Are A PXE-Compliant
# Server. We set the mcast ip address to 0.0.0.0 to tell the boot rom
# That We can't Provide Multicast TFTP (Address 0.0.0.0 Means NO
# Address.
Option pxe.mtftp-ip 0.0.0.0;
# This is the name of the file the boot roms shouth.
FileName "Pxelinux.0";
. # This is the name of the server.
Next-Server 192.168.0.1;
}
DDNS-UPDATE-STYLE INTERIM;
Ignore client-updates;
DEFAULT-Lease-Time 1200;
Max-Lease-Time 9200; Option Subnet-Mask 255.255.255.0;
Option Broadcast-Address 192.168.0.255;
Option Routers 192.168.0.254;
Option Domain-Name-Servers 192.168.0.1, 192.168.0.2;
Option Domain-name "mydomain.org";
Subnet 192.168.0.0 Netmask 255.255.255.0 {
Range 192.168.0.10 192.168.0.100;
}
Host Q10 {
Hardware Ethernet 00: 00: F0: 6B: 38: 5B;
Fixed-Address 192.168.0.22;
}
Several key parts in the dhcpd.conf configuration file illustrate the following: Host Q10 {...} Defines the corresponding relationship between the MAC address of the notebook Q10 network card and the IP address, indicating that DHCP Server assigns a fixed IP: 192.168.0.22; filename "for Q10. "Specify the file name of the bootstrap; Netx-Server specifies the address of the TFTP Server. Other configurations Please read by the manual of DHCP Server. 2) Configuring TFTP Server Use TFTP-HPA, TFTP Server's configuration file is /etc/xinetd.d/TFTP, the contents of the configuration file are as follows:
Service TFTP
{
Socket_type = DGRAM
Protocol = UDP
Wait = yes
User = root
Server = /usr/sbin/in.tftpd
Server_args = -u nobody -s / tftpboot
Disable = no
PER_SOURCE = 11
CPS = 100 2
}
The root directory location of / tftpboot is the TFTP Server is developed here. 3) Configure the bootstrap bootstrap file to be specified as a pxelinux.0 file in dhcpd.conf, place in / tftpboot. The Linux kernel and the Linux root file system are also placed in / tftpboot. Pxelinux.0 In the execution process, read the configuration file, all profiles are placed in /TftpBoot/pxelinux.cfg/ directory. Since PXELinux provides different Linux kernels for different PXE Clients and root file systems, you have to distinguish between different PXE Client's needs through different configuration file names. For example, a PXE Client is assigned by DHCP Server as 192.168.0.22, then the corresponding configuration file is /TFTPBOOT/PXELINUX.CFG/C0A80016 (Note: C0A80016 is a hexadecimal representation of IP address 192.168.0.22). If you can't find it, you will follow the order C0A80016-> C0A8001-> C0A800-> C0A80-> C0A8-> C0A-> C0-> C-> DEFAULT lookup configuration file. /Tftpboot/pxelinux.cft/C0A80001 specific content profile as follows: DEFAULT installPROMPT 1LABEL installKERNEL vmlinuzAPPEND initrd = initrd.img devfs = nomount ramdisk_size = 16384 in this configuration file specifies the name of the Linux kernel and the root file system, and passed to the kernel Some parameters, where the ramdisk_size parameter should note that it specifies the size of the RAMDisk after the Linux kernel is started. If the setting is too small, Linux installation procedure may not be possible. 4) Making the Linux kernel / root file system Because of the need to install over the network, all SendHat Linux 8.0 installation disks (DISK # 1) E: /IMAGES / BOOTNET.IMG (the drive letter of the CD drive is E :). BootNet.img includes Linux kernels, Linux root file systems (including installer). Make a boot floppy disk with bootnet.img, and the method runs E: / DOSUTILS / RAWRITE E: /IMAGES / BOOTNET.IMG in the DOS command line, making it based on the prompt. After the production is completed, the VMLinuz (Linux kernel) and the initrd.img (Linux root file system) in the floppy disk are guided to the Linux Server / TFTPBOOT. 5) Start DHCP Server / TFTP Server on Linux Server, run Service DHCPD Start and Service Xinetd Restart. 6) When the Q10 Q10 is activated, when the Samsung logo appears, the user will prompt the user to press F12 to enter the network boot. After f12, Q10 enters the network boot process. First get the IP address through DHCP Server, then download and execute the bootstrap file PXELINUX.0; in execution, read the configuration file /TFTPBOOT/PXELINUXUX.CFG/C0A80016.
At this time, boot appears on the screen:, type INSTALL, enters the network installation interface of Redhat Linux 8.0, everything OK! 4. Although the above discussion is for Samsung Q10 notebooks, the working principle and installation method are also applicable to other types of computers, but to remember that there must be bootrom - pxe client in the computer's network card. At the same time, the PXE protocol can also be used as a diskless Linux technology to guide the laywalk Linux. In fact, as long as you need, in the append option of the PXELinux configuration file, you can pass the location parameters of the file system that requires MOUNT file system. Reference PXELINUX, http: //syslinux.zytor.com/pxe.php net booting with dhcp, pxe-linux and tftp, http: //logout.sh/computers/linux/neetboot/ different Kinds of PXE, http: / /clic.mandrakesoft.com/documentation/pxe/ch02.html About the author Tang Kai, you can contact him through the mailmail.com tangk73@hotmail.com.