トップ 履歴 一覧 カテゴリ ソース 検索 ヘルプ RSS ログイン

OpenBSD/Install/39-i386

INDEX

OpenBSDのインストール

OpenBSDというのは、FreeBSDやNetBSDと並ぶ、オープンソース系のBSD Unix類の1つです。いちばんの特徴としては、セキュリティを重視しているということが挙げられる。

FreeBSDの日本語ドキュメント類はあるのですが、OpenBSDはなかなか無いので、OpenBSD 3.63.9をCD-ROMからi386アーキテクチャのプラットフォームマシン(一般のPC)にインストールした際のメモ書き。OpenBSDのインストールは、テキストベースのインストーラにより行う。

i386プラットフォームでは、Floppy,CD-ROM,network からブートが可能。また、インストールするデータは、CD-ROM,FTP,HTTP,ローカルHDパーティション,NFS等からデータを取得する。

CDから起動して、インストールするのが、スタンドアローンで出来るし楽で良いかと…。CD-ROMは、OpenBSDオフィシャルのサイトから購入する。イメージファイルは配布されていない。

※2006/08/30 OpenBSD 3.9 に変更。一部の処理が変更されている

Bootable CD-ROM の作成

ブート可能なCD-ROMのイメージでの配布はされてませんので、寄付の意味もありますので素直にCDを購入しましょう!

……では、みもふたもないので…。ブートしインストール出来る必要最低限で作ってみる…。

 1.ワークディレクトリを作成

イメージを作るための作業場所を作成する。

mkdir OpenBSD39
cd OpenBSD39
mkdir 3.9
mkdir 3.9/i386

 2.FTPサイトから必要なデータを取得

