とは言え、Linux と言えば、さほど知識も無く、まともに触っていたのは、学生時代に C言語の勉強でワークステーションで Unix を使っていたぐらいです。つまり素人ですね。
と言うわけで、色々なサイトを参考にしながら、まずは、玄箱に Debian を入れ、そして Samba3 にするのが当面の目標です。
- 玄箱うぉううぉう♪のサイトより、以下のファイルを入手する。
- debian_2006_06_10_dist.tgz
- write_ng.tgz
- "write_ng.tgz"を玄箱(KURO-BOX)に転送して、telnet でログインした上で、以下のコマンドを実行する。
- 玄箱(KURO-BOX-EM) に telnet でログオン('root'の'kuro')する。
- パーティションの作成
- パーティションの削除
- パーティションの作成
- Debian Linux を展開して、設定変更する。
- "debian_2006_06_10_dist.tgz"を ftp で、玄箱(KURO-BOX-EM)の"/mnt2/share"に転送する。
- Debian Linux を展開する。
- ネットワークの設定を変更する。
- EMモードから復帰させる。
- sources.list を serge に変更して、apt-get で serge にアップデートする。
- 各種インストール。
- etch化 および カーネル 2.6に変更。
- テンポラリ、ログの削除。
- 'sources.list' の変更。
- パッケージリストを更新します。
- sarge で必要なパッケージの一部と etch で必要なパッケージの一部が衝突するため、直接 aptitude dist-upgrade を実行すると、多くの場合、一時的に固定しておきたいパッケージが多数削除される結果となります。そのため、まずはこれらの競合状態を打開するための最小アップグレードを行い、その上で完全な dist-upgrade を行う、という 2 段階のアップグレード過程を踏むことをお勧めします。 'aptitude upgrade' には、アップグレードしても他のパッケージをインストール・削除する必要がないパッケージだけをアップグレードする、という効果があります。
- libc6 と locales が自動的にアップグレードされ、SELinux サポート用のライブラリ群 (libselinux1) が引きずられてインストールされます。この時点で、xdm や gdm、kdm などといった実行中のいくつかのサービスが再起動されます。
- ここでカーネルのアップグレードします。
- システムの完全なアップグレードを行います。
- ntp設定
- locale の設定
- sambaの導入
- syslog 出力を抑止。
- 20分毎の"--MARK--"書き込みを抑止。
- 'exim' を停止する。
- 'cron.hourly' を停止する。
# tar zxvf write_ng.tgz
# ./write_ng > /dev/fl3
# reboot
# ./write_ng > /dev/fl3
# reboot
# /sbin/mfdisk -e /dev/hda
delete partition 1
delete partition 2
delete partition 3
create partitions...
deleate all partitions.
The partition table has been altered!
Syncing disks.
delete partition 1
delete partition 2
delete partition 3
create partitions...
deleate all partitions.
The partition table has been altered!
Syncing disks.
# /sbin/mfdisk -c /dev/hda
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-30515, default 1): [ENTER]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-30515, default 30515): +40000M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (5101-30515, default 5101): [ENTER]
Using default value 5101
Last cylinder or +size or +sizeM or +sizeK (5101-30515, default 30515): +2000M>
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (5356-30515, default 5356): [ENTER]
Using default value 5356
Last cylinder or +size or +sizeM or +sizeK (5356-30515, default 30515): [ENTER]
Using default value 30515
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap)
Command (m for help): p
Disk /dev/hda: 255 heads, 63 sectors, 30515 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 5100 40965718+ 83 Linux
/dev/hda2 5101 5355 2048287+ 82 Linux swap
/dev/hda3 5356 30515 202097700 83 Linux
Command (m for help): w
The partition table has been altered!
Syncing disks.
# mke2fs -j /dev/hda1
mke2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09
Filesystem label=
OS type: Linux
(省略)
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# mkswap /dev/hda2
Setting up swapspace version 1, size = 2097438720 bytes
# /sbin/mke2fs -j -m 0 /dev/hda3
mke2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09
Filesystem label=
OS type: Linux
(省略)
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# /sbin/tune2fs -m 0 /dev/hda3
tune2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09
Setting reserved blocks percentage to 0 (0 blocks)
# /bin/mount -t ext3 /dev/hda1 /mnt
# /bin/mount -t ext3 /dev/hda3 /mnt2
# mkdir /mnt2/share
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-30515, default 1): [ENTER]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-30515, default 30515): +40000M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (5101-30515, default 5101): [ENTER]
Using default value 5101
Last cylinder or +size or +sizeM or +sizeK (5101-30515, default 30515): +2000M>
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (5356-30515, default 5356): [ENTER]
Using default value 5356
Last cylinder or +size or +sizeM or +sizeK (5356-30515, default 30515): [ENTER]
Using default value 30515
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap)
Command (m for help): p
Disk /dev/hda: 255 heads, 63 sectors, 30515 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 5100 40965718+ 83 Linux
/dev/hda2 5101 5355 2048287+ 82 Linux swap
/dev/hda3 5356 30515 202097700 83 Linux
Command (m for help): w
The partition table has been altered!
Syncing disks.
# mke2fs -j /dev/hda1
mke2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09
Filesystem label=
OS type: Linux
(省略)
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# mkswap /dev/hda2
Setting up swapspace version 1, size = 2097438720 bytes
# /sbin/mke2fs -j -m 0 /dev/hda3
mke2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09
Filesystem label=
OS type: Linux
(省略)
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# /sbin/tune2fs -m 0 /dev/hda3
tune2fs 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09
Setting reserved blocks percentage to 0 (0 blocks)
# /bin/mount -t ext3 /dev/hda1 /mnt
# /bin/mount -t ext3 /dev/hda3 /mnt2
# mkdir /mnt2/share
# cd /mnt
# tar xvzf /mnt2/share/debian_2006_06_10_dist.tgz
# tar xvzf /mnt2/share/debian_2006_06_10_dist.tgz
# vi /mnt/etc/network/interfaces
# vi /mnt/etc/hosts
# vi /mnt/etc/hosts.allow
# vi /mnt/etc/resolv.conf
# vi /mnt/etc/hosts
# vi /mnt/etc/hosts.allow
# vi /mnt/etc/resolv.conf
# echo -n 'OKOK' > /dev/fl3
# reboot
# reboot
# vi /etc/apt/sources.list
deb http://ftp.jp.debian.org/debian/ serge main contrib non-free
deb http://ftp.jp.debian.org/debian-volatile/ serge/volatile main contrib non-free
# apt-get update
# apt-get upgrade
# apt-get dist-upgrade
# apt-get upgrade
# apt-get dist-upgrade
# apt-get install ssh
# apt-get install sudo
# apt-get install wget
# apt-get install ntpdate
# apt-get install apt-spy
# apt-get install netselect
# apt-get install gcc
# apt-get install gnupg
# apt-get install sudo
# apt-get install wget
# apt-get install ntpdate
# apt-get install apt-spy
# apt-get install netselect
# apt-get install gcc
# apt-get install gnupg
# apt-get clean
# rm -rf /var/log/*
# rm -rf /var/log/*
# vi /etc/apt/sources.list
deb http://ftp.jp.debian.org/debian/ etch main contrib non-free
deb http://ftp.jp.debian.org/debian-volatile/ etch/volatile main contrib non-free
# aptitude update
# aptitude upgrade
# aptitude install initrd-tools
# wget http://www.genbako.com/kernelimage-2.6.25.1-kuroBOX.tgz
# wget http://www.genbako.com/modules-2.6.25.1-kuroBOX.tgz
# cd /boot
# tar xzvf /mnt/share/kernelimage-2.6.25.1-kuroBOX.tgz
# reboot
# wget http://www.genbako.com/modules-2.6.25.1-kuroBOX.tgz
# cd /boot
# tar xzvf /mnt/share/kernelimage-2.6.25.1-kuroBOX.tgz
# reboot
# apt-get install module-init-tools
# cd /lib/modules
# tar xzvf /mnt/share/modules-2.6.25.1-kuroBOX.tgz
# depmod -a
# cd /lib/modules
# tar xzvf /mnt/share/modules-2.6.25.1-kuroBOX.tgz
# depmod -a
# aptitude dist-upgrade
# vi /etc/default/ntpdate
# The settings in this file are used by the program ntpdate-debian, but not
# by the upstream program ntpdate.
# Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
# so you only have to keep it in one place.
NTPDATE_USE_NTP_CONF=no
# List of NTP servers to use (Separate multiple servers with spaces.)
# Not used if NTPDATE_USE_NTP_CONF is yes.
NTPSERVERS="ntp02.dion.ne.jp ntp03.dion.ne.jp"
# Additional options to pass to ntpdate
NTPOPTIONS=""
# vi /etc/cron.daily/ntpdate
#!/bin/sh
if [ ! -x /usr/sbin/ntpdate-debian ]; then
exit 0
fi
/usr/sbin/ntpdate-debian -s
# ntpdate-debian
17 Oct 23:48:16 ntpdate[1358]: adjust time server 210.251.0.16 offset 0.005805 sec
17 Oct 23:48:16 ntpdate[1358]: adjust time server 210.251.0.16 offset 0.005805 sec
# aptitude install locales
Locale is a framework to switch between multiple languages for users who can
select to use their language, country, characters, collation order, etc.
Choose which locales to generate. The selection will be saved to
`/etc/locale.gen', which you can also edit manually (you need to run `locale-gen'
afterwards).
When `All locales' is selected, /etc/locale.gen will be set as a symlink to
/usr/share/i18n/SUPPORTED.
Locales to be generated:
[*] ja_JP.EUC-JP EUC-JP
[*] ja_JP.UTF-8 UTF-8
Default locale for the system environment:
None
ja_JP.EUC-JP
ja_JP.UTF-8
# locale
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
# aptitude install samba
# vi /etc/samba/smb.conf
#======================= Global Settings =======================
[global]
dos charset = CP932
unix charset = UTF-8
display charset = UTF-8
## Browsing/Identification ###
[share]
path = /mnt/share
writable = yes
create mask = 0600
directory mask = 0700
# smbpasswd -a [ユーザー名]
# /etc/init.d/samba restart
Stopping Samba daemons: nmbd smbd.
Starting Samba daemons: nmbd smbd.
# smbstatus
Samba version 3.0.24
PID Username Group Machine
-------------------------------------------------------------------
Service pid machine Connected at
-------------------------------------------------------
No locked files
# /etc/init.d/samba restart
Stopping Samba daemons: nmbd smbd.
Starting Samba daemons: nmbd smbd.
# smbstatus
Samba version 3.0.24
PID Username Group Machine
-------------------------------------------------------------------
Service pid machine Connected at
-------------------------------------------------------
No locked files
# vi /etc/init.d/sysklogd
#! /bin/sh # /etc/init.d/sysklogd: start the system log daemon. PATH=/bin:/usr/bin:/sbin:/usr/sbin pidfile=/var/run/syslogd.pid binpath=/sbin/syslogd(中略)case "$1" in start) echo -n "Starting system log daemon: syslogd" create_xconsole start-stop-daemon --start --quiet --exec $binpath -- '''-m 0''' $SYSLOGD echo "." ;;(中略)restart) echo -n "Restarting system log daemon: syslogd" start-stop-daemon --stop --quiet --exec $binpath --pidfile $pidfile sleep 1 start-stop-daemon --start --quiet --exec $binpath -- '''-m 0''' $SYSLOGD echo "." ;; reload-or-restart) if running then echo -n "Reloading system log daemon: syslogd" start-stop-daemon --stop --quiet --signal 1 --exec $binpath --pidfile $pidfile else echo -n "Restarting system log daemon: syslogd" start-stop-daemon --start --quiet --exec $binpath -- '''-m 0''' $SYSLOGD fi echo "." ;; *) echo "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart}" exit 1 esac exit 0
# vi /etc/cron.d/exim
# /etc/cron.d/exim: crontab fragment for exim
# Run queue every 15 minutes
#08,23,38,53 * * * * mail if [ -x /usr/lib/exim/exim3 -a -f /etc/exim/exim.conf]; then /usr/lib/exim/exim3 -q ; fi
# Tidy databases
#13 6 * * * mail if [ -x /usr/sbin/exim_tidydb ]; then /usr/sbin/exim_tidydb /var/spool/exim retry >/dev/null; fi
#17 6 * * * mail if [ -x /usr/sbin/exim_tidydb ]; then /usr/sbin/exim_tidydb /var/spool/exim wait-remote_smtp >/dev/null; fi
# vi /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
#17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
# /etc/init.d/sysklogd restart
Restarting system log daemon: syslogd.
Restarting system log daemon: syslogd.