Cobalt Qube 3 (コバルトキューブスリー)へのDebianのインストール方法
November 15, 2004 Ver 0.2 川内康雄 Yasuo Kawachi http://www.homu.net
Part 3 サーバーの準備
1 サーバーへのOSのインストール
サーバーにするマシンにDebianをインストールします。私はWoodyのCD-ROMイメージを入手してCD-Rに焼き、あまっているノートパソコンにインストールしました。最初、PCMCIAサポートの設定を忘れてあせりました。
ちなみにパーティションは
hda1 Primary Linux swap (no label) 255.47
hda2 Boot Primary Linux (no label) 4072.00
といい加減です。とりあえずQubeへのDebianをインストールするためだけならあまりこだわらなくてもいいでしょう。
(参考)
http://www.debian.org/CD/http-ftp/
http://www.navic.co.jp/services/debian/woody/new_install/index_j.html
2 サーバーのIPの設定
debian:~# vi /etc/network/interfaces # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface auto lo iface lo inet loopback
# The first network card - this entry was created during the Debian installation iface eth0 inet static address 192.168.0.11 netmask 255.255.255.0 gateway 192.168.0.1 |
としてサーバーのIPを設定します。ちなみにこの時点ではローカルのキーボードとディスプレイで操作しています。
debian:~# ifdown eth0 debian:~# ifup eth0 |
としてネットワークインターフェイスを再起動します。
debian:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:90:CC:1A:10:75 inet addr:192.168.0.11 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1357 errors:0 dropped:2 overruns:0 frame:1 TX packets:718 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1278575 (1.2 MiB) TX bytes:69621 (67.9 KiB) Interrupt:3 Base address:0x300
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:3924 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
アドレスがきちんと設定されていることを確認します。
3 リモート接続の準備
| debian:~# apt-get install ssh |
としてsshサーバーをインストールします。これ以降はコンソールマシンからSSHSecureShellClientでアクセスしました。
4 サーバーにNFSをインストール
| debian:~# apt-get install nfs-user-server |
としてNFSサーバーをインストールします。最初はinstall nfs-kernel-serverでやったらどう設定してみても動かず、半日ぐらいはまりました。まあスピードが問題になるようなシチュエーションではありませんから、こだわるのはやめましょう。
5 portmapの許可
debian:~# vi /etc/hosts.allow # /etc/hosts.allow: list of hosts that are allowed to access the system. # See the manual pages hosts_access(5), hosts_options(5) # and /usr/doc/netbase/portmapper.txt.gz # # Example: ALL: LOCAL @some_netgroup # ALL: .foobar.edu EXCEPT terminalserver.foobar.edu # # If you're going to protect the portmapper use the name "portmap" for the # daemon name. Remember that you can only use the keyword "ALL" and IP # addresses (NOT host or domain names) for the portmapper. See portmap(8) # and /usr/doc/portmap/portmapper.txt.gz for further information. # ALL:192.168.0.0/255.255.255.0 ALL:127.0.0.1 |
nfs-user-serverを使用する際でも必要な手順なのかどうかわかりませんがとりあえず設定しておきました。
6 debootstrapのインストール
| debian:~# apt-get install debootstrap |
として、サーバーに今回の肝であるdebootstrapをインストールします。
7 debootstrapを使用して別のwoodyを構築する。
完了まで10分程度でしょうか。Successfully installedと表示されるのを確認します。ちなみにいSargeでやろうとしたら成功しませんでした。何故?
8 /nfsroot-x86/etc/inittabの編集
初期状態
# Note that on most Debian systems tty7 is used by the X Window System, # so if you want to add more getty's go ahead but skip tty7 if you run X. # 1:2345:respawn:/sbin/getty 38400 tty1 2:23:respawn:/sbin/getty 38400 tty2 3:23:respawn:/sbin/getty 38400 tty3 4:23:respawn:/sbin/getty 38400 tty4 5:23:respawn:/sbin/getty 38400 tty5 6:23:respawn:/sbin/getty 38400 tty6
# Example how to put a getty on a serial line (for a terminal) # #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100 |
変更後の状態
# Note that on most Debian systems tty7 is used by the X Window System, # so if you want to add more getty's go ahead but skip tty7 if you run X. # #1:2345:respawn:/sbin/getty 38400 tty1 #2:23:respawn:/sbin/getty 38400 tty2 #3:23:respawn:/sbin/getty 38400 tty3 #4:23:respawn:/sbin/getty 38400 tty4 #5:23:respawn:/sbin/getty 38400 tty5 #6:23:respawn:/sbin/getty 38400 tty6
# Example how to put a getty on a serial line (for a terminal) # T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100 #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100 |
このように変更するというのがマニュアルの指示なのですが、結局どうやってもコンソールからはログインできず、Telnetからログインしたので実際には不要でしょう。
9 /nfsroot-x86/etc/securettyを編集
ttys0をどこかに追加します。ただし8と同じ問題が残ります。
10 /etc/apt/sources.listを/nfsroot-x86/etc/apt/sources.listとしてコピー
| debian:~# cp /etc/apt/sources.list /nfsroot-x86/etc/apt/sources.list |
とするのが流儀なんでしょうが、私はSshのファイルトランスファーをつかっちゃってます。
11 chrootする
| debian:~# chroot /nfsroot-x86 |
これで/nfsroot-x86がルートディレクトリのようになります。
12 インストール用の環境を準備する
debian:/# apt-get update debian:/# apt-get install debootstrap alien telnetd debian:/# passwd root debian:/# adduser debian:/# passwd yasuo |
としてリモートログインの準備をします。
最後にchrootから抜けておきます。
13 /nfsroot-x86/etc/fstabを編集
debian:~# vi /nfsroot-x86/etc/fstab
# /etc/fstab: static file system information. # # 192.168.0.11:/nfsroot-x86 / nfs defaults 0 0 proc /proc proc defaults 0 0 |
1行目はサーバーのIPです。
13 nfsの設定
debian:~# vi /etc/exports # /etc/exports: the access control list for filesystems which may be exported # to NFS clients. See exports(5). /nfsroot-x86 (rw,no_root_squash) |
としてサーバーのNFSへのアクセスを許可します。ここのno_root_squashは必須です。私はこれを抜かして後のプロセスではまってしまい挫折しかけました。
| debian:~# shutdown -r now |
で再起動します。