FTPサイトから OpenBSD/3.9/i386 配下を、ディレクトリ構成崩さずに取得する。ソースファイルが必要なら、OpenBSD/3.9/*.tar.gz のファイルも一緒に取得する。

ftp ftp.jp.openbsd.org
cd /pub/OpenBSD/
bin
mget 3.9/i386/*
mget 3.9/*.tar.gz
bye

 3.イメージを作成

ワークディレクトリ配下を階層構造、ファイル名とはそのまま、mkisofsを使いイメージ作成する。また、ブートできるように、ブートイメージを指定する。ボリュームラベル等は、適当に。

cd ..
mkisofs -b 3.9/i386/cdrom39.fs -R -V "OpenBSD 3.9" -o OpenBSD39.iso OpenBSD39/

 4.CD-Rに焼く

作成したイメージをCD-Rに焼く。

インストールの開始

インストールを始めるまで。

 1.インストーラの起動

マシンの電源を入れて、CDをセットします。ブートメッセージやシステム情報がずらずらと表示されてきますので起動し終わるまで待つ。最近のマシンならCD BOOTは対応してると思う、起動できない場合は、BIOSの設定を確認する。FD等からのブートにする。

インストールするか、アップデートするかを聞かれるので、インストールを選択する。

erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? i{Enter}

 2.ようこそ

インストールを選ぶと以下のようなメッセージが表示される。

Welcome to the OpenBSD/i386 3.9 install program.

This program will help you install OpenBSD in a simple and rational way. At
any prompt except password prompts you can run a shell command by typing
'!foo', or escape to a shell by typing '!'. Default answers are shown in []'s
and are selected by pressing RETURN. At any time you can exit this program by
pressing Control-C and then RETURN, but quitting during an install can leave
your system in an inconsistent state.

 3.ターミナルタイプの設定

端末の種類を聞かれる。デフォルトで良いのでそのまま次に進める。

Terminal type? [vt220] {Enter}

 4.キーボードの設定 (3.6)

キーボードテーブルの設定をするか聞かれるので、日本語に変更する。

Do you wsih to select a keyboard encoding table? [no] yes{Enter}
Select your keyboard type: (P)C-AT/XT, (U)SB or 'doen' [P] P{Enter}
The available keyboard encoding tables are:

        be br de dk es fr it jp lt no pt ru sf sg sv ua uk us

Table name? (or 'doen') [us] jp{Enter}

 4.キーボードの設定 (3.9)

キーボードマッピングを設定する。

kbd(8) mapping? ('L' for list) [none] L {Enter}
Major tables: be br cf de dk es fr hu it jp la lt nl no pl pt ru sf sg si sv tr
ua uk us
kbd(8) mapping? ('L' for list) [none] jp {Enter}
kbd: keyboard mapping set to jp

 5.確認

本当にインストールして良いか聞かれるので、YESを入力する。

IS YOUR DATA BACKED UP? As with anything that modifies disk contents, this
program can cause SIGNIFICANT data loss.

It is often helpful to have the installation notes handy. For complex disk
configurations, relevant disk hardware manuals and a calculator are useful.

Proceed with install? [no] yes{Enter}

ディスクの設定

ハードディスクのパーティション設定、フォーマット、マウント設定

 1.ディスクの選択

インストール先のディスクを選ぶ。IEDの1番目ならwd0、SCSIの1番目ならsd0にする。2番目以降は、wd1,wd2…のようになる。

Cool!  Let's get to it...

You will now initialize the disk(s) that OpenBSD will use. To enable all
available security features you should configure the disk(s) to allow the
creation of separate filesystems for /, /tmp, /var, /usr, and /home.

Available disks are: wd0.
Which one is the root disk? (or done) [wd0] {Enter}

※3.6:さらに、ディスク全体をOpenBSDで使用するかを聞かれる。他のOSがあるので今回はそのまま次へ。

Do you want to use *all* of wd0 for OpenBSD? [no] {Enter}

※3.9:全体を使用するので、YESを入力する。

Do you want to use *all* of wd0 for OpenBSD? [no] yes {Enter}
Putting all of wd0 into an active OpenBSD MBR partition (type 'A6')...wd0: no d
sk label
done.

You will now create an OpenBSD disklabel inside the OpenBSD MBR
partition. The 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.

# Inside MBR partition 3: type A6 start 63 size 33543657

Treating sectors 63-33543720 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.

Initial label editor (enter '?' for help at any prompt)
>

 2.パーティションの作成(旧)

インストール先のディスクのパーティションを作成/設定する。fdisk(8) が立ち上がるので必要に応じて切り分ける。上記でディスク全体を使用するようにした場合は、この処理は行われない。

You will now create a single MBR partition to contain your OpenBSD data. This
partition must have an id of 'A6'; must *NOT* overlap other partitions; and
must be marked as the only active partition.

The 'manual' command describes all the fdisk commands in detail.

Disk: wd0       geometry: 4864/255/63 [78140160 Sectors]
Offset: 0       Signature: 0xAA55
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
 0: 0B    1   0  1 -  693 254 63 [       16065:    11133045 ] Win95 FAT32
*1: A6  694   0  1 - 2648 254 63 [    11149110:    31407075 ] OpenBSD
 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(8) を終了する。

fdisk:*1> f 1
Partition 1 marked active.
fdisk:*1> p
Disk: wd0       geometry: 4864/255/63 [78140160 Sectors]
Offset: 0       Signature: 0xAA55
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
 0: 0B    1   0  1 -  693 254 63 [       16065:    11133045 ] Win95 FAT32
*1: A6  694   0  1 - 2648 254 63 [    11149110:    31407075 ] 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
Writing MBR at offset 0.
wd0: no disk label
fdisk: 1> q

 3.ラベルエディタ(旧)

ラベルエディタが起動するので、BSD流のパーティションを切ります。

Here is the partition information you chose:

Disk: wd0       geometry: 4864/255/63 [78140160 Sectors]
Offset: 0       Signature: 0xAA55
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
 0: 0B    1   0  1 -  693 254 63 [       16065:    11133045 ] Win95 FAT32
*1: A6  694   0  1 - 2648 254 63 [    11149110:    31407075 ] OpenBSD
 2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 3: 00    0   0  0 -    0   0  0 [           0:           0 ] unused

You will now create an OpenBSD disklabel inside the OpenBSD MBR
partition. The 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 11149110(0xaa1f36) size 31407075  (0x1df3bec)

Treating sectors 11149110-42556185 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.

Initial label editor (enter '?' for help at any prompt)
>  

 3.ラベルエディタ(新)

ラベルエディタが起動するので、BSD流のパーティションを切ります。

パーティションの内訳はこんな感じ…。深く考えていないので適当。/usr配下のは目安
パーティション マウント サイズ 備考
wd0a / 512M 普通はもっと少なくて良いらしい
wd0b (swap) 512M 昔はメモリの2-3倍だったけど…
/tmp 0M 今回はRAMをディスクに割り当て
wd0d /var 3G インストール直後は10M未満
wd0e /usr 3G インストール直後は400M
/usr/src/sys カーネル コンパイル後で100M
/usr/src バイナリソース コンパイル後で600M
/usr/obj バイナリオブジェ コンパイル後で800M
/usr/ports portsソース ソース展開後で130M
/usr/XF4 XF4ソース ソース展開後で340M
wd0f /home 8.8G 残り全部
wd0 (合計) 16G

とりあえず、現状を表示する。'c'(全体)以外のパーティションが存在する場合は、「d x」でクリアする。

Initial label editor (enter '?' for help at any prompt)
> p {Enter}
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: Virtual HD
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total sectors: 33554304
free sectors: 33543657
rpm: 3600

16 partitions:
#             size        offset  fstype [fsize bsize  cpg]
  c:      33554304             0  unused      0     0
>

各パーティションを割り当て、変更を確定する。

> a a {Enter}
offset: [63] {Enter}
size: [33543657] 512M {Enter}
Rounding to nearest cylinder: 1048257
FS type: [4.2BSD] {Enter}
mount point: [none] / {Enter}
> a b {Enter}
offset: [1048320] {Enter}
size: [32495400] 512M {Enter}
Rounding to nearest cylinder: 1048320 {Enter}
FS type: [swap] {Enter}
> a d {Enter}
offset: [2096640] {Enter}
size: [31447080] 3G {Enter}
Rounding to nearest cylinder: 6291936
FS type: [4.2BSD] {Enter}
mount point: [none] /var {Enter}
> a e {Enter}
offset: [8388576] {Enter}
size: [25155144] 3G {Enter}
Rounding to nearest cylinder: 6291936
FS type: [4.2BSD] {Enter}
mount point: [none] /usr {Enter}
> a f {Enter}
offset: [14680512] {Enter}
size: [18863208] {Enter}
FS type: [4.2BSD] {Enter}
mount point: [none] /home {Enter}
> p {Enter}
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: Virtual HD
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total sectors: 33554304
free sectors: 0
rpm: 3600

16 partitions:
#             size        offset  fstype [fsize bsize  cpg]
  a:       1048257            63  4.2BSD   2048 16384   16 # /
  b:       1048320       1048320    swap
  c:      33554304             0  unused      0     0
  d:       6291936       2096640  4.2BSD   2048 16384   16 # /var
  e:       6291936       8388576  4.2BSD   2048 16384   16 # /usr
  f:      18863208      14680512  4.2BSD   2048 16384   16 # /home
> q {Enter}
Write new label?: [y] y {Enter}

ラベルエディタを終了したらマウントポイントの確認が出るので一通り確認してdoneを入力し終了。

Mount point for wd0d (size=3145968k)? (or 'none' or 'done') [/var] {Enter}
Mount point for wd0e (size=3145968k)? (or 'none' or 'done') [/usr] {Enter}
Mount point for wd0f (size=9431604k)? (or 'none' or 'done') [/home] {Enter}
Mount point for wd0d (size=3145968k)? (or 'none' or 'done') [/var] done {Enter}

 4.フォーマット

それぞれのパーティションがフォーマットされる。

No more disks to initialize.

OpenBSD filesystems:
wd0a /
wd0d /var
wd0e /usr
wd0f /home

The next step *DESTROYS* all existing data on these partitions!
Are you really sure that you're ready to proceed? [no] y {Enter}
/dev/rwd0a:     1048256 sectors in 1040 cylinders of 16 tracks, 63 sectors
        511.8MB in 4 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
/dev/rwd0d:     6291936 sectors in 6242 cylinders of 16 tracks, 63 sectors
        3072.2MB in 20 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
/dev/rwd0e:     6291936 sectors in 6242 cylinders of 16 tracks, 63 sectors
        3072.2MB in 20 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
/dev/rwd0f:     18863208 sectors in 18714 cylinders of 16 tracks, 63 sectors
        9210.6MB in 58 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
        9210.6MB in 58 cyl groups (328 c/g, 161.44MB/g, 20608 i/g)
/dev/wd0a on /mnt type ffs (rw, asynchronous, local, ctime=Wed Aug 30 00:41:47
006)
/dev/wd0f on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid, ctime=
ed Aug 30 00:41:47 2006)
/dev/wd0e on /mnt/usr type ffs (rw, asynchronous, local, nodev, ctime=Wed Aug 3
 00:41:47 2006)
/dev/wd0d on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid, ctime=W
d Aug 30 00:41:47 2006)

ホスト設定

 1.ホスト名の設定

マシンのホスト名を設定する。

System hostname? (short form, e.g. 'foo') vm-pub-srv {Enter}

 2.ネットワークの設定

ネットワークの設定を行うか聞かれるので、YESを入力する。

Configure the network? [yes] {Enter}

ネットワークカードの選択

Available interfaces are: de0.
Which one do you wish to initialize? (or 'done') [de0] {Enter}
Symbolic (host) name for de0? [vm-pub-srv] {Enter}
The media options for de0 are currently
        media: Ethernet autoselect (100baseTX)
Do you want to change the media options? [no] {Enter}

IPv4のネットワークアドレスを設定する。

IPv4 address for de0? (or 'none' or 'dhcp') 192.168.0.252 {Enter}

IPv4のネットワークマスクを設定する。

Netmask? [255.255.255.0] {Enter}

IPv6のネットワークアドレスを設定する。

IPv6 address for de0? (or 'rtsol' or 'none') [none] {Enter}
No more interfaces to initialize.

ドメイン名を設定する。

DNS domain name? (e.g. 'bar.com') [my.domain] moon.net {Enter}

ネームサーバ(DNS)のアドレスを設定する。

DNS nameserver? (IP address or 'none') [none] 192.168.0.1 {Enter}

ネームサーバ(DNS)を使用するか聞かれるので、YESを入力する。

Use the nameserver now? [yes] {Enter}

IPv4のデフォルトゲートウエイを指定する。

Default IPv4 route? (IPv4 address, 'dhcp' or 'none') 192.168.0.1 {Enter}
add net default: gateway 192.168.0.1

hostsファイルは編集しないので'no'で。

Edit hosts with ed? [no] {Enter}

マニュアル設定はしないので、'no'で。

Do you want to do any manual network configuration? [no] {Enter}

 3.管理者パスワードの設定

rootのパスワードを設定します。入力した文字は実際は表示されません。

Password for root account? (will not echo) *** {Enter}
Password for root account? (again) *** {Enter}

インストール

インストール開始

 1.ファイル・セットの選択

Let's install the sets!
Location of sets? (cd disk ftp http or 'done') [cd] {Enter}
Available CD-ROMs are: cd0.
Which one contains the install media? (or 'done') [cd0] {Enter}
Pathname to the sets? (or 'done') [3.9/i386] {Enter}

Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-' to the set name, file name pattern or 'all'. Selected
sets are labelled '[X]'.

        [X] bsd
        [X] bsd.rd
        [ ] bsd.mp
        [X] base39.tgz
        [X] etc39.tgz
        [X] misc39.tgz
        [X] comp39.tgz
        [X] man39.tgz
        [X] game39.tgz
        [ ] xbase39.tgz
        [ ] xetc39.tgz
        [ ] xshare39.tgz
        [ ] xfont39.tgz
        [ ] xserv39.tgz
Set name? (or 'done') [bsd.mp] done {Enter}

 2.ファイル・セットのインストール

Ready to install sets? [yes] {Enter}
Getting bsd ...
100% |**************************************************|  5332 KB    00:01
Getting bsd.rd ...
100% |**************************************************|  4622 KB    00:01
Getting base39.tgz ...
100% |**************************************************| 39523 KB    00:36
Getting etc39.tgz ...
100% |**************************************************|  1126 KB    00:01
Getting misc39.tgz ...
100% |**************************************************|  2222 KB    00:02
Getting comp39.tgz ...
100% |**************************************************| 73524 KB    01:00
Getting man39.tgz ...
100% |**************************************************|  7258 KB    -18:-36
Getting game39.tgz ...
100% |**************************************************|  2538 KB    00:01
Location of sets? (cd disk ftp http or 'done') [done] done {Enter}

 3.SSHデーモンの設定

Start sshd(8) by default? [yes] {Enter}

 4.NTPデーモンの設定

Start ntpd(8) by default? [no] {Enter}

 5.X Window Systemの設定

Do you expect to run the X Window System? [yes] no {Enter}

 6.コンソールの設定

Change the default console to com0? [no] {Enter}
Saving configuration files...done.
Generating initial host.random file...done.

 7.タイムゾーンの設定

What timezone are you in? ('?' for list) [Canada/Mountain] ?
Africa/      Chile/       GB-Eire      Israel       NZ-CHAT      UCT
America/     Cuba         GMT          Jamaica      Navajo       US/
Antarctica/  EET          GMT+0        Japan        PRC          UTC
Arctic/      EST          GMT-0        Kwajalein    PST8PDT      Universal
Asia/        EST5EDT      GMT0         Libya        Pacific/     W-SU
Atlantic/    Egypt        Greenwich    MET          Poland       WET
Australia/   Eire         HST          MST          Portugal     Zulu
Brazil/      Etc/         Hongkong     MST7MDT      ROC          posix/
CET          Europe/      Iceland      Mexico/      ROK          posixrules
CST6CDT      Factory      Indian/      Mideast/     Singapore    right/
Canada/      GB           Iran         NZ           Turkey       zone.tab
Canada/      GB           Iran         NZ           Turkey       zone.tab
What timezone are you in? ('?' for list) [Canada/Mountain] Japan {Enter}
Setting local timezone to 'Japan'...done.
Making all device nodes...done.
Installing boot block...
boot: /mnt/boot
proto: /usr/mdec/biosboot
device: /dev/rwd0c
/usr/mdec/biosboot: entry point 0
proto bootblock size 512
/mnt/boot is 3 blocks x 16384 bytes
fs block shift 2; part offset 63; inode block 104, offset 16552
using MBR partition 3: type 166 (0xa6) offset 63 (0x3f)
done.

 8.完了

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.
#

リブートします。

#reboot

最終更新時間:2019年10月21日 16時06分25秒 指摘や意見などあればSandBoxのBBSへ。