Setup and implementation of diskless workstation in Linux

Source: Internet
Author: User
Article Title: how to set up and implement a diskless workstation in Linux. 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.
How to work as a diskless workstation
  
Recently, some netizens asked me how to create a diskless workstation. I just finished the work and posted some experiences for your reference. The system used is rh6.1.
  
The client and server are required for the diskless workstation.
  
Diskless workstation client
  
The main task of this part is to create an EPROM startup file, and include a tool for processing linux kernel mknbi-linux. Two packages are available. etherboot, netboot, and etherboot have requirements on the NIC model. the supported Nic types are not small but not all, but are basically supported by the most common NICs, for example, 3c503/507/509/905b, NE1000/2000/PCIne2000, and Intel eepro. Netboot can use ndis or pktdrv, which are generally available on the drive disk with a card, so any card can be used. However, this is only limited to network boot, but is not supported after the Linux kernel is started. Therefore, the requirement for NICS is that they can be identified by Linux.
  
The following applies to etherboot;
  
Expand etherboot, enter the src-32, and edit Config. There are many options for you to do multiple startup, display information, ask for a password and so on, but the only thing you need is to replace dhcp with bootp, that is, define-DNO_DHCP_SUPPORT in Config. Because bootp is intended to be used on the server side, this is required. Otherwise, the dhcp server cannot be found during startup. If you want to use dhcp on the server side, this step is not required.
Make. Two files,. rom and. lzrom, are generated for each network adapter, which are compressed.
It is okay to use a floppy disk to start the boot ROM. assume that your Nic is ne2000 compatible: cat ../src/floppyload. bin ne. lzrom>/dev/fd0
  
  
Start with a floppy disk. you should be able to detect your Nic and send a bootp request. If everything is okay, you can burn the ROM file into the EPROM.
  
Cd ../netboot *; make install. If an error occurs in make, the solution is to rename the bcc in the system, connect gcc to bcc, and re-make. Finally, a program mknbi-linux will be added to the system to process the linux kernel. its usage will be described in the server-side settings section.
The client is finished.
  
Server:
  
Assume that your diskless workstation ip address is 10.0.0.1; the machine name is dc1.subnet.net; the other diskless workstation ip address is 10.0.0.2; the machine name is dc2.subnet.net; the server ip address is 10.0.0.254 and server.subnet.net.
  
Modify/etc/hosts and add dc1.subnet.net and dc2.subnet.net.
Get the bootp-2.x.x, pay attention to the various patches with after expansion. Then make; make install
Create/etc/bootptab, like this
Global. prof:
: Sm = 255.255.255.0:
: Bf =/tftpboot/vmlinuz. nb:
  
Dc1: tc = global. prof: ha = 109c0863d7a: ip = 10.0.0.1:
Dc2: tc = global. prof: ha = 0800110244e1: ip = 10.0.0.2:
  
  
  
Ha uses the MAC address of the diskless workstation Nic instead.
  
Modify inetd. conf, remove the # Numbers of bootpd and tftpd, and like this
Tftp dgram udp wait root/usr/sbin/tcpd tftpd? S/tftpboot
Bootps dgram udp wait root/usr/sbin/tcpd bootpd-I
Kill? HUP 'cat/var/run/inetd. pif'
  
  
Create/tftpboot/10.0.0.1, cd/tftpboot/10.0.0.1, (cd/; tar cpf? Lib sbin bin var etc dev) | tar xpf?
Mkdir usr; mkdir tmp; chmod 1777 tmp;
Mkdir home; mkdir root; mkdir proc; mkdir mnt
  
  
  
Touch fastboot; chattr + I fastboot
(The last item of/and/usr in fstab is set to 0. This step may not be required, but I have never tried it)
  
The following is a shell script that can be used to automatically perform the preceding operations.
  
  
#! /Bin/sh
If [$ #! = 1]
Then
Echo Usage: $0 client-IP-addr
Exit 1
Fi
  
Cd/
  
Umask 022
  
Mkdir-p/tftpboot/$1
  
# Just make these ones
For d in home mnt proc tmp usr
Do
Mkdir/tftpboot/$1/$ d
Done
  
Chmod 1777/tftpboot/$1/tmp
  
Touch/tftpboot/$1/fastboot
Chattr + I/tftpboot/$1/fastboot
  
# Copy these ones
(Cd/; tar cpf-bin lib sbin dev etc var) |
(Cd/tftpboot/$1; tar xpf -)
  
  
  
Delete unnecessary things in var to reduce space. Delete all unnecessary modules under lib/modules.
Modify etc/sysconfig/network, etc/sysconfig/network-scripts/ifcfg-eth0, etc/fstab, etc/conf. module
Fstab indicates that the root is on the server, like this
  
  
Server:/tftpboot/10.0.0.1/nfs default 0 0
Server:/usr nfs default 0 0
  
  
  
Configure etc/rc. d/rc3.d to disable all unnecessary network services.
Delete etc/rc. d/rc6.d/K ?? Network.
Modify etc/rc. d/rc. sysinit and find "mount? A? T nonfs, smbfs... "Changed to" mount .? A? T nosmbfs... "
  
  
Mkdir/tftpboot/10.0.0.2; cd/tftpboot/10.0.0.2; (cd ../10.0.0.1; tar cpf -*)
| Tar xpf?
  
  
Modify etc/sysconfig/network, etc/sysconfig/network-scripts/ifcfg-eth0, etc/fstab, etc/conf. module
  
  
Cd/etc; vi exports;/usr dc * .subnet.net (ro)
/Tftpboot/10.0.0.1 dc1.subnet.net (rw, no_root_squash)
/Tftpboot/10.0.0.2 dc2.subnet.net (rw, no_root_squash)
  
  
Exportfs? A
  
  
To compile a new kernel, you must include the following features:
NFS filesystem support
Root on NFS support
Bootp support
Supported Nic models for diskless workstation
  
After the new kernel is compiled, use mknbi-linux for processing,
  
Mknbi-linux bzImage vmlinuz. nb
  
  
Put vmlinuz. nb under/tftpboot.
  
The work on the server is complete.
  
Note:
  
If you want to use dhcp on the server, you need to configure it yourself. For more information, see the dhcp document.
Rh6.1 comes with a bootparamd, which should also be able to do the same job, but manual does not know how to set it.
It is recommended that the server/and/usr be partitioned separately.
In the etherboot document, it is said that some NICs, such as PCI NE2000 compatible NICs, may need to adjust the vendor information and ID information in the Makefile. I have not tried it.
Start your diskless workstation. if everything is correct, it should be smooth. If some failed occurs during startup, you can set it on the diskless workstation after it is started.
  
  
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.