logo
code:Haemophilus influenzae

ここに書かれていることは無保証です。同じことを行って問題が発生しても、 龍義は責任をとりません。

2003年10月28日

戻る

OpenBSD 3.3 のインストール(フロッピーのないマシンで)

boot cd の作成をして、インストールした。
windows2000 との dual boot を行う、少々不安ながら、無事、
インストールは完了したのだが、起動ができない。 そんな概略を(無保証です)。

1、CD-ROM の作成
OpenBSD のファイルをダウンロードした。ミラーは各地にあるので、
早いところから。私は ftp://ftp.jp.openbsd.org/pub/OpenBSD/3.3/i386/ から
ダウンロードした。

ファイルを全てダウンロードしたら、 mkisofs をダウンロード。
http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html
から Cdrecord ダウンロードして、実行できる適当な場所に置く。

(HOME/openbsd というディレクトリにダウンロードしたものを置いて、
mkisofs を実行したのだけど、 3.3/i386 というディレクトリだと
デフォルト状態で便利)

# bin/mkisofs -l -J -r -o openbsd33.iso -b cdrom33.fs -V "OpenBSD3.3" openbsd

これで、 iso イメージの完成。これを B's GOLD5 で CD に焼いた。しかし、
B's GOLD って使いにくいなぁ。

2、インストール

作成した CD-ROM を入れて、マシンの起動。

(I)nstall, (U)pgrade or (S)hell? i
Terminal type? [vt220] そのままリターン
Do you wish to select a keyboard encoding table? [n] そのままリターン
Proceed with install? [n] y y にしないとインストールできない

この後は、少々面倒。

Available disks are: wd0.
Which one is the root disk? (or 'done') [wd0] そのままリターン
Do you want to use *all* of wd0 for OpenBSD? [no] そのままリターン
〜ちょっと省略〜
Disk: wd0 geometry: 4865/255/63 [78156225 Sectors]
Offset: 0 Signature: 0xAA55
         Starting       Ending       LBA Info:
# : id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
*0: 07    0   1  1 - 1305 254 63 [          63:    20980827 ] HPFS/QMX/AUX
 1: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 3: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
Enter 'help' for information
fdisk: 1> edit 1
         Starting       Ending       LBA Info:
# : id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
 1: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
Partition id('0' to disable)  [0 -- FF]: [0] (? for help) a6
Do you wish to edit in CHS mode? [n] y
BIOS Starting cylinder [0 - 4864]: [0] 1306
BIOS Starting head [0 - 254]: [0]そのままリターン
BIOS Starting sector [1 - 63]: [1]そのままリターン
BIOS Ending cylinder [0 - 4864]: [0] 4864
BIOS Ending head [0 - 254]: [0] 254
BIOS Ending sector [1 - 63]: [0] 63
fdisk:*1> print
Disk: wd0 geometry: 4865/255/63 [78156225 Sectors]
Offset: 0 Signature: 0xAA55
         Starting       Ending       LBA Info:
# : id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
*0: 07    0   1  1 - 1305 254 63 [          63:    20980827 ] HPFS/QMX/AUX
 1: 00 1306   0  1 - 4864 254 63 [    20980890:    57175335 ] OpenBSD
 2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 3: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
fdisk:*1> w
fdisk:*1> q

You will now create an OpenBSD disklabel inside the OpenBSD MBR
partition. You disklabel defines how OpenBSD splits up the MBR partition
into OpenBSD partitions in which filesystems and swap space are created.

The offsets used in the disklabel are ABSOLUTE, i.e. relative to the
start of the disk, NOT the start of the OpenBSD MBR partition.

disklabel: no disk label
WARNING: Disk wd0 has no label. You will be creating a new one.

# using MBR partition 1: type A6 off 20980890 (0x140249a) size 57175335 (0x3686
27)

