OpenBSD 4.2安装指南(2)

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

4.5.2 - 设置磁盘

重要提示:使用超大磁盘的用户请先看这一节。所谓超大磁盘,是指那些比使用它的计算机出厂时生产的一般磁盘容量要大的那些磁盘。

OpenBSD 在各种平台下设置磁盘是有一点差异的. 对于 i386,amd64,macppc,zaurus和armish,设置磁盘只有两个步骤. 首先, OpenBSD 占用的slice是由 fdisk(8) 来划分的, 然后这块 slice 再由 disklabel(8) 二次划分成 OpenBSD 分区 .

一些用户可能会对这里的一些专用术语感到有点困惑. 在这里会看到我们用的 "partition" 一词有两种意思. 这个发现是正确的. 在 OpenBSD 平台下的分区有两层, 第一层, 我们可以认为是操作系统分区, 就是各种操作系统标识在硬盘上哪块空间是属于他们的, 第二层就是 OpenBSD 下二次划分为独立文件系统的分区. 第一种是能作为一块硬盘分区被 DOS, Windows, 或其它使用这种分布格式的操作系统所识别的. 而第二层分区只能被 OpenBSD 和那些能直接读取 OpenBSD 文件系统的的操作系统所识别.

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

root disk 就是系统将会启动的那个盘, 通常也是交换分区所在的那块硬盘. IDE 硬盘一般会被标识为 wd0, wd1, 等., SCSI 硬盘 RAID 设备会被标识为 sd0, sd1, 依此类推. 所有 OpenBSD 能识别出来的硬盘都会被罗列在这里 -- 如果你的驱动器没有被识别出来, 那你的设备应该是没有获得支持或者你对硬件进行了错误的配置.

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

如果你对这个问题回答 "yes" , 那么整块硬盘都会被 OpenBSD 占据. 这样子就会建立一个标准的 Master Boot Record ,分区表也会被写入硬盘 -- 这块分区的大小就是整块硬盘的大小, 并会被设定为 OpenBSD 的分区类型和标示为启动分区. 对于大多数使用 OpenBSD 的机器这是最常用的选择; 然而, 对于有些系统我们就不能这样做了. 许多 Compaq 的系统, 许多 laptops, 一些 Dell机型以及其它机器,他们使用 "maintenance" 或者 "Suspend to Disk" 类型的分区,这些分区应该被完整保留. 如果你的机器上还有其它类型的分区而你不想擦除它, 在以上的问题不要回答 "yes" .

下面的例子我们就来假设一下,这块硬盘将会被 OpenBSD 和 已有的 windows 2000 所共享, 所以我们选择 "no", 这样我们就会进入 fdisk(8) .

你在这里也能获得更多的关于 fdisk(8) 信息.

注意:如果你对上面的问题回答了"Y",或者你的硬件平台不使用fdisk(如sparc64),你将不会经历这一步骤,而是直接转入"创建disklebel"一节。

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: 
2586 / 240 / 63  [ 39100320  Sectors]
Offset: 
0  Signature:  0xAA55
Starting Ending LBA Info:
#: id C H S 
-  C H S [ start: size ]
------------------------------------------------------------------------
* 0 : 0B  0   1   1   -   202   239   63  [  63 3069297  ] Win95 FAT - 32
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 >  help
help Command help list
manual Show entire OpenBSD man page 
for  fdisk
reinit Re
- initialize loaded MBR (to defaults)
setpid Set the identifier of a given table entry
disk Edit current drive stats
edit Edit given table entry
flag Flag given table entry 
as  bootable
update Update machine code 
in  loaded MBR
select Select extended partition table entry MBR
swap Swap two partition entries
print Print loaded MBR partition table
write Write loaded MBR to disk
exit Exit edit of current MBR, without saving changes
quit Quit edit of current MBR, saving current changes
abort Abort program without saving current changes
fdisk: 
1 >

这里的一些命令是有必要解释一下的:

* r or reinit: 清除现存的分区表, 使用整个硬盘建立一个 OpenBSD 分区, 将其标示为可启动, 并且写入 OpenBSD MBR 代码. 就相当于前面

那个"use *all* of ..." 的问题回答 "yes".
* p or print: 显示当前分区表. "p m" 将会以兆(M)为单位显示, "p g" 将会以千兆(G)为单位显示.
* e or edit: 编辑分区表.
* f or flag: 将一块分区标示为可启动分区, 之后机器将会从这块分区启动.
* u or update: 将 MBR 升级为OpenBSD 启动代码, 这样做的效果类似于使用 "reinit", 只是不会改变现有的分区表.
* exit and quit: 留心使用这两个命令, 有些用户使用 "exit" 和 "quit" 的时候搞反了他们的意思.

