A little experience in Linux diskless workstation architecture

Source: Internet
Author: User
Article title: a little experience in Linux diskless workstation architecture. 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.
In fact, diskless linux is not very difficult, but there are not many people doing it.
Here I will introduce my implementation methods:
Implementation System (RedHat 8.0 + DHCPD + TFTP)
SYSLINUX = http://freshmeat.net/redir/syslinux/10177/url_tgz/syslinux-2.09.tar.gz
  
In fact, this has little to do with the system
  
To install the server, the server must support the dhcpd (or PXE), tftpd, and nfs services. here, we must use them in combination with syslinux.
Download syslinux and copy pxelinux.0 to/tftpboot/. pxelinux.0 is the startup file. obtain the NIC (MAC) of the diskless workstation)
Specify the IP address in dhcpd. conf;
Example of a dhcpd file:
####################################
Deny unknown-clients;
Option subnet-mask 255.0.0.0;
Option broadcast-address 130.20.255;
Option domain-name "";
Option routers 129.0.0.254;
Ddns-update-style none;
  
Subnet 129.0.0.0 netmask 255.0.0.0 {
Group {
Host node1 {
Hardware ethernet 00: 30: 48: 29: cb: 96;
Fixed-address 129.0.0.1;
Filename "pxelinux.0 ";
Option routers 129.0.0.254;
Option domain-name "YY ";
}
}
}
#######################################
  
Create a pxelinux. cfg Directory. when started, the server will find the corresponding diskless workstation configuration in this directory. the file name rules are the hexadecimal output of the IP address, such as 10: 10: 10: 10. if the file name is 0a0a0a0a, the system will find 0a0a0a00-> 0a0a0000-> 0a000000-> default cannot be found.
Format of this file:
########################
DEFAULT linux
PROMPT 0
LABEL linux
KERNEL vmlinuz
Append ip = dhcp root =/dev/nd01 nfsroot = 129.0.0.254:/tftpboot/node vga = normal
##########################
You can change it by yourself. this file specifies the file system of the server for 129.0.0.254 diskless workstation. under/tftpboot/node, the shell program for creating the diskless file system is written by me.
#############################
#! /Bin/sh
Mkdir = 'which mkdir'
Cp = 'which cp'
Mknod = 'which mknod'
Chmod = 'which chmod'
Rm = 'which rm'
Chattr = 'which chattr'
  
  
Mkdir/tftpboot/$1
Cd/tftpboot/$1
Echo-n "Copy directory bin ..."
Cp-a/bin.
Echo "OK"
Echo-n "Copy directory dev ..."
Cp-a/dev.
Echo "OK"
Echo-n "Make a node nd0 ..."
Mknod dev/nd0 B 43 0
Chmod 600 dev/nd0
Echo "OK"
Echo-n "Copy directory etc ..."
Cp-a/etc.
Echo "OK"
Echo-n "create directory home ..."
Mkdir home
Echo "OK"
Echo-n "Copy directory lib ..."
Cp-a/lib.
Echo "OK"
Echo-n "clean modules of directory lib ..."
Rm-rf lib/modules
Echo "OK"
Echo-n "create directory root ..."
Mkdir root
Echo "OK"
Echo-n "copy directory sbin ..."
Cp-a/sbin.
Echo "OK"
# Echo-n "link directory usr ..."
# Ln-s/usr
# Echo "OK"
Echo-n "create directory var ..."
Mkdir var
Cd var
Echo "Entering directory var"
Echo-n "copy lib"
Cp-a/var/lib.
Echo-n "cache"
Cp-a/var/cache.
Echo-n "log"
Cp-a/var/log.
Echo-n "tmp"
Cp-a/var/tmp.
Echo-n "spool"
Cp-a/var/spool.
Echo-n "yp"
Cp-a/var/yp.
Cd ../
Echo-n "leaving directory var"
Echo "OK"
Echo-n "create directory proc usr tmp ..."
Mkdir proc usr tmp
Echo "OK"
Echo-n "change attribute of tmp ..."
Chmod 777 tmp
Echo "OK"
Echo-n "create file fastboot and add + I attribute ..."
Touch fastboot
Chattr + I fastboot
Echo "OK"
#######################
# Change fstab ##########
Edit/tftpboot/node/etc/fstab
Add nodeserver:/tftpboot/node/nfs rw 0 0
Modify/etc/exports
Add/tftpboot/node node1 (rw, async, no_root_squash)
Start nfs
If you want to modify it, you can delete it as needed.
  
In this way, the service system is done, and the next step is to compile the diskless workstation kernel.
Download a kernel source file, or find one in the installation disk. after installation, go to/usr/src/SPRMS/to view the kernel source code, make menuconfig, at this time, you can consider the need for diskless workstation to reduce some hardware support, but you must select nfsroot.
I have found other installation methods. it is not recommended to load modules, but you have to load it. it seems that there is no problem, and many functions can be added. however, it takes a lot of resources, depending on your point of view. next, copy the compiled kernel file bzImage to/tftpboot/and change it to vmlinuz or you can use/tftpboot/pxelinux. modify the name of the kernel + kernel file in cfg/xxxxxxxx.
  
In this way, the system of a diskless workstation is basically no problem, and the diskless station chooses to start the network,

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.