Implementation of remote diskless workstation startup

Source: Internet
Author: User
Article title: Implementation of remote diskless workstation startup. 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.
Hypothesis:
One Linux Server with Turbolinux 4.0 IP: 192.168.1.11 Domain: server Hostname: linux
First diskless workstation IP: 192.168.1.5 hostname: client5
Second diskless workstation IP: 192.168.1.6 hostname: client6
Condition:
Linux Server starts DNS, DHCP, NFS, tftp, bootp service, modifies/etc/inetd. conf, and removes the comments before tftp and bootps. For more information about DNS and DHCP configuration, see related articles.
A NE2000 compatible Nic.
Purpose:
Implement remote diskless boot (note: This article only uses a floppy disk to simulate BootpROM. if you have actual BootpROM startup experience, please share with us ).
The principles of remote startup are not described here. you can refer to the relevant documents.
Server configuration:
1. go to the src directory of Turbolinux 4.0, make menuconfig, and add support for bootp and nfs network startup. make dep, make zImage, make modules, and make modules_install.
2. create the tftpboot directory under/, and create two subdirectories, 192.168.1.5 and 192.168.1.6, under the tftpboot directory.
3. enter 192.168.1.5 to create directories such as bin, etc, lib, mnt, root, tmp, var, dev, home, misc, net, proc, sbin, and usr.
Mknod/dev/nfsroot B 0 255
Cp-a/bin/*/tftpboot/192.168.1.5/bin
Cp-a/sbin/*/tftpboot/192.168.1.5/sbin
Cp-a/etc/*/tftpboot/192.168.1.5/etc
Cp-a/lib/*/tftpboot/192.168.1.5/lib
Cp-a/dev/*/tftpboot/192.168.1.5/dev
Cp-a/var/*/tftpboot/192.168.1.5/var
Chmod a + w/tftpboot/192.168.1.5/tmp to allow the client to write temporary data.
4. modify/etc/exports and add the directory that can be mounted by the remote client.
My/etc/exports below:
/Home/golden 192.168.1.5 (rw, no_root_squash)
/Home/john 192.168.1.6 (rw, no_root_squash)
/Tftpboot/192.168.1.5 192.168.1.5 (rw, no_root_squash)
/Tftpboot/192.168.1.6 192.168.1.6 (rw, no_root_squash)
/Home/public 192.168.1. * (rw, no_root_squash)
/Usr 192.168.1. * (ro, no_root_squash)
So far, the server configuration has been completed.
Client configuration:
1. go to the/tftpboot/192.168.1.5/etc directory and create a new fstab to mount the mount directory authorized in the/etc/exports file on the server.
My/tftpboot/192.168.1.5/etc/fstab below:
192.168.1.11:/tftpboot/192.168.1.5/nfs defaults 0 0
None/proc defaults 0 0
192.168.1.11:/usr nfs ULTS 0 0
192.168.1.11:/home/public nfs defaults 0 0
192.168.1.11:/home/golden nfs defaults 0 0
Note:/home/pulic is a self-built shared directory, and/home/golden is the user's golden directory.
2. modify the/tftpboot/192.168.1.5/etc/sysconfig/network file as follows:
NETWORKING = yes
FORWARD_IP4 = no
HOSTNAME = client5.server
DOMAINNAME = server
GATEWAY = 192.168.1.11
GATEWAYDEV = eth0
3. modify the/tftpboot/192.168.1.5/etc/sysconfig/network-scripts/ifcfg-eth0 file:
DEVICE = eth0
IPADDR = 192.168.1.5
NETMASK = 255.255.255.0
NETWORK = 192.168.1.0
BROADCAST = 192.168.1.255
ONBOOT = yes
BOOTPROTO = none
4. take out the installation CD of turbolinux 4.0 and find the boot. imgfile in the images directory. Run in linux
Dd if = boot. img of =/dev/fd0 bs = 1440 k
5. modify the created floppy disk. We do not need to install linux, so you can delete initrd. img.
Copy the newly compiled kernel cp to a floppy disk and overwrite vminuz with the same name.
Boot. msg is the displayed text information and can be modified by myself (I can have my own linux version, haha ...).
6. the important part is the syslinux. cfg file. we need to modify it to start it with our new kernel and automatically mount the shared directory authorized to mount in the linux server.
My syslinux. cfg below:
Display boot. msg
Default normal
Timeout 60
Label normal
Kernel vmlinuz
Append root =/dev/nfsroot = 192.168.1.11:/tftpboot/192.168.1.5, tcp vga = normal
5. OK, so you can use this floppy disk on the client to start linux on the server.
Note: You can also have other configuration schemes, such as permission control, multiple workstations share the same configuration, and workstations automatically obtain dynamic IP addresses.
This article only briefly introduces the application of the linux nfs file system. if you have a better solution, please share it with you.
I will continue to maintain this article. Next is about real Diskless Linux with BootpROM.
John shang
2000100005.01 PM
Maybe I am so lucky. after an afternoon's experiment, I have already completed the technology of starting linux without a disk. I will share it with you here.
Condition:
A NE2000 compatible Nic (preferably ISA) and an etherboot software package that provides Rom remote start. You can obtain
Http://www.slug.org.au/etherboot
Server configuration:
1. in addition to the configurations described in the previous article, release the downloaded etherboot software package.
My configuration below:
Tar zxvf etherboot.gar.gz -- prefix/usr/local
Cd/usr/local/etherboot/src, run "make ".
Cd/usr/local/etherboot/netboot-0.8.1, run "./configure" and "make ".
2. run the compiled kernel cp to/usr/local/etherboot/src and run the following command to generate the kernel image file for remote boot Rom.
Mknbi-x-k zImage-o/tftpboot/vmlinuz. xterm
Set vmlinuz. xterm to all readable.
3. to test whether it is successful, we can use the software provided by etherboot to generate a Floppy simulation ROM, that is, we can place the ROM on a Floppy disk, just like starting it with BootProm. (This is the same as Rom)
Run the following command to write the Rom simulation file to a floppy disk.
Cd/usr/local/etherboot/src
Cat floppyload. bin. pre./bin32/ne. lzrom>/dev/fd0
Replace ne. lzrom.
4. in this way, the disk can be started.
The client configuration is the same as described in the previous article.
Note:
1. we recommend that you specify an IP address for the Eni based on its ID.
2. different from the previous article, you can use the host name to replace the IP name, that is,/tftpboot/192.168.1.5 ---> golden
3. if you start with this floppy disk, after you find the NIC, it is always probing..., most of which are your Nic's poor support.
4. For more detailed FAQs, find them in the etherboot doc directory.
5. The following is my dhcpd. conf file.
Subnet 192.168.1.0 netmask 255.255.255.0 {
Filename "/tftpboot/vmlinuz. xterm ";
Range dynamic-bootp 192.168.1.5 192.168.1.6;
Option subnet-mask limit 255.0;
Option broadcast-address 192.168.1.255;
Option routers 192.168.1.11;
Option domain-name "server ";
Option domain-name-servers 192.168.1.11;
}
Host golden {
Hardware ethernet 52: 54: AB: 1b: 94: 6b;
Fixed-address 192.168.1.5;
Option host-name "golden ";
Filename "/tftpboot/vmlinuz. xterm ";
}
  
  
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.