USBメモリからインストール

2008/8/8


重要

CD-ROM,DVD-ROMを使わないでDebian4.0をインストールする方法についてまとめる。
インストールにはUSBメモリ(256MB)を使用し、最低限必要なものだけをインストールする。

準備

USBメモリが/dev/sdgになっている。dmsg等で確認してもよい。
USB

USB

su -
wget http://ring.riken.jp/pub/linux/debian/debian/dists/etch/main/installer-i386/current/images/hd-media/
wget http://ftp.riken.jp/Linux/debian/debian-cd/4.0_r6/i386/iso-cd/debian-40r6-i386-netinst.iso
zcat boot.img.gz > /dev/sdg
ここでUSBメモリを一をUSBコネクタから外し、再びUSBコネクタに接続する。
umount/mountでもよい。
USB

USBメモリにインストールCDのイメージファイル(iso)をコピーする。
cp debian-40r6-i386-netinst.iso /media/Debian\ Inst

USBメモリはこのような内容になる。
USB

USBメモリからインストール

BIOS画面で、USBメモリからインストールできるように設定をする。
再起動後、USBメモリがディスクと同等に扱われ、Debianのインストールが始まる。
これ以降は、通常のDebianのインストール作業と同じになる。

インストール後の修正

/etc/apt/sorces.listを修正する。
#deb http://ftp.jp.debian.org/debian/ stable main contrib non-free
#deb-src http://ftp.jp.debian.org/debian/ stable main contrib non-free
deb http://cdn.debian.or.jp/debian/ stable main contrib non-free
deb-src http://cdn.debian.or.jp/debian/ stable main contrib non-free
deb http://security.debian.org/ stable/updates main contrib non-free
アップデートの対象を確認し、アップデート(upgrade)を実行する。
apt-get update
apt-get upgrade

基本的なセットアップ - ssh,ntp -

いろいろと操作する都合があるのでsshdを導入する。
クライアントからリモートでログインのためにopenssh-serverをインストールする。
インストール直後は、sshdは稼働していないので、起動プロセス/etc/init.d/sshを実行する。 OSを再起動した場合、sshdは自動起動する。
apt-get install openssh-server
apt-get install ssh
/etc/init.d/ssh start

後にデータベースを扱うため、ntpを導入し、時刻を日本標準時に同期させる。
ntpを実行する前に、ntpdateで時刻をあわせる。ntpサーバには適当なものを使用する。
インストール直後は、ntpdは稼働していないので、起動プロセス/etc/init.d/ntpを実行する。 OSを再起動した場合、ntpは自動起動する。
apt-get install ntpdate
ntpdate ntp.tohoku.ac.jp(適切なntpサーバを指定)
apt-get install ntp
/etc/init.d/ntp start
ntpq -p (ntpサーバおよび同期状態を表示)

基本的なセットアップ - PostgreSQL-8.1 -

sid0-6にリモートアクセスするためにPostgreSQL8.1をインストールする。
Postgresqlはインストール後すぐに起動する。
apt-get install postgresql-8.1
apt-get install postgresql-contrib-8.1 
/etc/postgresql/8.1/main/pg_hba.confにlocalhostからのアクセス許可が記述されて入れる(localhost all all trust)ことを確認する。
ネットワーク経由でデータベースにアクセスするときは、ここに追記する。
データベースユーザの設定を有効にするため、PostgreSQLを再起動する。
su -
/etc/init.d/postgresql-8.1 restart

C言語開発環境とライブラリ

C言語でPostgreSQLを操作するための開発環境を用意する。
apt-get install gcc
apt-get install libpqxx-2.6.8
apt-get install postgresql-dev