Linux diskless workstation practices

Source: Internet
Author: User


I. Remote Start Principle

Before the client is started, there is neither an operating system nor a boot floppy disk or hard disk. It only has the basic components of the computer, such as CPU, memory, and motherboard. But the most important thing is to have the nic and bootrom started. The client can only obtain the operating system through the network. The diskless remote start technology in Linux is different from that in Novell and WinNT. Instead of using RPL (Remote initial program loader), it is based on standard Bootp/DHCP and TFTP protocols, create a file system through the NFS file system. Compared with the first two methods, this method is more universal and adaptive. You can remotely start dos, Win95, WINNT, and Linux customers based on Linux.

Due to a bug in your network adapter (3c905b-tpo100, it was not corrected according to etherboot instructions. Now we use a floppy disk to replace the EPROM of the Network Adapter. For more information, go to http://sourceforge.net/download the source code.

The following briefly introduces the Linux Startup principle:
1. After the client PC is started, perform a self-test before TCP/IP bootrom obtains control.
2. bootprom sends out the Bootp/DHCP request and obtains the IP address.
3. if the server receives a request from a PC, it will return the Bootp/DHCP response, including the Client IP address, preset gateway and boot image file. otherwise, the server ignores this requirement.
4. bootprom uses the TFTP communication protocol to download the boot image file from the server.
5. Use this boot image file to boot a PC. The boot file can be either a simple boot program or an operating system.
6. The Boot Image File will contain the kernel loader and the compressed kernel, which will support the NFS root system.
7. The remote client starts the Machine Based on the downloaded file.

Everything is OK !!! Easy! Easy to use! The following describes how to create a Linux Remote Start.

Ii. Remotely start an instance
The following is an example:
Linux Server: Server (IP: 192.168.0.254)
First client: pc01 (IP: 192.168.0.1)
The second client: PC02 (IP: 192.168.0.2)
All remote start customer directories:/client
The first remote start Client Directory:/client/pc01
The second remote start Client Directory:/client/PC02
Support RSH

First, recompile the Linux kernel.
Make menuconfig
Note the network support, NFS-root support, and BOOTP (DHCP) support must be included.
Make clean
Make Dep
Make bzimage
Make modules
Make modules_install
After the preceding command, you will find that the image file started by the client is in the/usr/src/Linux/i386/boot directory. After the new kernel is compiled, use mknbi-Linux (mknbi-Linux bzimage vmlinuz. NB) processing, the vmlinuz. place NB Under/tftpboot.
Run the following command: mknod/dev/nfsroot B 0 255 to modify the Startup Device and point it to nfsroot.

The following describes how to modify the server for a remote client to create a file system for the remote client.

Add the following to server/etc/exports:
/Client/pc01 192.168.0.1 (RW, no_root_squash)
/Client/PC02 192.168.0.2 (RW, no_root_squash)
/Home 192.168.0.1/255.255.255.0 (RW, no_root_squash)

Use DHCP to add remote Customer Support in/etc/DHCPD. conf. The server address is 192.168.0.254:
# DHCPD. conf

# Global Options
Option domain-name "server.ustc.edu.cn ";
Option domain-name-servers 202.38.64.1;

# Intranet
Subnet 192.168.0.0 netmask 255.255.255.0 {
Range 192.168.0.1 192.168.0.250;
Default-lease-time-1;

# Option root-path "/client/pc01 ";
Option DHCP-server-identifier 192.168.0.254;
Option broadcast-address 192.168.0.255;
# Option routers 198.168.0.254;

Server-name "server ";
Next-server 192.168.0.254;
Filename "/boot/vmlinuz ";
Host pc01 {
Option root-path "/client/pc01 ";
Hardware Ethernet 00: 01: 02: 96: 65: 92;
Fixed-address 192.168.0.1;
}
Host PC02 {
Option root-path "/client/PC02 ";
Hardware Ethernet 00: 01: 02: 98: 92: 55;
Fixed-address 192.168.0.2;
}
}
Subnet 202.38.64.0 netmask 255.255.255.0 {
}
See DHCP-howto

Create a remote client directory on the server:
/Client
/Client/pc01
/Client/PC02

Next, let's talk about pc01 practices.

The pc01 directory contains the bin, Dev, etc, home, Lib, MNT, Proc, root, sbin, TMP, USR, and VAR directories.
We copied bin, Dev, etc, Lib, sbin, USR, VAR directly and completely. Home, MNT, Proc, root, and TMP are newly created empty directories, (at that time, we re-installed a Linux system that supports as small as possible and as clean as possible, including DHCP, NFS, and RSH, and then completely copied them, in this way, there must be a lot of unnecessary things that can be deleted, but now the level is not taken, according to the reference documents failed, so I had to use this method to save time :(, and then delete unnecessary files)
Note that you must modify the/client/pc01/etc/rc. d Startup File: Change Mount-AVT nonfs to mount-Av. NFS root file system is allowed. (Our file is Debian Woody. This file is changed to/client/pc01/etc/init. d/mountall. Sh, and our file is Mount-a-t noproc, nosmbfs)

Modify the/client/pc01/etc/fstab file in the following format:
192.168.0.254:/client/pc01/nfs ults, RW 0 0
192.168.0.254:/home nfs rw, BG 0 0
Proc/proc defaults 0 0

Modify client/pc01/etc/hostname:
Pc01

Modify client/pc01/etc/hosts:
127.0.0.1 localhost
192.168.0.254 pc00
192.168.0.1 pc01
192.168.0.2 PC02

Modify client/pc01/etc/hosts. equiv:
+
Server
Pc01
PC02

Modify client/pc01/etc/mtab:
192.168.0.254:/client/pc01/nfs RW 0 0
Proc/proc RW 0 0
Devpts/dev/PTS devpts RW, gid = 5, mode = 620 0 0
192.168.0.254:/home nfs rw, BG, ADDR = 192.168.0.254 0 0

Modify client/pc01/etc/Network/interfaces
Face eth0 Inet static
Address 192.168.0.1
Netmask 255.255.255.0
Network 192.168.0.0
Broadcast 192.168.0.255
Gateway 192.168.0.254

Next, you must establish a chain to link the IP address of the remote client to the/client/pc01 directory.
$: Ln-s pc01 192.168.0.1

For PC02, copy pc01 and modify the preceding files.

Set RSH support in the personal directory below:
Home/username/. rhosts

192.168.0.254 Username
192.168.0.1 Username
192.168.0.2 Username

Check whether NFSD, tftpd, and bootpd daemons are enabled on the server.
Everything is done! Linux is available in about 10 seconds after remote start.
For NFS, TFTP, and BOOTP (DHCP) settings, see how-.

in a bit of experience, it is best to put all the client files in an independent partition so that you can install a basic system (just like a normal installation) in the partition ). then it serves as the basis for modification (Debian is recommended, which is easier to crop ). if you need to install software on the client in the future, you can do this:
chroot/client/pc01
dselect or apt-Get

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.