Jul 4, 2005
onlsbc1, Scientific Linux CERN (SL) Release 305のインストール
--- Scientific Linux CERN3 (SLC3) のインストール
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(http://www-online.kek.jp/~inoue/para-CAMAC/
Work/SBC-Linux66.html)
高エネルギー加速器研究機構
素粒子原子核研究所
物理、オンライングループ
井上 栄二
目的
サーバ用マシン、onlpc03 にローカルにつないである SCSIハードディスク
上に、Scientific Linux CERN Release 305 をインストールした。 さらに
SBC-Linux64.htmlでの作業により、クライアント用マシン、onlsbc1 に
ローカルにつないである 2.5"IDEハードディスク上に、Scientific Linux
CERN Release 305 をインストールした。 これらのふたつのシステムを
使って、CC/NET用の Scientific Linux CERN Release 305 ディスクレス
システムを構築する。 ここで作成するシステムはサーバ側、クライアント
側ともに Scientific Linux CERN Release 305 で動作するディスクレス
システムである。
項目
(1). サーバの構築
(1-1). DHCPの設定
(1-2). Tftp の設定
(1-2-1). Tftp 動作テスト
(2). クライアント用カーネルの構築
(3). クライアント用ルートファイルシステムの構築
(3-1). ディスクレスクライアント用のファイルを置く場所を確保
(3-2). /etc/exportsファイルの設定
(3-3). /tftpboot/130.87.153.3下にファイルをコピー
(3-4). /tftpboot/130.87.153.3/etc 以下のファイルの編集
(3-4-1). /tftpboot/130.87.153.3/etc/hosts
(3-4-2). /tftpboot/130.87.153.3/etc/hosts.allow
(3-4-3). /tftpboot/130.87.153.3/etc/resolv.conf
(3-4-4). /tftpboot/130.87.153.3/etc/fstab
(3-4-5). /tftpboot/130.87.153.3/etc/sysconfig/network
(3-4-6). /tftpboot/130.87.153.3/etc/sysconfig/network-scripts/ifcfg-eth0
(3-4-7). /tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom/modules.dep
(3-4-8). /tftpboot/130.87.153.3/boot下のシンボリックリンク修正
(4). サーバの設定
(4-1). NFSサーバの設定
(5). コンパクトフラッシュ上の grubインストール
--------------------------------------------------------------------
(1). サーバの構築
クライアントマシンの onlsbc1 は FGクラスタにつないである。 ゲートウェイ
を越えたネットワークブートは複雑なので、サーバマシンには同一クラスタに
つないである onlpc03 を使用する。 このマシンは エプソン社製のパソコン
Endeavor Pro-400L である。 このマシンで実行されているOSは Scientific
Linux CERN (SL) Release 305 である。
(1-1). DHCP の設定
[onlpc03] /home/inoue > whoami
root
[onlpc03] /home/inoue > yum list installed | grep dhcp
dhcp i386 7:3.0.1-10_EL3 db
dhcp-devel i386 7:3.0.1-10_EL3 db
[onlpc03] /home/inoue >
サーバマシン onlpc03 には dhcp パッケージはインストールされている。
[onlpc03] /home/inoue > ls -l /etc/dhcpd.conf
ls: /etc/dhcpd.conf: そのようなファイルやディレクトリはありません
[onlpc03] /home/inoue >
クライアントマシンのNIC情報を確認。
[root@onlsbc1 toyo]# ifconfig -a
bash: ifconfig: command not found
[root@onlsbc1 toyo]# /sbin/ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:130.87.***.* Bcast:130.87.***.*** Mask:255.255.***.*
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:96870 errors:0 dropped:0 overruns:0 frame:0
TX packets:371 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9516421 (9.0 Mb) TX bytes:34746 (33.9 Kb)
Interrupt:11 Base address:0xec00 Memory:d5120000-d5120038
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:736 (736.0 b) TX bytes:736 (736.0 b)
[root@onlsbc1 toyo]#
サーバマシン上に /etc/dhcpd.confファイルを作成。
[onlpc03] /home/inoue > vi /etc/dhcpd.conf
# /etc/dhcpd.conf
# onlpc03: Diskless Server
ddns-update-style ad-hoc;
#default-lease-time 600;
#max-lease-time 7200;
option subnet-mask 255.255.***.*;
option broadcast-address 130.87.***.***;
option routers 130.87.***.*;
option domain-name-servers 130.87.***.*, 130.87.***.*, 130.87.***.*;
option domain-name "kek.jp";
subnet 130.87.***.0 netmask 255.255.***.0 {
range 130.87.***.* 130.87.***.*;
}
host onlsbc1 {
hardware ethernet 00:0B:AB:01:50:BA;
fixed-address 130.87.153.3;
# filename "/tftpboot/onlsbc1.boot";
}
~
~
"/etc/dhcpd.conf" [新] 20L, 531C 書込み
[onlpc03] /home/inoue >
参考:
DHCPの情報は、Internet Systems Consortium から入手できる。
リブートする。
[onlpc03] /home/inoue > reboot
Broadcast message from root (pts/1) (Thu Jun 16 15:16:35 2005):
The system is going down for reboot NOW!
:
:
ここで dhcpd をバックグランドで起動する。 さらに、システム起動時に dhcpd
を起動するように設定しておく。
[onlpc03] /home/inoue > whoami
root
[onlpc03] /home/inoue > ps -ef | grep dhcp
root 7966 7934 0 15:22 pts/0 00:00:00 grep dhcp
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/service dhcpd start
dhcpdを起動中: [ OK ]
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --list dhcpd
dhcpd 0:オフ 1:オフ 2:オフ 3:オフ 4:オフ 5:オフ 6:オフ
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --level 2345 dhcpd on
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --list dhcpd
dhcpd 0:オフ 1:オフ 2:オン 3:オン 4:オン 5:オン 6:オフ
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > ps -ef | grep dhcp
root 7975 1 0 15:22 ? 00:00:00 /usr/sbin/dhcpd
root 7983 7934 0 15:23 pts/0 00:00:00 grep dhcp
[onlpc03] /home/inoue >
ここで、クライアント側の onlsbc1 のマシンから試しに bootpリクエストを
発行してみる。
GRUB version 0.93 (640K lower / 310208K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ESC at any time exits. ]
grub> bootp
Found Intel EtherExpressPro100 82559ER at 0xec00, ROM address 0x0000
Probing...[Intel EtherExpressPro100 82559ER]Ethernet addr: 00:11:22:33:44:55
Address: 130.87.***.*
Netmask: 255.255.***.*
Server: 130.87.***.***
Gateway: 130.87.***.*
grub>
ok. bootp は正常に実行できた。
(1-2). Tftp の設定
[onlpc03] /home/inoue > yum list installed | grep tftp
tftp i386 0.39-0.EL3.1 db
tftp-server i386 0.39-0.EL3.1 db
[onlpc03] /home/inoue >
サーバマシンonlpc03 には tftp-serverパッケージはインストールされている。
/etc/xinetd.d/tftpファイルを修正する。
[onlpc03] /home/inoue > vi /etc/xinetd.d/tftp
# 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
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
# server_args = -s /tftpboot
# disable = yes
per_source = 11
cps = 100 2
flags = IPv4
}
~
~
"/etc/xinetd.d/tftp" 18L, 512C 書込み
[onlpc03] /home/inoue >
tftpd をテストする。
[onlpc03] /home/inoue > ls -lR /tftpboot
/tftpboot:
合計 8
drwxr-xr-x 3 root root 4096 6月 15 13:47 X86PC
drwxr-xr-x 4 root root 4096 6月 15 13:48 linux-install
/tftpboot/X86PC:
合計 4
drwxr-xr-x 4 root root 4096 6月 15 13:47 UNDI
/tftpboot/X86PC/UNDI:
合計 8
drwxr-xr-x 2 root root 4096 6月 15 13:47 BStrap
drwxr-xr-x 2 root root 4096 6月 15 13:47 linux-install
/tftpboot/X86PC/UNDI/BStrap:
合計 12
-rwxr-xr-x 1 root root 9256 6月 3 2004 bstrap.0
/tftpboot/X86PC/UNDI/linux-install:
合計 16
-rwxr-xr-x 1 root root 12328 6月 3 2004 linux.0
/tftpboot/linux-install:
合計 20
drwxr-xr-x 2 root root 4096 6月 15 13:48 msgs
-rw-r--r-- 1 root root 11304 6月 15 13:48 pxelinux.0
drwxr-xr-x 2 root root 4096 6月 15 13:48 pxelinux.cfg
/tftpboot/linux-install/msgs:
合計 24
-rw-r--r-- 1 root root 439 10月 27 2003 boot.msg
-rw-r--r-- 1 root root 668 10月 27 2003 expert.msg
-rw-r--r-- 1 root root 871 10月 27 2003 general.msg
-rw-r--r-- 1 root root 860 10月 27 2003 param.msg
-rw-r--r-- 1 root root 530 10月 27 2003 rescue.msg
-rw-r--r-- 1 root root 545 10月 27 2003 snake.msg
/tftpboot/linux-install/pxelinux.cfg:
合計 0
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /usr/sbin/in.tftpd -vvv -l -s /tftpboot
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > ps -ef | grep tftp
root 8108 1 0 15:54 ? 00:00:00 /usr/sbin/in.tftpd -vvv -l -s /t
ftpboot
root 8110 7934 0 15:54 pts/0 00:00:00 grep tftp
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > netstat -a | grep tftp
udp 0 0 *:tftp *:*
[onlpc03] /home/inoue >
クライアントマシンから tftpリクエストを発行してみる。
GRUB version 0.93 (640K lower / 310208K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ESC any time exits. ]
grub> bootp
Found Intel EtherExpressPro100 82559ER at 0xec00, ROM Address 0x0000
Probing...[Intel EtherExpressPro100 82559ER]Ethernet addr: **:**:**:**:**:**
Address: 130.87.*.*
Netmask: 255.255.*.*
Server: 130.87.*.*
Gateway: 130.87.*.*
grub> root (nd)
Filesystem type is tftp, using whole disk
grub>
問題は起きていないようだ。
[onlpc03] /home/inoue > ps -ef | grep tftp
root 8108 1 0 15:54 ? 00:00:00 /usr/sbin/in.tftpd -vvv -l -s /t
ftpboot
root 8125 7934 0 16:00 pts/0 00:00:00 grep tftp
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > kill -KILL 8108
[onlpc03] /home/inoue >
参考:
man tftpd
<<<--- 参照開始
SYNOPSIS
in.tftpd [options...] directory...
DESCRIPTION
tftpd is a server for the IPv4 Trivial File Transfer Protocol. The
TFTP protocol is extensively used to support remote booting of diskless
devices. The server is normally started by inetd, but can also run
standalone.
OPTIONS
-l Run the server in standalone (listen) mode, rather than run from
inetd. In listen mode, the -t option is ignored, and the -a
option can be used to specify a specific local address or port
to listen to.
-a [address][:port]
Specify a specific address and port to listen to when called
with the -l option. The default is to listen to the tftp port
specified in /etc/services on all local addresses.
-c Allow new files to be created. By default, tftpd will only
allow upload of files that already exist. Files are created
with default permissions allowing anyone to read or write them,
unless the -p or -U options are specified.
-s Change root directory on startup. This means the remote host
does not need to pass along the directory as part of the trans-
fer, and may add security. When -s is specified, exactly one
directory should be specified on the command line. The use of
this option is recommended for security as well as compatibility
with some boot ROMs which cannot be easily made to include a
directory name in its request.
-u username
Specify the username which tftpd will run as; the default is
"nobody". The user ID, group ID, and (if possible on the plat-
form) the supplementary group IDs will be set to the ones speci-
fied in the system permission database for this username.
-U umask
Sets the umask for newly created files to the specified value.
The default is zero (anyone can read or write) if the -p option
is not specified, or inherited from the invoking process if -p
is specified.
-p Perform no additional permissions checks above the normal sys-
tem-provided access controls for the user specified via the -u
option.
-t timeout
When run from inetd this specifies how long, in seconds, to wait
output of in.tftpd -V to verify whether or not it is available.
-v Increase the logging verbosity of tftpd. This flag can be spec-
ified multiple times for even higher verbosity.
-r tftp-option
Indicate that a specific RFC 2347 TFTP option should never be
accepted.
-V Print the version number and configuration to standard output,
then exit gracefully.
RFC 2347 OPTION NEGOTIATION
This version of tftpd supports RFC 2347 option negotation. Currently
implemented options are:
blksize (RFC 2348)
Set the transfer block size to anything less than or equal to
the specified option. This version of tftpd can support any
block size up to the theoretical maximum of 65464 bytes.
blksize2 (nonstandard)
Set the transfer block size to anything less than or equal to
the specified option, but restrict the possible responses to
powers of 2. The maximum is 32768 bytes (the largest power of 2
less than or equal to 65464.)
tsize (RFC 2349)
Report the size of the file that is about to be transferred.
This version of tftpd only supports the tsize option for binary
(octet) mode transfers.
timeout (RFC 2349)
Set the time before the server retransmits a packet, in seconds.
utimeout (nonstandard)
Set the time before the server retransmits a packet, in
microseconds. and
The -r option can be used to disable specific options; this may be nec-
essary to work around bugs in specific TFTP client implementations.
For example, some TFTP clients have been found to request the blksize
option, but crash with an error if they actually get the option
accepted by the server.
FILENAME REMAPPING
The -m option specifies a file which contains filename remapping rules.
Each non-comment line (comments begin with hash marks, #) contains an
operation, specified below; a regex, a regular expression in the style
of egrep; and optionally a replacement pattern. The operation indi-
cated by operation is performed if the regex matches all or part of the
filename. Rules are processed from the top down, and by default, all
e If this rule matches, end rule processing after executing the
rule.
s If this rule matches, start rule processing over from the very
first rule after executing this rule.
a If this rule matches, refuse the request and send an access
denied error to the client.
G This rule applies to GET (RRQ) requests only.
P This rule applies to PUT (WRQ) requests only.
The following escape sequences are recognized as part of the replace-
ment pattern:
\0 The entire string matched by the regex.
\1 to \9
The strings matched by each of the first nine parenthesized
subexpressions, \( ... \), of the regex pattern.
\i The IP address of the requesting host, in dotted-quad notation
(e.g. 192.0.2.169).
\x The IP address of the requesting host, in hexadecimal notation
(e.g. C00002A9).
\\ Literal backslash.
\whitespace
Literal whitespace.
\# Literal hash mark.
If the mapping file is changed, you need to send SIGHUP to any out-
standing tftpd process.
SECURITY
The use of TFTP services does not require an account or password on the
server system. Due to the lack of authentication information, tftpd
will allow only publicly readable files (o+r) to be accessed, unless
the -p option is specified. Files may be written only if they already
exist and are publicly writable, unless the -c option is specified.
Note that this extends the concept of ``public'' to include all users
on all hosts that can be reached through the network; this may not be
appropriate on all systems, and its implications should be considered
before enabling TFTP service. Typically, some kind of firewall or
packet-filter solution should be employed. If appropriately compiled
(see the output of in.tftpd -V) tftpd will query the hosts_access(5)
database for access control information. This may be slow; sites
requiring maximum performance may want to compile without this option
Finally, the filename remapping (-m flag) support can be used to pro-
vide a limited amount of additional access control.
CONFORMING TO
RFC 1123, Requirements for Internet Hosts - Application and Support.
RFC 1350, The TFTP Protocol (revision 2).
RFC 2347, TFTP Option Extension.
RFC 2348, TFTP Blocksize Option.
RFC 2349, TFTP Timeout Interval and Transfer Size Options.
AUTHOR
This version of tftpd is maintained by H. Peter Anvin .
It was derived from, but has substantially diverged from, an OpenBSD
source base, with added patches by Markus Gutschke and Gero Kulhman.
SEE ALSO
tftp(1), egrep(1), umask(2), hosts_access(5), regex(7), inetd(8).
tftp-hpa 0.32 23 October 2002 TFTPD(8)
<<<--- 参照終了
/tftpboot ディレクトリをグローバル read/write 特権に設定する。
[onlpc03] /home/inoue > ls -l /
合計 212
drwxr-xr-x 2 root root 8192 6月 6 23:52 afs
drwxr-xr-x 2 root root 4096 6月 15 13:00 bin
drwxr-xr-x 3 root root 4096 6月 16 09:54 boot
lrwxr-xr-x 1 root root 20 6月 15 14:17 cern -> /usr/libexec/CE
RNLIB
drwxr-xr-x 22 root root 118784 6月 16 15:20 dev
drwxr-xr-x 88 root root 8192 6月 16 15:19 etc
drwxr-xr-x 3 root root 4096 6月 15 15:33 home
drwxr-xr-x 2 root root 4096 6月 3 2004 initrd
drwxr-xr-x 11 root root 4096 6月 15 14:26 lib
drwx------ 2 root root 16384 6月 15 19:35 lost+found
drwxr-xr-x 2 root root 4096 5月 20 16:21 misc
drwxr-xr-x 4 root root 4096 6月 15 14:54 mnt
drwxr-xr-x 4 root root 4096 6月 15 14:11 opt
dr-xr-xr-x 96 root root 0 6月 17 2005 proc
drwxr-x--- 13 root root 4096 6月 16 15:48 root
drwxr-xr-x 2 root root 8192 6月 15 14:25 sbin
drwxr-xr-x 4 root root 4096 6月 15 13:48 tftpboot
drwxrwxrwt 13 root root 4096 6月 16 16:01 tmp
drwxr-xr-x 25 root root 4096 6月 15 14:26 usr
drwxr-xr-x 32 root root 4096 6月 15 14:25 var
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > chmod 777 /tftpboot
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > ls -l /
合計 212
drwxr-xr-x 2 root root 8192 6月 6 23:52 afs
drwxr-xr-x 2 root root 4096 6月 15 13:00 bin
drwxr-xr-x 3 root root 4096 6月 16 09:54 boot
lrwxr-xr-x 1 root root 20 6月 15 14:17 cern -> /usr/libexec/CE
RNLIB
drwxr-xr-x 22 root root 118784 6月 16 15:20 dev
drwxr-xr-x 88 root root 8192 6月 16 15:19 etc
drwxr-xr-x 3 root root 4096 6月 15 15:33 home
drwxr-xr-x 2 root root 4096 6月 3 2004 initrd
drwxr-xr-x 11 root root 4096 6月 15 14:26 lib
drwx------ 2 root root 16384 6月 15 19:35 lost+found
drwxr-xr-x 2 root root 4096 5月 20 16:21 misc
drwxr-xr-x 4 root root 4096 6月 15 14:54 mnt
drwxr-xr-x 4 root root 4096 6月 15 14:11 opt
dr-xr-xr-x 96 root root 0 6月 17 2005 proc
drwxr-x--- 13 root root 4096 6月 16 15:48 root
drwxr-xr-x 2 root root 8192 6月 15 14:25 sbin
drwxrwxrwx 4 root root 4096 6月 15 13:48 tftpboot
drwxrwxrwt 13 root root 4096 6月 16 16:01 tmp
drwxr-xr-x 25 root root 4096 6月 15 14:26 usr
drwxr-xr-x 32 root root 4096 6月 15 14:25 var
[onlpc03] /home/inoue >
tftpd のスタートアップ情報を変更。
[onlpc03] /home/inoue > /sbin/chkconfig tftp on
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /etc/rc.d/init.d/xinetd restart
xinetdを停止中: [ OK ]
xinetdを起動中: [ OK ]
[onlpc03] /home/inoue >
(1-2-1). tftp動作テスト
サーバマシンの tftpdプログラムが正しく動作できるかどうかテストする。
[root@onlsbc1 toyo]# find / -name tftp -print
/usr/bin/tftp
[root@onlsbc1 toyo]# ls -l /usr/bin/tftp
-rwxr-xr-x 1 root root 18364 Dec 22 06:45 /usr/bin/tftp
[root@onlsbc1 toyo]#
[onlpc03] /home/inoue > vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
130.87.***.*** onlpc03.kek.jp
130.87.***.** onlsbc1.kek.jp
~
~
"/etc/hosts" 5L, 207C 書込み
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > cat /etc/xinetd.d/tftp
# 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
# disable = yes
per_source = 11
cps = 100 2
flags = IPv4
}
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /etc/rc.d/init.d/xinetd restart
xinetdを停止中: [ OK ]
xinetdを起動中: [ OK ]
[onlpc03] /home/inoue >
[root@onlsbc1 toyo]# tftp onlpc03
tftp> get /tftpboot/linux-install/pxelinux.0
Transfer timed out.
tftp> quit
[root@onlsbc1 toyo]#
NG. tftp の実行はタイムアウトになってしまって正常なファイル転送はできな
かった。 システムをリブートしてチェックする。
[onlpc03] /var/log > reboot
Broadcast message from root (pts/0) (Thu Jun 16 16:48:26 2005):
The system is going down for reboot NOW!
:
:
onlsun4[34]% ssh onlpc03
Scientific Linux CERN Release 3.0.5 (SL)
inoue@onlpc03's password:
[onlpc03] /home/inoue > su
Password:
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > whoami
root
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > grep default /etc/inittab
# 0 - halt (Do NOT set initdefault to this)
# 6 - reboot (Do NOT set initdefault to this)
id:5:initdefault:
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --list iptables
iptables 0:オフ 1:オフ 2:オン 3:オン 4:オン 5:オン 6:オフ
[onlpc03] /home/inoue >
default のランレベル5では、iptables がオンに設定されている。 iptablesを
止めて tftp を実行してみる。
[onlpc03] /home/inoue > /sbin/service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[onlpc03] /home/inoue >
[root@onlsbc1 toyo]# /sbin/service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[root@onlsbc1 toyo]#
[root@onlsbc1 toyo]# tftp onlpc03
tftp> ?
tftp-hpa 0.39
Commands may be abbreviated. Commands are:
connect connect to remote tftp
mode set file transfer mode
put send file
get receive file
quit exit tftp
verbose toggle verbose mode
trace toggle packet tracing
status show current status
binary set mode to octet
ascii set mode to netascii
rexmt set per-packet transmission timeout
timeout set total retransmission timeout
? print help information
help print help information
tftp>
tftp> status
Connected to onlpc03.kek.jp.
Mode: netascii Verbose: off Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp>
tftp> verbose
Verbose mode on.
tftp> get /tftpboot/linux-install/pxelinux.0
getting from onlpc03.kek.jp:/tftpboot/linux-install/pxelinux.0 to pxelinux.0 [ne
tascii]
Received 11440 bytes in 1.0 seconds [94835 bit/s]
tftp> quit
[root@onlsbc1 toyo]#
[root@onlsbc1 toyo]# ls -l pxelinux.0
-rw-r--r-- 1 root root 11304 Jun 17 14:39 pxelinux.0
[root@onlsbc1 toyo]#
ok. サーバ側とクライアント側の iptables を停止することで、サーバマシン
onlpc03 から、クライアントマシンonlsbc1 へ tftp プログラムでファイルを
ゲットできた。 ネットワークブート時にはクライアント側のシステムはまだ
起動していないので、サーバ側の iptables を停止するだけでよい。
[onlpc03] /home/inoue > /sbin/chkconfig --list iptables
iptables 0:オフ 1:オフ 2:オン 3:オン 4:オン 5:オン 6:オフ
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --level 5 iptables off
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --list iptables
iptables 0:オフ 1:オフ 2:オン 3:オン 4:オン 5:オフ 6:オフ
[onlpc03] /home/inoue >
(2). クライアント用カーネルの構築
クライアントマシン onlsbc1 の 2.5"IDEハードディスク#2上の Scientific
Linux CERN Release 305 のシステムを使って、ディスクレスクライアント用の
カーネルの再構築はすでに行った。 SBC-Linux64.html を参照。
(3). クライアント用ルートファイルシステムの構築
/tftpbootディレクトリはクライアント用ルートファイルシステムを構築するの
には領域が狭すぎるので、他のパーティション /dev/sdc1 をマウントして使用
する。
# mount -t ext3 /dev/sdc1 /tftpboot
onlpc03 のマシンで Scientific Linux CERN Release 305 のシステムを起動す
る時にはいつも自動的に /dev/sdc1 パーティションをマウントするようにする
ために、/etc/fstabファイルを修正しておく。
[onlpc03] /home/inoue > vi /etc/fstab
LABEL=/1234 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/sdc10 swap swap defaults 0 0
/dev/hda5 swap swap defaults 0 0
/dev/sdb4 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,r
o 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/sdc1 /tftpboot ext3 defaults 1 2
~
~
"/etc/fstab" 10L, 737C 書込み
[onlpc03] /home/inoue >
現在 onlsbc1 の 2.5"IDEハードディスク#2 上には、ディスクレスシステムの
ベース用の Scientific Linux CERN Release 305 のシステムがインストールし
てある。 このルートファイルシステムをディスクレスサーバ上にコピーする
必要がある。 そのために、2.5"IDEハードディスク#2 に IDE-USBアダプタをつ
ないで onlpc03のマシンに直接つないで以降の作業を行う。
2.5"IDEハードディスク#2 に IDE-USBアダプタを挿して onlpc03 のUSBコネクタ
に接続する。 その後、onlpc03 をリブートした。
onlsun4[35]% ssh onlpc03
Scientific Linux CERN Release 3.0.5 (SL)
inoue@onlpc03's password:
[onlpc03] /home/inoue > su
Password:
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/fdisk -l
Disk /dev/sda: 40.0 GB, 40029954048 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sda1 * 1 127 1020096 b Win95 FAT32
/dev/sda2 128 2040 15366172+ c Win95 FAT32 (LBA)
/dev/sda3 3847 4866 8193150 f Win95 拡張領域 (LBA)
/dev/sda4 2041 3846 14506695 83 Linux
/dev/sda5 3847 4866 8193118+ b Win95 FAT32
領域テーブル項目がディスクの順序と一致しません
Disk /dev/sdb: 40.0 GB, 40029954048 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sdb1 1 13 104391 83 Linux
/dev/sdb2 1983 4866 23165730 83 Linux
/dev/sdb3 111 1982 15036840 f Win95 拡張領域 (LBA)
/dev/sdb4 14 110 779152+ 82 Linux スワップ
/dev/sdb5 * 111 716 4867663+ 83 Linux
/dev/sdb6 717 1610 7181023+ 83 Linux
/dev/sdb7 * 1611 1982 2988058+ 83 Linux
領域テーブル項目がディスクの順序と一致しません
Disk /dev/sdc: 80.0 GB, 80020684800 bytes
255 heads, 63 sectors/track, 9728 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sdc1 * 1 1217 9775521 83 Linux
/dev/sdc2 1218 2434 9775552+ 83 Linux
/dev/sdc3 2435 3651 9775552+ 83 Linux
/dev/sdc4 3652 9728 48813502+ f Win95 拡張領域 (LBA)
/dev/sdc5 3652 4868 9775521 83 Linux
/dev/sdc6 4869 6085 9775521 83 Linux
/dev/sdc7 6086 7302 9775521 83 Linux
/dev/sdc8 7303 8519 9775521 83 Linux
/dev/sdc9 8520 9128 4891761 83 Linux
/dev/sdc10 9129 9251 987966 83 Linux
/dev/sdc11 9252 9728 3831471 83 Linux
Disk /dev/sdd: 80.0 GB, 80020684800 bytes
255 heads, 63 sectors/track, 9728 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sdd1 * 1 1217 9775521 83 Linux
/dev/sdd2 1218 2434 9775552+ 83 Linux
/dev/sdd3 2435 3651 9775552+ 83 Linux
/dev/sdd4 3652 9728 48813502+ f Win95 拡張領域 (LBA)
/dev/sdd5 3652 4868 9775521 83 Linux
/dev/sdd6 4869 6085 9775521 83 Linux
/dev/sdd7 6086 7302 9775521 83 Linux
/dev/sdd8 7303 8519 9775521 83 Linux
/dev/sdd9 8520 9128 4891761 83 Linux
/dev/sdd10 9129 9728 4819468+ 83 Linux
Disk /dev/sde: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sde1 * 1 382 3068383+ 83 Linux
/dev/sde2 383 1599 9775552+ 83 Linux
/dev/sde3 1600 1965 2939895 83 Linux
/dev/sde4 1966 12161 81899370 5 拡張領域
/dev/sde5 1966 2331 2939863+ 83 Linux
/dev/sde6 2332 3548 9775521 83 Linux
/dev/sde7 3549 3792 1959898+ 83 Linux
Disk /dev/hda: 20.5 GB, 20576747520 bytes
255 heads, 63 sectors/track, 2501 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/hda1 1 382 3068383+ 1b 隠し Win95 FAT32
/dev/hda3 652 2501 14860125 f Win95 拡張領域 (LBA)
/dev/hda5 652 668 136521 82 Linux スワップ
/dev/hda6 669 923 2048256 b Win95 FAT32
/dev/hda7 924 1289 2939863+ b Win95 FAT32
/dev/hda8 1290 1544 2048256 b Win95 FAT32
/dev/hda9 1545 1799 2048256 b Win95 FAT32
/dev/hda10 1800 2501 5638783+ b Win95 FAT32
[onlpc03] /home/inoue >
ディスクレスシステム・ベース用の Scientific Linux CERN Release 305 の
システムがインストールしてあるドライブは /dev/sde として認識されている。
[onlpc03] /home/inoue > df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/sdc8 9621848 6207172 2925900 68% /
none 191288 0 191288 0% /dev/shm
/dev/sdc1 9621848 4529652 4603420 50% /tftpboot
AFS 9000000 0 9000000 0% /afs
[onlpc03] /home/inoue >
/dev/sde7 パーティションを /mnt ディレクトリにマウントする。
[onlpc03] /home/inoue > mount -t ext3 /dev/sde7 /mnt
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/sdc8 9621848 6207172 2925900 68% /
none 191288 0 191288 0% /dev/shm
/dev/sdc1 9621848 4529652 4603420 50% /tftpboot
AFS 9000000 0 9000000 0% /afs
/dev/sde7 1929068 1179384 651692 65% /mnt
[onlpc03] /home/inoue >
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > cat /mnt/etc/issue
Scientific Linux CERN Release 3.0.5 (SL)
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > ls -l /mnt
合計 200
drwxr-xr-x 2 root root 4096 6月 13 09:28 bin
drwxr-xr-x 3 root root 4096 6月 14 14:17 boot
drwxr-xr-x 22 root root 118784 6月 17 15:37 dev
drwxr-xr-x 42 root root 4096 6月 17 15:37 etc
drwxr-xr-x 3 root root 4096 6月 13 10:10 home
drwxr-xr-x 2 root root 4096 6月 3 2004 initrd
drwxr-xr-x 10 root root 4096 6月 13 11:09 lib
drwx------ 2 root root 16384 6月 13 18:05 lost+found
drwxr-xr-x 2 root root 4096 5月 20 16:21 misc
drwxr-xr-x 3 root root 4096 6月 13 09:48 mnt
drwxr-xr-x 2 root root 4096 6月 3 2004 opt
drwxr-xr-x 2 root root 4096 6月 13 18:05 proc
drwxr-x--- 2 root root 4096 6月 13 10:12 root
drwxr-xr-x 2 root root 8192 6月 13 09:32 sbin
drwxrwxrwt 5 root root 4096 6月 17 15:36 tmp
drwxr-xr-x 15 root root 4096 6月 13 09:13 usr
drwxr-xr-x 18 root root 4096 6月 13 09:32 var
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > ls -l /mnt/boot
合計 14672
lrwxrwxrwx 1 root root 32 6月 13 09:54 System.map -> System.ma
p-2.4.21-32.0.1.EL.cern
-rw-r--r-- 1 root root 588925 5月 26 19:58 System.map-2.4.21-32.0.
1.EL.cern
-rw-r--r-- 1 root root 48843 5月 26 19:58 config-2.4.21-32.0.1.EL
.cern
drwxr-xr-x 2 root root 4096 6月 13 09:38 grub
-rw-r--r-- 1 root root 8192000 6月 13 16:49 initrd-2.4.21-32.0.1.EL
.cern-DKL
-rw-r--r-- 1 root root 164361 6月 14 14:17 initrd-2.4.21-32.0.1.EL
.cern-DKL.img
lrwxrwxrwx 1 root root 36 6月 13 16:55 initrd-2.4.21-32.0.1.EL
.cern.img -> initrd-2.4.21-32.0.1.EL.cern-DKL.img
-rw-r--r-- 1 root root 164971 6月 13 09:18 initrd-2.4.21-32.0.1.EL
.cern.img-org
-rw-r--r-- 1 root root 543 6月 13 09:18 kernel.h
-rw-r--r-- 1 root root 9223 6月 9 2004 message
-rw-r--r-- 1 root root 9223 6月 9 2004 message.ja
-rwxr-xr-x 1 root root 3032596 5月 26 19:58 vmlinux-2.4.21-32.0.1.E
L.cern
lrwxrwxrwx 1 root root 33 6月 13 14:07 vmlinuz-2.4.21-32.0.1.E
L.cern -> vmlinuz-2.4.21-32.0.1.EL.cern-DKL
-rw-r--r-- 1 root root 1451954 6月 14 13:59 vmlinuz-2.4.21-32.0.1.E
L.cern-DKL
-rw-r--r-- 1 root root 1296668 5月 26 19:58 vmlinuz-2.4.21-32.0.1.E
L.cern-org
[onlpc03] /home/inoue >
onlpc03 の /tftpbootディレクトリをチェック。
[onlpc03] / > pwd
/
[onlpc03] / > ls -l
合計 212
drwxr-xr-x 2 root root 8192 6月 6 23:52 afs
drwxr-xr-x 2 root root 4096 6月 15 13:00 bin
drwxr-xr-x 3 root root 4096 6月 16 16:50 boot
lrwxr-xr-x 1 root root 20 6月 15 14:17 cern -> /usr/libexec/CE
RNLIB
drwxr-xr-x 22 root root 118784 6月 17 15:53 dev
drwxr-xr-x 88 root root 8192 6月 17 16:03 etc
drwxr-xr-x 3 root root 4096 6月 15 15:33 home
drwxr-xr-x 2 root root 4096 6月 3 2004 initrd
drwxr-xr-x 11 root root 4096 6月 15 14:26 lib
drwx------ 2 root root 16384 6月 15 19:35 lost+found
drwxr-xr-x 2 root root 4096 5月 20 16:21 misc
drwxr-xr-x 19 root root 4096 6月 17 15:37 mnt
drwxr-xr-x 4 root root 4096 6月 15 14:11 opt
dr-xr-xr-x 95 root root 0 6月 18 2005 proc
drwxr-x--- 13 root root 4096 6月 17 15:50 root
drwxr-xr-x 2 root root 8192 6月 15 14:25 sbin
drwxrwxrwx 7 root root 4096 4月 20 14:42 tftpboot
drwxrwxrwt 13 root root 4096 6月 17 16:01 tmp
drwxr-xr-x 25 root root 4096 6月 15 14:26 usr
drwxr-xr-x 32 root root 4096 6月 15 14:25 var
[onlpc03] / >
[onlpc03] / > ls -l /tftpboot
合計 253568
drwxrwxrwx 24 root root 4096 4月 22 15:59 130.87.153.3
drwxrwxrwx 23 root root 4096 4月 20 09:49 130.87.153.3-Sarge-OK
drwxrwxrwx 24 root root 4096 3月 29 16:02 130.87.153.3-Sarge-old
drwxrwxrwx 18 root root 4096 3月 28 14:51 FedoraCore1-130.87.153.
3
-rw-r--r-- 1 root root 259357802 4月 20 14:39 Sarge-Fedora3-diskless
-Apr202005.tar.gz
drwx------ 2 root root 4096 3月 24 15:17 lost+found
[onlpc03] / >
[onlpc03] / > df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/sdc8 9621848 6207176 2925896 68% /
none 191288 0 191288 0% /dev/shm
/dev/sdc1 9621848 4529652 4603420 50% /tftpboot
AFS 9000000 0 9000000 0% /afs
/dev/sde7 1929068 1179384 651692 65% /mnt
[onlpc03] / >
(3-1). ディスクレスクライアント用のファイルを置く場所を確保
/tftpboot ディレクトリをチェック。
[onlpc03] / > ls -l /tftpboot
合計 253568
drwxrwxrwx 24 root root 4096 4月 22 15:59 130.87.153.3
drwxrwxrwx 23 root root 4096 4月 20 09:49 130.87.153.3-Sarge-OK
drwxrwxrwx 24 root root 4096 3月 29 16:02 130.87.153.3-Sarge-old
drwxrwxrwx 18 root root 4096 3月 28 14:51 FedoraCore1-130.87.153.
3
-rw-r--r-- 1 root root 259357802 4月 20 14:39 Sarge-Fedora3-diskless
-Apr202005.tar.gz
drwx------ 2 root root 4096 3月 24 15:17 lost+found
[onlpc03] / >
[onlpc03] / > ls -l /tftpboot/130.87.153.3
合計 5164
-rw-r--r-- 1 root root 5061749 4月 22 15:59 Sarge-boot-std-Apr22200
5.tar.gz
drwxr-xr-x 2 root root 4096 2月 2 16:02 bin
drwxr-xr-x 3 root root 4096 4月 20 09:25 boot
drwxr-xr-x 3 root root 4096 4月 22 15:59 boot-std
drwxr-xr-x 11 root root 24576 4月 22 14:38 dev
drwxr-xr-x 59 root root 4096 4月 22 14:38 etc
drwxrwsr-x 4 root ftp 4096 4月 13 09:10 home
lrwxrwxrwx 1 root root 28 4月 20 14:46 initrd.img -> boot/init
rd.img-2.4.27-686DL
drwxr-xr-x 9 root root 4096 2月 2 16:02 lib
drwxr-xr-x 2 root root 4096 1月 21 18:44 lost+found
drwxr-xr-x 2 root root 4096 1月 21 18:44 media
drwxrwxrwx 2 root root 4096 12月 16 2004 mnt
drwxr-xr-x 2 root root 4096 1月 25 16:58 mnt1
drwxr-xr-x 2 root root 4096 1月 27 10:11 mnt2
drwxr-xr-x 2 root root 4096 1月 31 10:48 mnt3
drwxr-xr-x 2 root root 4096 1月 21 18:48 opt
drwxr-xr-x 2 root root 4096 12月 16 2004 proc
drwxr-xr-x 4 root root 4096 4月 13 16:56 root
drwxr-xr-x 2 root root 4096 4月 20 10:26 sbin
drwxr-xr-x 2 root root 4096 1月 21 18:48 srv
drwxr-xr-x 2 root root 4096 12月 27 11:40 sys
drwxrwxrwt 5 root root 4096 4月 22 14:32 tmp
drwxr-xr-x 14 root root 4096 4月 12 17:02 usr
drwxr-xr-x 14 root root 4096 1月 21 10:49 var
lrwxrwxrwx 1 root root 23 4月 20 14:46 vmlinuz -> boot/vmlinuz
-2.4.27-686
[onlpc03] / >
[onlpc03] / > cat /tftpboot/130.87.153.3/etc/issue
Debian GNU/Linux 3.1 \n \l
[onlpc03] / >
すでに /tftpbootディレクトリの下には、130.87.153.3ディレクトリが存在し、
このディレクトリの下には、Debian GNU/Linux 3.1 用のルートファイルシステ
ムが置かれている。 これは、先に行った Debian (Sarge) ディスクレスシステ
ム構築のテストで使用したものである。 混乱を避けるために、名前を変更して
おく。
[onlpc03] /tftpboot > pwd
/tftpboot
[onlpc03] /tftpboot > ls
130.87.153.3 FedoraCore1-130.87.153.3
130.87.153.3-Sarge-OK Sarge-Fedora3-diskless-Apr202005.tar.gz
130.87.153.3-Sarge-old lost+found
[onlpc03] /tftpboot > mv 130.87.153.3 130.87.153.3-Sarge
[onlpc03] /tftpboot >
[onlpc03] /tftpboot > mkdir bak
[onlpc03] /tftpboot > mv 130.87.153.3-Sarge-OK bak
[onlpc03] /tftpboot > mv 130.87.153.3-Sarge-old bak
[onlpc03] /tftpboot >
[onlpc03] /tftpboot > ls -l
合計 253556
drwxrwxrwx 24 root root 4096 4月 22 15:59 130.87.153.3-Sarge
drwxrwxrwx 18 root root 4096 3月 28 14:51 FedoraCore1-130.87.153.
3
-rw-r--r-- 1 root root 259357802 4月 20 14:39 Sarge-Fedora3-diskless
-Apr202005.tar.gz
drwxr-xr-x 4 root root 4096 6月 20 08:58 bak
drwx------ 2 root root 4096 3月 24 15:17 lost+found
[onlpc03] /tftpboot >
"/tftpboot/<クライアントのIPアドレス>" ディレクトリを作成する。 ディス
クレスクライアント用のルートファイルシステムはこのディレクトリ下に配置
する。
[onlpc03] / > pwd
/
[onlpc03] / > mkdir /tftpboot/130.87.153.3
[onlpc03] / >
[onlpc03] / > ls -l /tftpboot
合計 253560
drwxr-xr-x 2 root root 4096 6月 20 09:01 130.87.153.3
drwxrwxrwx 24 root root 4096 4月 22 15:59 130.87.153.3-Sarge
drwxrwxrwx 18 root root 4096 3月 28 14:51 FedoraCore1-130.87.153.
3
-rw-r--r-- 1 root root 259357802 4月 20 14:39 Sarge-Fedora3-diskless
-Apr202005.tar.gz
drwxr-xr-x 4 root root 4096 6月 20 08:58 bak
drwx------ 2 root root 4096 3月 24 15:17 lost+found
[onlpc03] / >
/tftpboot/130.87.153.3ディレクトリの下にクライアント用のルートファイルシ
ステムを作成する。
(3-2). /etc/exportsファイルの設定
/etc/exportsファイルを修正する。
[onlpc03] / > vi /etc/exports
# sample /etc/exports file
#/ master(rw) trusty(rw,no_root_squash)
#/projects proj*.local.domain(rw)
#/usr *.local.domain(ro) @trusted(rw)
#/home/joe pc001(rw,all_squash,anonuid=150,anongid=100)
#/pub (ro,insecure,all_squash)
#/pub/private (noaccess)
#/tftpboot/130.87.153.3 130.87.0.0/255.255.252.0(rw,no_root_squash)
/tftpboot/130.87.153.3 130.87.153.3(rw,no_root_squash)
~
~
"/etc/exports" 10L, 426C 書込み
[onlpc03] / >
[onlpc03] / > /usr/sbin/exportfs -av
exportfs: /etc/exports [9]: No 'sync' or 'async' option specified for export "13
0.87.153.3:/tftpboot/130.87.153.3".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exporting onlsbc1.kek.jp:/tftpboot/130.87.153.3
exporting onlsbc1.kek.jp:/tftpboot/130.87.153.3 to kernel
[onlpc03] / >
(3-3). /tftpboot/130.87.153.3下にファイルをコピー
[onlpc03] / > df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/sdc8 9621848 6213488 2919584 69% /
none 191288 0 191288 0% /dev/shm
/dev/sdc1 9621848 4529660 4603412 50% /tftpboot
AFS 9000000 0 9000000 0% /afs
/dev/sde7 1929068 1179384 651692 65% /mnt
[onlpc03] / >
[onlpc03] /mnt > pwd
/mnt
[onlpc03] /mnt > ls -l
合計 200
drwxr-xr-x 2 root root 4096 6月 13 09:28 bin
drwxr-xr-x 3 root root 4096 6月 14 14:17 boot
drwxr-xr-x 22 root root 118784 6月 17 15:37 dev
drwxr-xr-x 42 root root 4096 6月 17 15:37 etc
drwxr-xr-x 3 root root 4096 6月 13 10:10 home
drwxr-xr-x 2 root root 4096 6月 3 2004 initrd
drwxr-xr-x 10 root root 4096 6月 13 11:09 lib
drwx------ 2 root root 16384 6月 13 18:05 lost+found
drwxr-xr-x 2 root root 4096 5月 20 16:21 misc
drwxr-xr-x 3 root root 4096 6月 13 09:48 mnt
drwxr-xr-x 2 root root 4096 6月 3 2004 opt
drwxr-xr-x 2 root root 4096 6月 13 18:05 proc
drwxr-x--- 2 root root 4096 6月 13 10:12 root
drwxr-xr-x 2 root root 8192 6月 13 09:32 sbin
drwxrwxrwt 5 root root 4096 6月 17 15:36 tmp
drwxr-xr-x 15 root root 4096 6月 13 09:13 usr
drwxr-xr-x 18 root root 4096 6月 13 09:32 var
[onlpc03] /mnt > cat etc/issue
Scientific Linux CERN Release 3.0.5 (SL)
[onlpc03] /mnt >
[onlpc03] /mnt > tar cpf - . | ( cd /tftpboot/130.87.153.3; tar xpf - )
[onlpc03] /mnt >
[onlpc03] /mnt > pwd
/mnt
[onlpc03] /mnt > ls -l
合計 200
drwxr-xr-x 2 root root 4096 6月 13 09:28 bin
drwxr-xr-x 3 root root 4096 6月 14 14:17 boot
drwxr-xr-x 22 root root 118784 6月 17 15:37 dev
drwxr-xr-x 42 root root 4096 6月 17 15:37 etc
drwxr-xr-x 3 root root 4096 6月 13 10:10 home
drwxr-xr-x 2 root root 4096 6月 3 2004 initrd
drwxr-xr-x 10 root root 4096 6月 13 11:09 lib
drwx------ 2 root root 16384 6月 13 18:05 lost+found
drwxr-xr-x 2 root root 4096 5月 20 16:21 misc
drwxr-xr-x 3 root root 4096 6月 13 09:48 mnt
drwxr-xr-x 2 root root 4096 6月 3 2004 opt
drwxr-xr-x 2 root root 4096 6月 13 18:05 proc
drwxr-x--- 2 root root 4096 6月 13 10:12 root
drwxr-xr-x 2 root root 8192 6月 13 09:32 sbin
drwxrwxrwt 5 root root 4096 6月 17 15:36 tmp
drwxr-xr-x 15 root root 4096 6月 13 09:13 usr
drwxr-xr-x 18 root root 4096 6月 13 09:32 var
[onlpc03] /mnt >
[onlpc03] /tftpboot/130.87.153.3 > pwd
/tftpboot/130.87.153.3
[onlpc03] /tftpboot/130.87.153.3 > ls -l
合計 188
drwxr-xr-x 2 root root 4096 6月 13 09:28 bin
drwxr-xr-x 3 root root 4096 6月 14 14:17 boot
drwxr-xr-x 22 root root 118784 6月 17 15:37 dev
drwxr-xr-x 42 root root 4096 6月 17 15:37 etc
drwxr-xr-x 3 root root 4096 6月 13 10:10 home
drwxr-xr-x 2 root root 4096 6月 3 2004 initrd
drwxr-xr-x 10 root root 4096 6月 13 11:09 lib
drwx------ 2 root root 4096 6月 13 18:05 lost+found
drwxr-xr-x 2 root root 4096 5月 20 16:21 misc
drwxr-xr-x 3 root root 4096 6月 13 09:48 mnt
drwxr-xr-x 2 root root 4096 6月 3 2004 opt
drwxr-xr-x 2 root root 4096 6月 13 18:05 proc
drwxr-x--- 2 root root 4096 6月 13 10:12 root
drwxr-xr-x 2 root root 8192 6月 13 09:32 sbin
drwxrwxrwt 5 root root 4096 6月 17 15:36 tmp
drwxr-xr-x 15 root root 4096 6月 13 09:13 usr
drwxr-xr-x 18 root root 4096 6月 13 09:32 var
[onlpc03] /tftpboot/130.87.153.3 >
[onlpc03] /tftpboot/130.87.153.3 > pwd
/tftpboot/130.87.153.3
[onlpc03] /tftpboot/130.87.153.3 > du -k
:
:
8 ./mnt
4 ./opt
11516 ./sbin
4 ./misc
1166480 .
[onlpc03] /tftpboot/130.87.153.3 >
[onlpc03] /tftpboot > pwd
/tftpboot
[onlpc03] /tftpboot > ls -l
合計 253560
drwxr-xr-x 19 root root 4096 6月 20 09:48 130.87.153.3
drwxrwxrwx 24 root root 4096 4月 22 15:59 130.87.153.3-Sarge
drwxrwxrwx 18 root root 4096 3月 28 14:51 FedoraCore1-130.87.153.
3
-rw-r--r-- 1 root root 259357802 4月 20 14:39 Sarge-Fedora3-diskless
-Apr202005.tar.gz
drwxr-xr-x 4 root root 4096 6月 20 08:58 bak
drwx------ 2 root root 4096 3月 24 15:17 lost+found
[onlpc03] /tftpboot >
[onlpc03] /tftpboot > chmod go+w 130.87.153.3
[onlpc03] /tftpboot >
[onlpc03] /tftpboot > ls -l
合計 253560
drwxrwxrwx 19 root root 4096 6月 20 09:48 130.87.153.3
drwxrwxrwx 24 root root 4096 4月 22 15:59 130.87.153.3-Sarge
drwxrwxrwx 18 root root 4096 3月 28 14:51 FedoraCore1-130.87.153.
3
-rw-r--r-- 1 root root 259357802 4月 20 14:39 Sarge-Fedora3-diskless
-Apr202005.tar.gz
drwxr-xr-x 4 root root 4096 6月 20 08:58 bak
drwx------ 2 root root 4096 3月 24 15:17 lost+found
[onlpc03] /tftpboot >
ok. 正常にコピーは完了した。
クライアント・システムのサイズは約 1.17GBになっている。 カーネル再構築
をやった時のファイルが残ったままなので大きくなっているようだ。 ディスク
レスクライアントが立ち上がった段階で削除しよう。 ここではこのままにして
おく。
(3-4). /tftpboot/130.87.153.3/etc 以下のファイルの編集
/tftpboot/130.87.153.3ディレクトリ下にコピーしたファイルをディスクレス
クライアント用に修正する。
(3-4-1). /tftpboot/130.87.153.3/etc/hosts
[onlpc03] /tftpboot/130.87.153.3/etc > pwd
/tftpboot/130.87.153.3/etc
[onlpc03] /tftpboot/130.87.153.3/etc > vi hosts
:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
130.87.***.*** onlsbc1 onlsbc1.kek.jp
130.87.***.*** onlpc03 onlpc03.kek.jp
~
~
"hosts" 5L, 225C 書込み
[onlpc03] /tftpboot/130.87.153.3/etc >
サーバ側の /etc/hosts にもクライアントの情報を追加する。
[onlpc03] /tftpboot/130.87.153.3/etc > vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
130.87.***.*** onlpc03 onlpc03.kek.jp
130.87.***.*** onlsbc1.kek.jp
130.87.***.*** onlsun1 onlsun1.kek.jp
~
~
"/etc/hosts" 6L, 253C 書込み
[onlpc03] /tftpboot/130.87.153.3/etc >
(3-4-2). /tftpboot/130.87.153.3/etc/hosts.allow
[onlpc03] /tftpboot/130.87.153.3/etc > pwd
/tftpboot/130.87.153.3/etc
[onlpc03] /tftpboot/130.87.153.3/etc > vi hosts.allow
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
ALL:LOCAL,.kek.jp
~
~
"hosts.allow" 6L, 178C 書込み
[onlpc03] /tftpboot/130.87.153.3/etc >
[onlpc03] /tftpboot/130.87.153.3/etc > vi hosts.deny
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
ALL:ALL
~
~
"hosts.deny" 9L, 354C 書込み
[onlpc03] /tftpboot/130.87.153.3/etc >
(3-4-3). /tftpboot/130.87.153.3/etc/resolv.conf
[onlpc03] /tftpboot/130.87.153.3/etc > pwd
/tftpboot/130.87.153.3/etc
[onlpc03] /tftpboot/130.87.153.3/etc > cat resolv.conf
search kek.jp
nameserver 130.87.***.***
nameserver 130.87.***.***
nameserver 130.87.***.***
[onlpc03] /tftpboot/130.87.153.3/etc >
(3-4-4). /tftpboot/130.87.153.3/etc/fstab
[onlpc03] /tftpboot/130.87.153.3/etc > pwd
/tftpboot/130.87.153.3/etc
[onlpc03] /tftpboot/130.87.153.3/etc > mv fstab fstab-org
[onlpc03] /tftpboot/130.87.153.3/etc > cp fstab-org fstab
[onlpc03] /tftpboot/130.87.153.3/etc >
[onlpc03] /tftpboot/130.87.153.3/etc > vi fstab
#LABEL=/12345 / ext3 defaults 1 1
130.87.153.112:/tftpboot/130.87.153.3 / nfs rw,rsize=8192,wsize=8192,in
tr 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdc1 /mnt/flash auto noauto,owner,kudzu 0 0
~
~
"fstab" 6L, 478C 書込み
[onlpc03] /tftpboot/130.87.153.3/etc >
(3-4-5). /tftpboot/130.87.153.3/etc/sysconfig/network
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig > pwd
/tftpboot/130.87.153.3/etc/sysconfig
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig > ls
apm-scripts i18n netdump_id_dsa.pub
apmd init network
apt-autoupdate installinfo network-scripts
authconfig ip6tables-config networking
autofs iptables pcmcia
clock iptables-config prelink
console irda rawdevices
devlabel irqbalance redhat-config-securitylevel
devlabel.d keyboard sendmail
gpm kudzu syslog
grub mouse xinetd
harddisks netdump yum-autoupdate
hwconf netdump_id_dsa
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig >
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig > mv network network-org
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig > cp network-org network
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig >
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig > vi network
NETWORKING=yes
HOSTNAME=onlsbc1.kek.jp
GATEWAY=130.87.***.***
~
~
"network" 3L, 60C 書込み
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig >
(3-4-6). /tftpboot/130.87.153.3/etc/sysconfig/network-scripts/ifcfg-eth0
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig/network-scripts > pwd
/tftpboot/130.87.153.3/etc/sysconfig/network-scripts
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig/network-scripts > ls
ifcfg-eth0 ifdown-ipv6 ifup ifup-isdn ifup-sit
ifcfg-lo ifdown-isdn ifup-aliases ifup-plip ifup-sl
ifdown ifdown-post ifup-ippp ifup-plusb ifup-wireless
ifdown-aliases ifdown-ppp ifup-ipsec ifup-post init.ipv6-global
ifdown-ippp ifdown-sit ifup-ipv6 ifup-ppp network-functions
ifdown-ipsec ifdown-sl ifup-ipx ifup-routes network-functions-ipv6
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig/network-scripts >
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig/network-scripts > mv ifcfg-eth0 i
fcfg-eth0-bak
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig/network-scripts > cat ifcfg-eth0-
bak
DEVICE=eth0
BOOTPROTO=static
BROADCAST=130.87.***.***
IPADDR=130.87.***.***
NETMASK=255.255.***.***
NETWORK=130.87.***.***
ONBOOT=yes
TYPE=Ethernet
[onlpc03] /tftpboot/130.87.153.3/etc/sysconfig/network-scripts >
(3-4-7). /tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom/modules.dep
/tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom/modules.d
ep を確認。
[onlpc03] /tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom > pwd
/tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom
[onlpc03] /tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom > ls -l
合計 412
lrwxrwxrwx 1 root root 36 6月 20 09:48 build -> /usr/src/linux
-2.4.21-32.0.1.EL.cern
drwxr-xr-x 10 root root 4096 6月 13 14:46 kernel
-rw-r--r-- 1 root root 144992 6月 13 14:46 modules.dep
-rw-r--r-- 1 root root 31 6月 13 14:46 modules.generic_string
-rw-r--r-- 1 root root 443 6月 13 14:46 modules.ieee1394map
-rw-r--r-- 1 root root 8330 6月 13 14:46 modules.isapnpmap
-rw-r--r-- 1 root root 29 6月 13 14:46 modules.parportmap
-rw-r--r-- 1 root root 83693 6月 13 14:46 modules.pcimap
-rw-r--r-- 1 root root 24 6月 13 14:46 modules.pnpbiosmap
-rw-r--r-- 1 root root 138745 6月 13 14:46 modules.usbmap
drwxr-xr-x 2 root root 4096 6月 13 14:46 pcmcia
[onlpc03] /tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom >
[onlpc03] /tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom > tail
modules.dep
/lib/modules/2.4.21-32.0.1.EL.cerncustom/kernel/net/sched/sch_sfq.o:
/lib/modules/2.4.21-32.0.1.EL.cerncustom/kernel/net/sched/sch_tbf.o:
/lib/modules/2.4.21-32.0.1.EL.cerncustom/kernel/net/sched/sch_teql.o:
/lib/modules/2.4.21-32.0.1.EL.cerncustom/kernel/net/tux/tux.o:
/lib/modules/2.4.21-32.0.1.EL.cerncustom/kernel/net/wanrouter/wanrouter.o:
[onlpc03] /tftpboot/130.87.153.3/lib/modules/2.4.21-32.0.1.EL.cerncustom >
(3-4-8). /tftpboot/130.87.153.3/boot下のシンボリックリンク修正
[onlpc03] /tftpboot/130.87.153.3/boot > pwd
/tftpboot/130.87.153.3/boot
[onlpc03] /tftpboot/130.87.153.3/boot > ls -l
合計 14672
lrwxrwxrwx 1 root root 32 6月 20 09:47 System.map -> System.ma
p-2.4.21-32.0.1.EL.cern
-rw-r--r-- 1 root root 588925 5月 26 19:58 System.map-2.4.21-32.0.
1.EL.cern
-rw-r--r-- 1 root root 48843 5月 26 19:58 config-2.4.21-32.0.1.EL
.cern
drwxr-xr-x 2 root root 4096 6月 13 09:38 grub
-rw-r--r-- 1 root root 8192000 6月 13 16:49 initrd-2.4.21-32.0.1.EL
.cern-DKL
-rw-r--r-- 1 root root 164361 6月 14 14:17 initrd-2.4.21-32.0.1.EL
.cern-DKL.img
lrwxrwxrwx 1 root root 36 6月 20 09:47 initrd-2.4.21-32.0.1.EL
.cern.img -> initrd-2.4.21-32.0.1.EL.cern-DKL.img
-rw-r--r-- 1 root root 164971 6月 13 09:18 initrd-2.4.21-32.0.1.EL
.cern.img-org
-rw-r--r-- 1 root root 543 6月 13 09:18 kernel.h
-rw-r--r-- 1 root root 9223 6月 9 2004 message
-rw-r--r-- 1 root root 9223 6月 9 2004 message.ja
-rwxr-xr-x 1 root root 3032596 5月 26 19:58 vmlinux-2.4.21-32.0.1.E
L.cern
lrwxrwxrwx 1 root root 33 6月 20 09:47 vmlinuz-2.4.21-32.0.1.E
L.cern -> vmlinuz-2.4.21-32.0.1.EL.cern-DKL
-rw-r--r-- 1 root root 1451954 6月 14 13:59 vmlinuz-2.4.21-32.0.1.E
L.cern-DKL
-rw-r--r-- 1 root root 1296668 5月 26 19:58 vmlinuz-2.4.21-32.0.1.E
L.cern-org
[onlpc03] /tftpboot/130.87.153.3/boot >
(4). サーバの設定
サーバ側の Scientific Linux CERNRelease 305 のシステムでNFS サーバを起動
する。
(4-1). NFS サーバ の設定
[onlpc03] /home/inoue > yum list installed | grep nfs
nfs-utils i386 1.0.6-33EL db
redhat-config-nfs noarch 1.0.13-6 db
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --list nfs
nfs 0:オフ 1:オフ 2:オフ 3:オフ 4:オフ 5:オフ 6:オフ
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig nfs on
[onlpc03] /home/inoue > /sbin/chkconfig --list nfs
nfs 0:オフ 1:オフ 2:オン 3:オン 4:オン 5:オン 6:オフ
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > vi /etc/hosts.allow
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
ALL:LOCAL,.kek.jp
~
~
"/etc/hosts.allow" 6L, 178C 書込み
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > vi /etc/hosts.deny
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
ALL:ALL
~
~
"/etc/hosts.deny" 9L, 354C 書込み
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --add portmap
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > /sbin/chkconfig --list portmap
portmap 0:オフ 1:オフ 2:オフ 3:オン 4:オン 5:オン 6:オフ
[onlpc03] /home/inoue >
[onlpc03] /home/inoue > ls -l /etc/rc.d/rc5.d/*portmap
lrwxrwxrwx 1 root root 17 6月 21 11:26 /etc/rc.d/rc5.d/S13port
map -> ../init.d/portmap
[onlpc03] /home/inoue >
システムアップ時に portmap を起動するようにした。
ここでサーバ側 onlpc03 を再起動したあとでクライアント側マシン onlsbc1 を
立ち上げてみる。
[root@onlsbc1 boot]# /sbin/shutdown -h now
[root@onlsbc1 boot]#
Broadcast message from root (pts/0) (Mon Jul 4 15:36:31 2005):
The system is going down for system halt NOW!
:
:
クライアントマシン onlsbc1 はシャットダウンした。
続いてサーバマシン onlpc03 をリブートする。
[onlpc03] /home/inoue > whoami
root
[onlpc03] /home/inoue > sbin/reboot
Broadcast message from root (pts/0) (Mon Jul 4 15:44:06 2005):
The system is going down for reboot NOW!
:
:
サーバマシン onlpc03 はリブートして立ち上がった。
onlsun4[40]% ssh onlpc03
Scientific Linux CERN Release 3.0.5 (SL)
inoue@onlpc03's password:
[onlpc03] /home/inoue > df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/sdc8 9621848 6220700 2912372 69% /
none 190564 0 190564 0% /dev/shm
/dev/sdc1 9621848 5695928 3437144 63% /tftpboot
AFS 9000000 0 9000000 0% /afs
[onlpc03] /home/inoue >
ここで、クライアントマシン onlsbc1 を立ち上げる。
onlsun4[37]% ssh toyo@onlsbc1
Scientific Linux CERN Release 3.0.5 (SL)
toyo@onlsbc1's password:
[toyo@onlsbc1 toyo]$ df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
130.87.153.112:/tftpboot/130.87.153.3
9621848 5696044 3437028 63% /
none 150692 0 150692 0% /dev/shm
[toyo@onlsbc1 toyo]$
(5). コンパクトフラッシュ上に grubインストール
現在 onlsbc1 上に実装している、コンパクトフラッシュには、上記の作業の
途中で既にネットワークブート用の grub を上書きしてテストに使用してきた。
現時点で、コンパクトフラッシュの grubからネットワークブートは正常に実行
できている。 ここでやるべき作業はない。
これで、サーバ側もクライアント側も Scientific Linux CERN Release 305 で
動作する、基本的なディスクレスシステムの構築が完成した。 続いて、CAMAC
ソフトウェアをインストールして動作テストをする。
---xxxx