Treating sectors 20980890-78156225 as the OpenBSD portion of the disk.
You can use the 'h' command to change this.
> d a
> a a
offset: [20980890]そのままリターン
size: [57175335] 256M
Rounding to nearest cylinder; 523782
FS type: [4.2BSD]そのままリターン
mount point: [none] /
> a b
offset: [21504672]そのままリターン
size: [56651553] 256M
Rounding to nearest cylinder; 524160
FS type: [swap]そのままリターン
> a d
offset: [22028832]そのままリターン
size: [56127393] 1024M
Rounding to nearest cylinder; 2097648
FS type: [4.2BSD]そのままリターン
mount point: [none] /tmp
> a e
offset: [24126480]そのままリターン
size: [54029745] 2048M
Rounding to nearest cylinder; 4194288
FS type: [4.2BSD]そのままリターン
mount point: [none] /var
> a f
offset: [28320768]そのままリターン
size: [49835457] 4096M
Rounding to nearest cylinder; 8388576
FS type: [4.2BSD]そのままリターン
mount point: [none] /usr
> a g
offset: [36709344]そのままリターン
size: [41446881] 2048M
FS type: [4.2BSD]そのままリターン
mount point: [none] /home
> p m
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: WDC WD400AB-32CM
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total sectors: 78165360
free sectors:56651553
rpm: 3600

16 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:   255.8M 10244.6M    4.2BSD     1024 8192     16  # /
  b:   255.9M 10500.3M     swap
  c: 38166.7M     0.0M    unused        0    0
  d:  1024.2M 10756.3M    4.2BSD     1024 8192     16  # /tmp
  e:  2048.0M 11780.5M    4.2BSD     1024 8192     16  # /var
  f:  4096.0M 13828.5M    4.2BSD     1024 8192     16  # /usr
  g: 20237.7M 17924.5M    4.2BSD     1024 8192     16  # /home
  i: 10244.5M     0.0M   unknown
> w
> q
No label changes.
The root filesystem will be mounted on wd0a.
wd0b will be used for swap space.
Mount point for wd0d (size=1048824k)? (or 'none' or 'done') [/tmp] done
Done - no available disks found.

You have configured the following partitions and mount points:

wa0a /
wa0d /tmp
wa0e /var
wa0f /usr
wa0g /home

The next step creates a filesystem on each partition, ERASING existing data,
Are you really sure that you're ready to proceed? [n] y
Warning: 378 sector(s) in last cylinder unallocated
/dev/rwd0a:     523782 sectors in 520 cylinders of 16 tracks, 63 sectors
        255.8MB in 33 cyl groups (16 c/g, 7.88MB/g, 1920 i/g)
〜長いので略〜
/dev/wd0e on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Tu
e Oct 28 13:49:46 2003)

System hostname? (short form, e.g. 'foo') naboo
Configure the network? [y]そのままリターン
Available interfaces are: sis0.
Which one do you wish to initialize? (or 'done') [sis0]そのままリターン
Symbolic (host) name for sis0? [naboo]そのままリターン
The defaulet media for sis0 is
        media: Ethernet autoselect (100baseTX full-duplex)
Do you want to change the default media? [n]そのままリターン
IP address for sis0? (or 'dhcp') 192.168.0.68
Netmask? [255.255.255.0]そのままリターン
Done - no available interfaces found.
DNS domain name? (e.g. 'bar.com') [my.domain] tatsuyoshi.net
DNS nameserver? (IP address or 'none') [none] 192.168.0.1
Use the nameserver now? [y]そのままリターン
Default route? (IP address, 'dhcp' or 'none') 192.168.0.1
add net default: gateway 192.168.0.1
Edit hosts with ed? [n]そのままリターン
Do you want to do any manual network configuration? [n]そのままリターン
Password for root account? (will not echo)rootのパスワードを入力
Password for root account? (again)rootのパスワードを入力

You will now specify the location and names of the install sets you want to
load. You will be able to repeat this step until all of your sets have been
successfully loaded. If you are not sure what sets to install, refer to the
installation notes for details on the contents of each.

Sets can be located on a (m)ounted filesystem; a (c)drom, (d)isk or (t)ape
device; ot a (f)tp, (n)fs or (h)ttp server.
Where are the install sets? (or 'done') c
Available CD-ROMs are: cd0.
Which one contains the install media? (or 'done') [cd0]そのままリターン

Pathname to the sets? (or 'done') [3.3/i386] /

The following sets are available. Enter a filename, 'all' to select
all the sets, or 'dine'. You may de-delect a set by prepending a '-'
to its name.

        [X] bsd
        [ ] bsd.rd
        [X] base33.tgz
        [X] etc33.tgz
        [X] misc33.tgz
        [X] comp33.tgz
        [X] man33.tgz
        [X] game33.tgz
        [ ] xbase33.tgz
        [ ] xshare33.tgz
        [ ] xfont33.tgz
        [ ] xserv33.tgz

