ログ日記

作業ログと日記とメモ

ネットワークブートの練習

バージョンはsqueeze。
Setting up a server for PXE network booting
だいたいはここの通りにする。

aptitude install tftpd-hpa
aptitude install dhcp3-server
vi /etc/dhcp3/dhcpd.conf
option domain-name-servers 62.31.64.39, 62.31.112.39;
default-lease-time 86400;
max-lease-time 604800;
authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
        range 192.168.1.70 192.168.1.100;
        filename "pxelinux.0";
        next-server 192.168.1.50;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.1.255;
        option routers 192.168.1.1;
}
Setting up a server for PXE network booting
aptitude install dnsmasq
vi /etc/dnsmasq.conf
# dhcp-boot=pxelinux.0 をコメント解除
/etc/init.d/dnsmasq restart
mkdir /srv/tftp/pxelinux.cfg
cd /srv/tftp/pxelinux.cfg
vi default
DISPLAY boot.txt

DEFAULT nfsroot

LABEL install
        kernel debian/squeeze/amd64/linux
        append vga=normal initrd=debian/squeeze/amd64/initrd.gz  --
LABEL nfsroot
        kernel debian/squeeze/amd64/vmlinuz-2.6.32-3-amd64
        append vga=normal initrd=debian/squeeze/amd64/initrd.img-2.6.32-3-amd64  boot=nfs root=/dev/nfs \
nfsroot=192.168.1.50:/srv/nfs ip=192.168.1.71:192.168.1.50:192.168.1.50:255.255.255.0:debian:eth0 --
LABEL rescue
        kernel debian/squeeze/amd64/linux
        append vga=normal initrd=debian/squeeze/amd64/initrd.gz  rescue/enable=true --

PROMPT 1
TIMEOUT 0

オプションの詳細は /usr/share/doc/HOWTO/ja-txt/kernel-docs-2.6/nfsroot.txt.gz に書いてある。

cd ..
vi boot.txt
- Boot Menu -
=============

install
nfsroot
rescue
wget http://ftp.jaist.ac.jp/pub/Linux/Debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/pxelinux.0

mkdir -p debian/squeeze/amd64
cd debian/squeeze/amd64/

cp /boot//boot/initrd.img-2.6.32-3-amd64 .
cp /boot/vmlinuz-2.6.32-3-amd64 .

wget http://ftp.jaist.ac.jp/pub/Linux/Debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux
wget http://ftp.jaist.ac.jp/pub/Linux/Debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz


NFSルート用のDebianのインストール。

aptitude install debootstrap
mkdir /srv/nfs
debootstrap --arch amd64 squeeze /srv/nfs http://ftp.jp.debian.org/debian

aptitude install nfs-kernel-server
echo "/srv/nfs 192.168.1.0/24(rw,no_root_squash,no_subtree_check)" >> /etc/exports
/etc/init.d/nfs-kernel-server restart

chroot /srv/nfs
passwd


取り敢えずこれでネットワークブートからNFSのrootfsでログインできるようになった。
まだホストやネットワークの設定はできていないが、このままだとルートディレクトリがNFSなので、本当はrsyncでメモリ上にファイルをコピーしたい。


次は…
DSAS開発者の部屋:ディスクレスシステムの応用 〜 Linuxのインストール
DSAS開発者の部屋:止まらない仕組みを目指して(3) 〜 ディスクレスシステムの導入
この辺を参考に何かしよう。