非常有必要在这里再次指出, 这一步的错误会造成非常严重的资料损失. 如果你要在一个存有重要数据的驱动器上进行这些操作, 那么在一个"可以随便操作"的驱动器上做些练习是蛮有价值的, 当然也要记得作好备份.

我们的驱动器上有一块 1.5G 的给 Windows 2000 的分区(使用 FAT 文件系统). 看一下上面显示的信息, 我们可以看到 Windows 的分区占据了从驱动器的 202 柱面结束的地方 . 所以, 我们要把硬盘上剩下的空间分配给 OpenBSD, 从柱面 203 开始. 你也可以通过将现存分区的起始扇区 (63) 和它的大小 (3069297)相加计算出 OpenBSD'的起始扇区为 3069360 .你能对驱动器分布以柱面/柱头/扇区或者是原始扇区的格式进行修改. 只要选对你来说觉得容易的那种就可以了; 在这钟情况下,对于一块已经有现存分区的驱动器, 使用 CHS 格式会比较方便. 如果你是在建立这块硬盘上的第一块分区, 使用原始的扇区会更方便点.

fdisk:  1 >  e  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   -   2585 ]: [ 0 203
BIOS Starting head [
0   -   239 ]: [ 0 ] Enter
BIOS Starting sector [
1   -   63 ]: [ 0 1
BIOS Ending cylinder [
0   -   2585 ]: [ 0 2585
BIOS Ending head [
0   -   239 ]: [ 0 239
BIOS Ending sector [
1   -   63 ]: [ 0 63
fdisk:
* 1 >  p
Disk: wd0 geometry: 
2586 / 240 / 63  [ 39100320  Sectors]
Offset: 
0  Signature:  0xAA55
Starting Ending LBA Info:
#: id C H S 
-  C H S [ start: size ]
------------------------------------------------------------------------
* 0 : 0B  0   1   1   -   202   239   63  [  63 3069297  ] Win95 FAT - 32
1 : A6  203   0   1   -   2585   239   63  [  3069360 36030960  ] 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 >  p m
Disk: wd0 geometry: 
2586 / 240 / 63  [ 19092  Megabytes]
Offset: 
0  Signature:  0xAA55
Starting Ending LBA Info:
#: id C H S 
-  C H S [ start: size ]
------------------------------------------------------------------------
* 0 : 0B  0   1   1   -   202   239   63  [  63 : 1499M] Win95 FAT - 32
1 : A6  203   0   1   -   2585   239   63  [  3069360 : 17593M] OpenBSD
2 00   0   0   0   -   0   0   0  [  0 : 0M] unused
3 00   0   0   0   -   0   0   0  [  0 : 0M] unused
fdisk:
* 1 >

在使用fdisk的平台上,非常重要的一点是第一块分区要避开硬盘上的第一个轨道。 在本例中, 就是从 63 扇区开始的. 如果一块 OpenBSD 分区被建立为从最前面的 0 扇区开始的话, 分区表就会被 OpenBSD 的分区启动记录(PBR)所覆盖. 这个系统可能仍然能启动, 但是这很难维护, 这种配置是不推荐的,并且不被支持.

注意这个时候提示符多了个星号 ('*')以提醒你尚未保存修改. 我们输入一下 p m 就能看到我们没有改动 Windows 分区, 我们成功得将剩余的空间分配给了 OpenBSD, 分区也没有重叠. 胜利在望.

还有一件事我们没做的就是把分区标志为可启动的, 这样我们下次重启后就能启动OpenBSD :

fdisk: * 1 >  f  1
Partition 
1  marked active.
fdisk:
* 1 >  p
Disk: wd0 geometry: 
2586 / 240 / 63  [ 39100320  Sectors]
Offset: 
0  Signature:  0xAA55
Starting Ending LBA Info:
#: id C H S 
-  C H S [ start: size ]
------------------------------------------------------------------------
0 : 0B  0   1   1   -   202   239   63  [  63 3069297  ] Win95 FAT - 32
* 1 : A6  203   0   1   -   2585   239   63  [  3069360 36030960  ] 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 >

现在,我们就可以保存一下修改了:

fdisk: * 1 >  w
Writing MBR at offset 
0 .
wd0: no disk label
fdisk: 
1 >  q


创建disklabel

下一步就是使用 disklabel(8) 分配 OpenBSD 分区(第二层). 更多使用 disklabel(8) 的细节可以在 FAQ 14 查看, disklabel.

Here  is  the partition information you chose:
Disk: wd0 geometry: 
2586 / 240 / 63  [ 39100320  Sectors]
Offset: 
0  Signature:  0xAA55
Starting Ending LBA Info:
#: id C H S 
-  C H S [ start: size ]
------------------------------------------------------------------------
0 : 0B  0   1   1   -   202   239   63  [  63 3069297  ] Win95 FAT - 32
* 1 : A6  203   0   1   -   2585   239   63  [  3069360 36030960  ] 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  3069360  ( 0x2ed5b0 ) size  36030960  ( 0x225c9f0 )

Treating sectors 
3069360 - 39100320   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)
>   ?
Available commands:
?  [cmnd]  -   this  message or command specific help.
a [part] 
-  add  new  partition.
-   set  OpenBSD disk boundaries.
c [part] 
-  change partition size.
-   set  label to  default .
d [part] 
-  delete partition.
-  edit drive parameters.
g [b
| d | u]  -  use [b]ios, [d]isk or [u]ser geometry.
-  show entire OpenBSD man page  for  disklabel.
m [part] 
-  modify existing partition.
n [part] 
-   set  the mount point  for  a partition.
p [unit] 
-  print label.
-  quit and save changes.
-  recalculate free space.
s [path] 
-  save label to file.
-  undo last change.
-  write label to disk.
-  toggle expert mode.
-  exit without saving changes.
-  zero  out  partition table.
Numeric parameters may use suffixes to indicate units:
' b '   for  bytes,  ' c '   for  cylinders,  ' k '   for  kilobytes,  ' m '   for  megabytes,
' g '   for  gigabytes or no suffix  for  sectors (usually  512  bytes).
' % '   for  percent of total disk size,  ' & '   for  percent of free space.
Non
- sector units will be rounded to the nearest cylinder.
Entering 
' ? '  at most prompts will give you (simple) context sensitive help.
>

同样的,这里的一些命令也要解释一下:

* p - displays (prints) 显示当前的 disklabel , 你也能用 k, m 或者 g 来表示 kilobytes, megabytes 或者 gigabytes为单位进行显示.
* D - 清除现有的 disklabel, 以覆盖当前的 OpenBSD 分区来建立一个新的默认的 disklabel. 当硬盘上本来有一个 disklabel,或者当

OpenBSD 分区被重新划分了大小 -- 老的 disk label 没有被删除的时候(会造成冲突)是很有用的.
* m - 修改 disklabel 中已有的记录. 不要高估了这个命令能给予你的功能. 即使它可能可以更改 disklabel 分区的大小, 但是它不能改变驱动器上的文件类型. 如果你想丢失大量资料的话那么使用这个命令来调整现有分区的大小是个不错的办法.

在你的硬盘上进行 Slice 划分是很重要的 . "我该如何为系统分区?" 的答案就是 "你需要用它做什么". 各种应用之间都是不同的. 在这里没有什么统一的答案. 如果你还没拿定主意如何划分你的系统, 看这里的讨论.

在这台机器上, 我们给了 OpenBSD 17G以上的空间. 这是块很大的空间, 我们多数用不了那么多. 所以我们没必要使用最小的容量单位. 我们很可能会宁愿有几百MB的未使用空间, 而不是几个KB。太小了.

在根分区上, 'a'(/)分区必须要建立以用做根文件系统 (/). 如果这个分区不被建立的话安装程序是无法继续进行的. 一般你也需要一个交换分区(swap),'b'.但是如果你确信系统有永远不会用尽的物理内存,也可以不创建它。如果根磁盘(root disk)上存在'b'分区的话,系统会自动用它作交换分区。如果交换分区位于其他的磁盘上,那就必须手工把它加到/etc/fstab文件中。

稍作思考后,我们决定建立足够的分区来用作推荐使用各个独立文件系统 (/, /tmp, /var, /usr, /home) ,还有一个交换分区:

* wd0a: / (root) - 150M. 应该够了.
* wd0b: (swap) - 300M.
* wd0d: /tmp - 120M. /tmp 会被用来编译一些软件, 120M 对于大多数软件还是足够的.
* wd0e: /var - 80M. 如果这个系统是用做 web 或者 mail 服务器的话 我们希望这块分区能够更大一些, 但是在这里我们并不打算这么做.
* wd0g: /usr - 2G. 我们希望这块分区能有足够的空间来存放用户的应用软件, 如果需要的话还能在这里通过源代码升级或者重新编译系统. Ports 树也会被放在这里, 在 ports 树建立前大概会在这里占用 100M 的空间. 如果你想在这里通过源代码编译许多应用程序而不是使用预编的packages 包, 那你要在这里在多留点空间了.
* wd0h: /home - 4G. 这里用来存放用户资料的.

现在,如果你添加了以上的分区, 你就会看到 6G 以上的空间没有使用! 空白空间不会造成什么问题, 而且它还给我们将来扩大分区提供了方便. 需要更多的 /tmp? 没问题, 在剩余空间中建立一个新的分区,用newfs将它格式化,然后修改一下 /etc/fstab将新分区加载到/tmp上。搞定 .

>  p m
device: 
/ dev / rwd0c
type: ESDI
disk: ESDI
/ IDE disk
label: ST320011A
bytes
/ sector:  512
sectors
/ track:  63
tracks
/ cylinder:  16
sectors
/ cylinder:  1008
cylinders: 
16383
total sectors: 
39102336
free sectors: 
36030960

16  partitions:
# size offset fstype [fsize bsize cpg]
a: 
17593.2M   1498.7M  unused  0   0
c: 
19092.9M   0.0M  unused  0   0
i: 
1498.7M   0.0M  MSDOS
>  d a
>  a a
offset: [
3069360 ] Enter
size: [
36030960 ] 150m
Rounding to cylinder: 
317520
FS type: [
4 .2BSD] Enter
mount point: [none] 
/
>  a b
offset: [
3386880 ] Enter
size: [
35713440 ] 300m
Rounding to cylinder: 
619920
FS type: [swap] Enter
>  a d
offset: [
4006800 ] Enter
size: [
35093520 ] 120m
Rounding to cylinder: 
257040
FS type: [
4 .2BSD] Enter
mount point: [none] 
/ tmp
>  a e
offset: [
4263840 ] Enter
size: [
34836480 ] 80m
Rounding to cylinder: 
166320
FS type: [
4 .2BSD] Enter
mount point: [none] 
/ var
>  a g
offset: [
4430160 ] Enter
size: [
34670160 ] 6g
Rounding to cylinder: 
12594960
FS type: [
4 .2BSD] Enter
mount point: [none] 
/ usr
>  a h
offset: [
17025120 ] Enter
size: [
22075200 ] 4g
Rounding to nearest cylinder: 
8391600
FS type: [
4 .2BSD] Enter
mount point: [none] 
/ home
>  p m
device: 
/ dev / rwd0c
type: ESDI
disk: ESDI
/ IDE disk
label: ST320011A
bytes
/ sector:  512
sectors
/ track:  63
tracks
/ cylinder:  240
sectors
/ cylinder:  15120
cylinders: 
2586
total bytes: 
19092.9M
free bytes: 
6681.4M
rpm: 
3600

16  partitions:
# size offset fstype [fsize bsize cpg]
a: 
155.0M   1498.7M   4 .2BSD  2048   16384   16  #  /
b: 
302.7M   1653.8M  swap
c: 
19092.9M   0.0M  unused  0   0
d: 
125.5M   1956.4M   4 .2BSD  2048   16384   16  #  / tmp
e: 
81.2M   2082.0M   4 .2BSD  2048   16384   16  #  / var
g: 
6149.9M   2163.2M   4 .2BSD  2048   16384   16  #  / usr
h: 
4097.5M   8313.0M   4 .2BSD  2048   16384   16  #  / home
i: 
1498.7M   0.0M  MSDOS
>  q
Write 
new  label ? : [y] Enter

你会注意到C分区被忽略了. 这个分区就是你的整个硬盘; 不要企图去修改它. 你也会发现一块不是我们定义的 i 分区; 这就是已经存在的 Windows 2000 分区. 分区没有被分配到特定的字母 -- 除了 a (root), b (swap) 和 c (整块硬盘), 剩余的分区 (一直到字母 p) 可以由我们来命名.

如果你仔细看 disklabel 的输出, 你会发现你的驱动器的转速可能是错的. 这是个由来已久的问题; 不过系统不会以任何方式使用驱动器的转速这个参数. 不必担心.

配置文件系统装载点并且格式化它

现在是对挂载点的最后配置了. 如果你用 disklabel(8) 来配置挂载点, 这里的步骤就是验证你的选择; 不然的话就在这里指定它.

Mount point  for  wd0d (size = 128520k) ?  (or  ' none '  or  ' done ' ) [ / tmp] Enter
Mount point 
for  wd0e (size = 83160k) ?  (or  ' none '  or  ' done ' ) [ / var] Enter
Mount point 
for  wd0g (size = 6297480k) ?  (or  ' none '  or  ' done ' ) [ / usr] Enter
Mount point 
for  wd0h (size = 4195800k) ?  (or  ' none '  or  ' done ' ) [ / home] Enter
Mount point 
for  wd0d (size = 128520k) ?  (or  ' none '  or  ' done ' ) [ / tmp] done
No more disks to initialize.

OpenBSD filesystems:
wd0a 
/
wd0d 
/ tmp
wd0e 
/ var
wd0g 
/ usr
wd0h 
/ home

The next step 
* DESTROYS *  all existing data on these partitions !
Are you really sure that you
' re ready to proceed? [no] y
newfs: reduced number of fragments per cylinder group from  19840  to  19760  to enlarge last cylinder group
/ dev / rwd0a:  155 .0MB  in   317520  sectors of  512  bytes
5  cylinder groups of  38 .59MB,  2470  blocks,  4992  inodes each
newfs: reduced number of fragments per cylinder group from 
16064  to  15992  to enlarge last cylinder group
/ dev / rwd0d:  125 .5MB  in   257040  sectors of  512  bytes
5  cylinder groups of  31 .23MB,  1999  blocks,  4096  inodes each
newfs: reduced number of fragments per cylinder group from 
10392  to  10344  to enlarge last cylinder group
/ dev / rwd0e:  81 .2MB  in   166320  sectors of  512  bytes
5  cylinder groups of  20 .20MB,  1293  blocks,  2688  inodes each
/ dev / rwd0g:  6149 .9MB  in   12594960  sectors of  512  bytes
31  cylinder groups of  202 .47MB,  12958  blocks,  25984  inodes each
/ dev / rwd0h:  4097 .5MB  in   8391600  sectors of  512  bytes
21  cylinder groups of  202 .47MB,  12958  blocks,  25984  inodes each
/ dev / wd0a on  / mnt type ffs (rw, asynchronous, local, ctime = Tue Oct  23   00 : 55 : 20   2007 )
/ dev / wd0h on  / mnt / home type ffs (rw, asynchronous, local, nodev, nosuid, ctime = Tue Oct  23   00 : 55 : 20   2007 )
/ dev / wd0d on  / mnt / tmp type ffs (rw, asynchronous, local, nodev, nosuid, ctime = Tue Oct  23   00 : 55 : 20   2007 )
/ dev / wd0g on  / mnt / usr type ffs (rw, asynchronous, local, nodev, ctime = Tue Oct  2300 : 55 : 20   2007 )
/ dev / wd0e on  / mnt / var type ffs (rw, asynchronous, local, nodev, nosuid, ctime = Tue Oct  23   00 : 55 : 20   2007 )

你可能会奇怪为什么安装程序会重复询问你挂载点. 这是为了让你有机会修改在建立 disklabel 时造成的挂载点遗失或错误. 比如, 安装程序会自动删除你在配置 disklabel 输入的相同的挂载点. disklabel 程序允许你输入重复的挂载点, 但是它们必须在 disklabel 程序退出后检查一下. 重复的挂载点被删除后会造成分区失去挂载点, 如果你想用它的话还要再分配新的挂载点.

注意 "Are you really sure that you are ready to proceed?" 默认的回答是 no, 所以你要回答 yes 来让它继续安装过程并格式化分区. 如果你回答no,你就会进入一个字符终端, 输入 install 就能再次进入安装, 或者重启你的机器也行.

现在所有的文件系统都将会被格式化。根据磁盘的空间大小和速度,这个过程可能需要一段时间。

4.5.3 - 设置系统的主机名

现在你必须设置一下主机名. 这个值, 连同 DNS 域名(specified below), 会被存放在 /etc/myname, 这个文件会在启动时用来设置主机名. 如果你不设置系统的域名, 系统就会使用默认的 'my.domain' .

设置这个名字很重要, 因为当系统安装后第一次启动生成系统密钥时会被用到. 不论网络有没有被配置好,密钥都会被生成.

Enter system hostname ( short  form, e.g.  ' foo ' ): puffy

4.5.4 - 配置网络

现在到配置你的网络了. 如果你打算做一个 FTP 或者 NFS 的基本安装那必须要配置网络, NFS的安装需要以你输入的信息为基础. 这里就是一个安装过程中的网络配置的例子.在我们的例子中,我们会将fxp0接口连接到一个cable modem上并使用DHCP来配置;另外一个则连接到我们的内网中,我们将手动配置网络。

Configure the network ?  [yes] Enter
Available interfaces are: fxp0 xl0.
Which one 
do  you wish to initialize ?  (or  ' done ' ) [fxp0] xl0
Symbolic (host) name 
for  xl0 ?  [puffy] Enter
The media options 
for  xl0 are currently
media: Ethernet autoselect (100baseTX full
- duplex)
Do you want to change the media options
?  [no] Enter
IPv4 address 
for  xl0 ?  (or  ' dhcp ' 192.168 . 1.254
Netmask
?  [ 255.255 . 255.0 ] Enter
IPv6 address 
for  xl0 ?  (or  ' rtsol '  or  ' none ' ) [none] Enter
Available interfaces are: fxp0.
Which one 
do  you wish to initialize ?  (or  ' done ' ) [fxp0] Enter
Symbolic (host) name 
for  fxp0 ?  [puffy] Enter
The media options 
for  fxp0 are currently
media: Ethernet autoselect (10baseT half
- duplex)
Do you want to change the media options
?  [no] Enter
IPv4 address 
for  fxp0 ?  (or  ' none '  or  ' dhcp ' ) dhcp
Issuing hostname
- associated DHCP request  for  fxp0.
DHCPDISCOVER on fxp0 to 
255.255 . 255.255  port  67  interval  1
DHCPOFFER from 
73.34 . 136.1
DHCPREQUEST on fxp0 to 
255.255 . 255.255  port  67
DHCPACK from 
73.34 . 136.1
bound to 
69.241 . 244.76   --  renewal  in   1800  seconds.
IPv6 address 
for  fxp0 ?  (or  ' rtsol '  or  ' none ' ) [none] Enter
No more interfaces to initialize.
DNS domain name
?  (e.g.  ' bar.com ' ) [my.domain] example.com
DNS nameserver
?  (IP address or  ' none ' ) [ 68.87 . 77.130   68.87 . 72.130 ] Enter
Use the nameserver now
?  [yes] Enter
Default route
?  (IP address,  ' dhcp '  or  ' none ' ) [dhcp] Enter
Edit hosts with ed
?  [no] Enter
Do you want to 
do  any manual network configuration ?  [no] Enter

注意: 安装过程中只有一个网络接口可以轻松地使用DHCP进行配置,如果你尝试用DHCP配置另外的一个,将会发生错误。你将需要在安装完成后手工配置另外的一个网络接口。

现在,我们输入一下root用户的口令:

Password  for  root account ?  (will not echo) pAssWOrd
Password 
for  root account ?  (again) pAssWOrd

记得使用一个安全点的口令. 你也可以在启动后用 passwd(1) 建立新的口令:

The new password should be at least six characters long and not purely alphabetic. Its total length must be less than _PASSWORD_LEN (currently 128 characters). A mixture of both lower and uppercase letters, numbers,and meta-characters is encouraged.

4.5.5 - 选择安装介质

网络建立好之后, 安装脚本会给你一个手工调整配置的机会. 你建立的文件系统会被挂载根用户的口令也会被要求输入. 这样你的硬盘就能准备好安装 OpenBSD 的软件包套件了.

下面,你要选择一个安装介质. 选项都被列出来了.

Let ' s install the sets!
Location of sets ?  (cd disk ftp http or  ' done ' ) [cd] Enter
Available CD
- ROMs are: cd0.

在这里我们用 CD-ROM 安装. 会有一个被系统识别为 CD-ROM 的设备列表被显示出来. 大多数人只有一个. 如果你有很多个那就选你哟给你来安装 OpenBSD 的那个.

注意: 不是所有的硬件平台都支持全部的安装选项。本例中,OpenBSD/i386平台不支持NFS安装,因而列表中就没有显示。

Available CD - ROMs are: cd0.
Which one contains the install media
?  (or  ' done ' ) [cd0] Enter

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

这里,你要设定一下安装文件所在的文件夹的位置, 官方 CD-ROM 上的位置是 4.2/i386/ .

4.5.6 - 选择安装套件.

现 在就是选择你要安装的软件套件的时候了. 在后面一段中你能看到对这些包的描述. 被安装程序所找到的文件会被显示在屏幕上. 你的工作就是确定哪些文件是你需要的. 非 X 的包默认被选中; 然而有人需要限制包的数量来运行基本的 OpenBSD 系统, 那只要选 base42.tgz, etc42.tgz 和 bsd. 其他人或许想要安装所有的软件包套件.下面这个例子就是完全安装.

Select sets by entering a  set  name, a file name pattern or  ' all ' . De - selectsets by prepending a  ' - '  to the  set  name, file name pattern or  ' all ' . Selected sets are labeled  ' [x] ' .

[X] bsd
[X] bsd.rd
[ ] bsd.mp
[X] base42.tgz
[X] etc42.tgz
[X] misc42.tgz
[X] comp42.tgz
[X] man42.tgz
[X] game42.tgz
[ ] xbase42.tgz
[ ] xetc42.tgz
[ ] xshare42.tgz
[ ] xfont42.tgz
[ ] xserv42.tgz
Set name
?  (or  ' done ' ) [bsd.mp] all

[X] bsd
[X] bsd.rd
[X] bsd.mp
[X] base42.tgz
[X] etc42.tgz
[X] misc42.tgz
[X] comp42.tgz
[X] man42.tgz
[X] game42.tgz
[X] xbase42.tgz
[X] xetc42.tgz
[X] xshare42.tgz
[X] xfont42.tgz
[X] xserv42.tgz

在这你能发挥一下你的才能-- -x* 会移除所有 X 部件, 如果你改变主意的话. 在这个例子中, 我们要案装所有的套件. 即使系统不会用到所有的套件, 我们还是推荐开启或者安装所有的套件. 这里有更多的选择细节.

一 旦你成功选定了你要的的套件, 你会看到提示问你要不要解压并安装这些套件.一条显示出来的进程栏会告诉你安装信息以及需要消耗多少时间. 安装时间的长短取决于你安装 OpenBSD 的机器如何, 安装套件的多寡, 安装源的速度如何. 这个过程从十几分钟到几小时不等.

Set name ?  (or  ' done ' ) [done] Enter
Ready to install sets
?  [yes] Enter
Getting bsd ...
100 %   |**************************************************|   6083  KB  00 : 06
Getting bsd.rd ...
100 %   |**************************************************|   4949  KB  00 : 03
Getting bsd.mp ...
100 %   |**************************************************|   6130  KB  00 : 04
Getting base42.tgz ...
100 %   |**************************************************|   41604  KB  00 : 37
Getting etc42.tgz ...
100 %   |**************************************************|   1211  KB  00 : 01
Getting misc42.tgz ...
100 %   |**************************************************|   2239  KB  00 : 02
Getting comp42.tgz ...
100 %   |**************************************************|   76957  KB  01 : 04
Getting man42.tgz ...
100 %   |**************************************************|   7477  KB  00 : 08
Getting game42.tgz ...
100 %   |**************************************************|   2547  KB  00 : 02
Getting xbase42.tgz ...
100 %   |**************************************************|   11702  KB  00 : 10
Getting xetc42.tgz ...
100 %   |**************************************************|   75398   00 : 00
Getting xshare42.tgz ...
100 %   |**************************************************|   2488  KB  00 : 04
Getting xfont42.tgz ...
100 %   |**************************************************|   34745  KB  00 : 27
Getting xserv42.tgz ...
100 %   |**************************************************|   10108  KB  00 : 08
Location of sets
?  (cd disk ftp http or  ' done ' ) [done] Enter

在这里你能从其它源添加想要的额外的包(包括自定义的包套件) , 或者当你已经安装了你所要的所有包套件,那就输入 'done' .

4.5.7 – 最后处理

下 面你会被问到一些有关设定你刚装好的系统的问题.首先是 sshd(8) 要不要在系统启动的时候开启. 通常你都是希望 sshd(8) 运行的, 但是有时你不打算这样做. 如果你的应用软件对于 sshd(8) 没有依赖, 在理论上不运行它还是有一点安全优势的.

Started sshd( 8 ) by  default ?  [yes] y

(如果你以后要改变注意, 编辑/ect/rc.conf.local或/etc/rc.conf文件)
你也会选择是否要在启动时运行OpenNTPD。OpenNTPD是一种让你的计算机时钟保持同步的影响较小的方式,缺省的配置对多数人来说都足够了。
NTP server? (or 'none' or 'default') [none] default
如果你有一个本地的时钟服务器,你可以在这里指定它,如果你选择 “default”, OpenNTPD将会使用pool.ntp.org,它是一个可自由访问的时钟服务器的集合。(如果你以后要改变注意,编辑/ect/rc.conf.local和/或 /etc/ntpd.conf文件)
在某些平台上,你接下来 会被问到要不要在这个系统上运行 X . 如果你回答 'Y', /etc/sysctl.conf 就会被修改加入 machdep.allowaperture=1 或者 machdep.allowaperture=2, 是加入哪条那要看你使用什么硬件平台.在有些平台上这个问题不会被问到.如果你不准备运行X,或者是不确定,回答”NO”。如果你需要运行X,可以在以后轻松地修改/etc/sysctl.conf。禁用xf86(4)会带给你一些潜在的安全方面的优势,因为现在的视频卡上的图形引擎可以不受处理器的控制而被用于随意更改内存。

 

Do you expect to run the X Window System ?  [yes] y

 

下面你会被问到是否要用一个串口的控制台, 而不是一个标准的显示器和键盘. 如果你选 "yes" 并且回答了其它几个简单的问题, /etc/boot.conf 和 /etc/ttys 会根据你的情况被修改. 大多数人会选择默认选项-- no.

 

Change the  default  console to com0 ?  [no] Enter

 

你 最后一个任务就是填写一下时区. 这取决于你的机器的所在地, 这里或许会有数个等同的适用的答案. 下面这个例子中, 我们选择 US/Eastern, 同样也可以用 EST5EDT 或者 US/Michigan 和其他等同的选项.输入 ?会指导你作出选择.

 

Saving configuration files......done.
Generating initial host.random file ......done.
What timezone are you 
in ?  ( ' ? '   for  list) [US / Pacific]  ?
Africa
/  Chile /  GB - Eire Israel NZ - CHAT Turkey
America
/  Cuba GMT Jamaica Navajo UCT
Antarctica
/  EET GMT + 0  Japan PRC US /
Arctic
/  EST GMT - 0  Kwajalein PST8PDT UTC
Asia
/  EST5EDT GMT0 Libya Pacific /  Universal
Atlantic
/  Egypt Greenwich MET Poland W - SU
Australia
/  Eire HST MST Portugal WET
Brazil
/  Etc /  Hongkong MST7MDT ROC Zulu
CET Europe
/  Iceland Mexico /  ROK posix /
CST6CDT Factory Indian
/  Mideast /  Singapore posixrules
Canada
/  GB Iran NZ SystemV /  right /
What timezone are you 
in ?  ( ' ? '   for  list) [US / Pacific] US
What sub
- timezone of  ' US '  are you  in ?  ( ' ? '   for  list)  ?
Alaska Central Hawaii Mountain Samoa
Aleutian East
- Indiana Indiana - Starke Pacific
Arizona Eastern Michigan Pacific
- New
Select a sub
- timezone of  ' US '  ( ' ? '   for  list): Eastern
Setting local timezone to 
' US/Eastern ' ...done.

 

如果你不确定精确的时间, 你可能会希望读一下这个.

最后一步就是为系统建立 /dev 目录 (在一些机器上可能会比较耗时间, 特别是当你的 RAM 很小的时候), 并且安装启动区块.

 

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  3069360 ; inode block  152 , offset  4136
using  MBR partition  1 : type  166  ( 0xa6 ) offset  3069360  ( 0x2ed5b0 )
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
syncing disks... done

The operating system has halted.
Please press any key to reboot.

OpenBSD 已经在你的机器上装好并等待第一次启动啦, 但在你重启之前...

在你重启前
现在, 你的系统已经准备好重启并开始配置服务了. 然而,在这之前, 查看一下勘误表来检查有没有会有一些对你有立即影响的错误还是比较明智的选择.
一个技巧就是重启前运行下面的命令:
# /mnt/usr/sbin/chroot /mnt

这个命令将会将装载点装载到设定位置,像正常的重启动一样。你现在可以做一些基本的系统配置,比如添加用户,更改装载点等。

你重启之后

在你安装好系统后要阅读的第一样东西就是 afterboot(8).

你也可以在下面这些很有用的连接里找找看:

* http://www.openbsd.org/faq/faq10.html#AddDelUser “>OpenBSD中添加新用户
* Initial Network Setup
* Man Pages of popular/useful commands
* OpenBSD man pages on the Web
* The OpenBSD Ports and Packages system for installing software, as well as here and here

最后一件事...
OpenBSD 开发小组希望你发送一份 dmesg. 所有的开发人员,还有所有的用户,都会感谢你的.

4.6 - 安装需要那些文件?

一次完整的 OpenBSD 安装可以分解成一定数量的独立软件包套件. 不是所有的应用都需要所有的包套件的的. 这是对每个包的描述:

* bsd - 这是内核,必须的。
* bsd.mp - 多处理器内核 (SMP) (只用于某些平台)
* bsd.rd - RAM 内存分区内核
* base42.tgz - 包含了所需的基本 OpenBSD 系统. 必须安装。
* etc42.tgz - 包含了所有需要的 /etc 里的文件;必须安装。
* comp42.tgz - 包含了编译器和它的工具, 头文件 和库文件. 推荐安装。
* man42.tgz - 包含了man页 推荐安装。
* misc42.tgz – 包含一些其他信息,安装文档
* game42.tgz – 包含 OpenBSD上运行的一些游戏
* xbase42.tgz - 包含了基本 X11 安装
* xetc42.tgz - 包含了 /etc/X11 和 /etc/fonts 配置文件
* xfont42.tgz - 包含了 X11 的字体服务器和字体
* xserv42.tgz - 包含了 X11 的X 服务器
* xshare42.tgz - 包含了 X 的 man 页, 本地设置,包含文件等等

etc42.tgz 和 xetc42.tgz 套件不作为升级安装的部分, 只在完全安装中用到, 所以你做的任何定制都会丢失. 你必须通过手动修改来升级你的 /etc, /dev 和 /var 文件夹.

即使你无意运行X系统,一些第三方的软件也会需要xbase42.tgz中的图形库文件。安装xbase42.tgz即可满足这些软件的要求,而无需安装其余的X组件。

<----待续---->
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值