File name? (or 'done') [bsd.rd] done
Ready to install sets? [y]そのままリターン
Getting bsd ...
〜長いので省略〜
What timezone are you in? ('?' for list) [US/Pacific] Japan
Making all device nodes...done.
Installing boot block...
boot: /mnt/boot
proto: /usr/mdec/biosboot
device: /dev/rwd0c
/usr/mdev/biosboot: entry point 0
proto bootblock size 512
room for 12 filesystem blocks at 0x16f
Will load 7 blocks of size 8192 each.
Using disk geometry of 63 sectors and 255 heads.
 0:  7 @(1306 152 57) (20990522-20990528)
 2: 63 @(1306 153 1) (20990529-20990591)
 3: 26 @(1306 154 1) (20990592-20990617)
 0: 16 @(1306 8 47) (20981440-20981455)
/mnt/boot: 4 entries total
using MBR partition 1: type 166 (0xa6) offset 20980890 (0x140249a)
 ...done.

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter halt at the command prompt. Once the
system has halted, reset the machine and boot from the disk.
# halt


3、起動させる
CD-ROM を挿入し、起動直後の選択画面で shell を選択した。ネットワークを
有効にするため、
ifconfig sis0 up
dhclient
を実行した。ネットワークが有効になったので、

dd if=/dev/rwd0a of=openbsd.pbr bs=512 count=1

と dd を実行した。

---関係ない話---
vsftpd の設定
いつぞやに、rpm で vsftpd をインストールしたようなのだが、
中途半端な状態だったので、動作させることにする(redhat9)。
/etc/xinetd.d/ftpd の設定で

        disable                 = no

を行った。xinetd は起動しているのに、うまく接続できない。
ログを見ると、

Oct 28 16:58:25 kashyyyk xinetd[833]: service/protocol combination not in /etc/services: ftpd/tcp

/etc/xinetd.d/ftpd の内容が悪いようである。

service ftpd

になっていたので、

service ftp

に修正。しかし、これは誰の仕業だ?私か…?

[root@kashyyyk xinetd.d]# ftp localhost
Connected to localhost (127.0.0.1).
220 (vsFTPd 1.1.3)
Name (localhost:toyota): test
530 This FTP server is anonymous only.
Login failed.
ftp> quit
221 Goodbye.

今度は anonymous でしかログインできない設定のようである。
設定ファイル /etc/vsftpd/vsftpd.conf をいじっても、うまく
反映されない。

/etc/xinetd.d/ftpd

に以下の行を加える。

server_args=/etc/vsftpd/vsftpd.conf

xinetd を再起動したら、エラーが出た。スペースが必要らしい。
  server_args = /etc/vsftpd/vsftpd.conf
と適当にスペースを加えて、 xinetd の再起動。

C:¥>ftp kashyyyk
Connected to kashyyyk.
500 OOPS: could not bind listening socket
Connection closed by remote host.

となる。 hosts.allow の設定をしても駄目だったので、
vsftpd のソースをダウンロードしてきて、 grep をしてみる。
vsftpd-1.2.0/EXAMPLE/INTERNET_SITE_NOINETD/README
に記述があったので、内容を読む。
# Standalone mode
listen=YES
と standalone mode になっていて、 xinetd から起動の設定になってない
理由のようであるので、この行を削除すると、うまく動いた。かなり、
時間を食ってしまった。

---関係ない話、ここまで---

openbsd.pbr を ftp で別のサーバに送信して、 windows で起動しなおし。
起動したら、またそのファイルを ftp で取りに行った。
C:¥openbsd.pbr において、 C:¥boot.ini の編集。

C:¥openbsd.pbr="OpenBSD3.3"

を追加して、起動してみる。

Bad magic

と出て止まってしまう。調べたら…

http://www.openbsd.org/faq/ja/faq14.html#LargeDrive

boot 領域は先頭の 8G に置かなければならないらしい(涙)。
11月1日リリース予定の 3.4 のリリースノートを見ても、対応されたとの
記述はないようである。とりあえず、放置。


by Tatsuyoshi
since 2003