Setup and implementation of diskless workstation in Linux

Source: Internet
Author: User

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; 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... "Change 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-

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.

From: linuxaid

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.