[by Nugraha and Saito, 2009.05.09]
Current status: Not finished yet. We suceeded dhcp and tftp initial files.
Current problem: Error Kernel panic: not found /init during starting linux
Current known problem: The original unix is 64bit but diskless machine is 32bit?
We want to make a diskless computing system so that we need a PXE Server. PXE stands for "Pre-boot eXecution Environment". PXE is a special extension of services provided by the Dynamic Host Configuration Protocol (DHCP). It uses a Trivial File Transfer Protocol (TFTP) server to provide minimal boot to a network client. Let's try to configure it!
ssh username@192.168.1.10
nugraha@rsaito-necPC:~$it means that we can access the server from the client.
172.17.4.178:# yum install busybox-anaconda
# yum install dhcp # yum install syslinux # yum install tftp-server # yum install nfs-utils # yum install system-config-netboot
# rpm -qa | grep syslinux syslinux-2.2.2.2.2
# default: off # description: The tftp server serves files using the trivial file transfer \ # protocol. The tftp protocol is often used to boot diskless \ # workstations, download configuration files to network-aware printers, \ # and to start the installation process for some operating systems. service tftp { disable = no socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot per_source = 11 cps = 100 2 flags = IPv4 }
# service xinetd restart
# mkdir /tftpboot/f9 # mkdir /tftpboot/f9/root # mkdir /tftpboot/f9/snapshot
# rsync -v -a -e ssh \ --exclude='/proc/*' --exclude='/sys/*' --exclude='/dev/*'\ --exclude='/media/*' --exclude='/tmp/*' --exclude='/misc/*'\ 172.17.4.178:/ /tftpboot/f9/root
# cd /tftpboot # chcon -R -t type .
# ls -Z .
allow booting; allow bootp; ddns-update-style interim; ignore client-updates; subnet 192.168.1.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; range dynamic-bootp 192.168.1.100 192.168.1.240; next-server 192.168.1.10; } class "pxeclients" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.168.1.10; filename "/linux-install/pxelinux.0"; }
# /sbin/service dhcpd restart # chkconfig dhcpd on (the last line is for activating dhcp on booting process)
% putty username@192.168.1.10
% ipconfig -a
In this case 00-21-70-c9-eb-60 (Dell PC).
[root@rsaito-necPC rsaito]# cat /etc/exports /tftpboot/f9/root 192.168.1.0/255.255.255.0(ro,sync,no_root_squash) /tftpboot/f9/snapshot 192.168.1.0/255.255.255.0(rw,sync,no_root_squash)
# service nfs restart [root@rsaito-necPC etc]# cd /etc/rc5.d/ [root@rsaito-necPC rc5.d]# ./S60nfs restart Shutting down NFS mountd: [ OK ] Shutting down NFS daemon: [ OK ] Shutting down NFS quotas: [ OK ] Shutting down NFS services: [ OK ] Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS daemon: [ OK ] Starting NFS mountd: [ OK ] [root@rsaito-necPC rc5.d]# ./S60nfs status rpc.mountd (pid 12153) is running... nfsd (pid 12150 12149 12148 12147 12146 12145 12144 12143) is running... rpc.rquotad (pid 12138) is running...
[root@rsaito-necPC rc5.d]# cd /tftpboot/f9/snapshot/ [root@rsaito-necPC snapshot]# ls -l total 12 drwxrwxr-x 8 root root 4096 2009-05-09 08:57 255 -rw-r--r-- 1 root root 1070 2008-08-26 19:09 files -rw-r--r-- 1 root root 7 2009-05-09 08:52 files.custom [root@rsaito-necPC snapshot]# cat files.custom /home/
Name f9-diskless Explanation Fedora core 9
server 192.168.1.10 directory /tftpboot/f9/root
IP address/subnet 255.255.255.0 <- we use subnet operating system f9-diskless snapshot name 255 X generate
[root@rsaito-necPC 255]# pwd /tftpboot/f9/snapshot/255 [root@rsaito-necPC 255]# ls boot etc home lib root var
# cd /tftpboot/linux-install/pxelinux.cfg # mv default default.org # ln -s FFFFFF00 01-00-21-70-c9-eb-60
default f9-diskless label f9-diskless kernel f9-diskless/vmlinuz append initrd=f9-diskless/initrd.img root=/dev/ram0 init=disklessrc NFSROOT=192.168.1.10:/tftpboot/f9 ramdisk_size=20318 ETHERNET=eth0 SNAPSHOT=255 ramdisk_blocksize=1024
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/a021pxediskless.html
http://www.devdrv.co.jp/linux/cpio-initrd-format.htm
# cp /tftpboot/linux-install/f9-diskless/initrd.img /tmp # cd /tmp # mkdir initrd.test # cd initrd.test # cp ../initrd.img . # mkdir initrd # cd initrd # zcat ../initrd.img | cpio -i -c # cd /sbin # cp /sbin/mount.nfs . # cp /sbin/umount.nfs . # cp /sbin/mount.nfs4 . # cp /sbin/umount.nfs4 . # cd .. # find . | cpio --quiet -c -o | gzip -c > ../initrd-new.img # cd /tftpboot/linux-install/F9-diskless/ # mv initrd.img initrd.img.org # cp /tmp/initrd-test/initrd-new.img ./initrd.img
When we try to find "disklessrc fedora", we found the following Web site.
http://d.hatena.ne.jp/adsaria/20080131/1201792574 http://wikiwiki.jp/disklessfun/?FrontPage
su - cd /tftpboot cp /usr/lib/syslinux/pxelinux.0 .
DEFAULT pxeboot TIMEOUT 50 LABEL pxeboot KERNEL vmlinuz APPEND initrd=initrd.img ONERROR LOCALBOOT 0
# /sbin/chkconfig tftp on
# dhcpd.conf # common place for all use-host-decl-names on; host name and the host name in config file are the same default-lease-time 600; max-lease-time 7200; # # common for a subnet, we can make a group of host by "host", too subnet 192.168.197.0 netmask 255.255.255.0 { # range 204.254.239.10 204.254.239.20;? in the case of dynamic IP address option domain-name "dc2.kek.jp"; option broadcast-address 192.168.197.255; option routers 192.168.197.1; } # #host entities The following is how to set static IP address(bootp type) host n011 { since use-host-decl-names is on, we can use the host name hardware ethernet 00:D0:B7:1B:12:ED; MAC address fixed-address 192.168.197.31; static IP address for n011 option dhcp-class-identifier "PXEClient"; needed for PXE option next-server 192.168.197.11; specify for PXE server is provided by PXE Proxy DHCP server } # vendor-encapusulated option "next-server" can specify PXE server