本文将详细介绍如何在已安装 Windows XP 和 FreeBSD 双系统的机器上,通过硬盘引导方式额外安装 OpenBSD 3.6。硬件环境为:40GB 硬盘、1GB 内存,并配备 USB 光驱(但实际安装过程中无需使用)。其中 Windows XP 占用 10GB(FAT32 格式),FreeBSD 占用 15GB,剩余空间为可用分区。
核心安装思路:无需刻录光盘或使用 U 盘,完全依靠硬盘引导完成安装。以下是具体操作步骤——
1. 第一步:在 C 盘根目录下创建目录C:\OpenBSD3.6\i386(注意大小写必须一致)。接着,从 OpenBSD 官方站点下载 i386 目录下的所有文件,并保存至该目录中。
2. 第二步:重启计算机,进入 Grub for DOS 引导管理器(若未安装,请先安装此工具)。按 c 键进入 GRUB 命令行模式,此时将显示提示符:
grub>
3. 第三步:依次输入以下三条命令,即可启动 OpenBSD 安装程序:
grub>map (hd0,0)/OpenBSD3.6/i386/cdrom36.fs (fd0) grub>chainloader (hd0,0)/OpenBSD/i386/cdrom36.fs grub>rootnoverify (fd0) grub>boot
4. 第四步:成功进入 OpenBSD 安装界面后,屏幕将显示如下信息:
erase ^?, werase ^W, kill ^U, intr ^C, status ^T (I)nstall, (U)pgrade or (S)hell?
5. 第五步:按 i 键开始安装,随后系统会依次提问,请按以下方式回答:
Terminal type? [vt220] 回车 Do you wish to select a keyboard encoding table? [no] 回车 Proceed with install? [no] yes Which one is the root disk? (or 'done') [wd0] 回车 Do you want to use *all* of wd0 for OpenBSD? [no] 回车
6. 第六步:接下来进入分区配置环节。系统将显示当前硬盘的分区表,大致内容如下:
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: 0C 0 1 1 - 1304 254 63 [ 63: 20964762 ] Win95 FAT32
1: A5 1305 0 1 - 3263 254 63 [ 20964825: 31471335 ] FreeBSD
2: A6 3264 0 1 - 4862 254 63 [ 52436160: 25687935 ] OpenBSD
3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
同时显示 OpenBSD 内部的 disklabel:
16 partitions: # size offset fstype [fsize bsize cpg] a: 21494576 52436160 4.2BSD 2048 16384 16 # / b: 4209424 73930736 swap c: 25688880 52436160 unused 0 0 d: 78140160 0 unused 0 0 e: 20964762 63 MSDOS f: 31471335 20964825 unknown
请注意:上述输出中编号为 e 的分区对应 Windows XP 的 C 盘,其文件系统类型显示为 MSDOS。
7. 第七步:确认分区后,系统会发出警告——即将格式化所选分区,所有数据将被清除。确认后继续回答以下问题:
The next step *DESTROYS* all existing data on these partitions! Are you really sure that you're ready to proceed? [no] yes System hostname? (short form, e.g. 'foo') # OpenBSD Configure the network? [yes] yes DNS domain name? (e.g. 'bar.com') [my.domain] com DNS nameserver? (IP address or 'none') [none] 202.96.128.68 Use the nameserver now? [yes] 回车 Edit hosts with ed? [no] 回车 Do you want to do any manual network configuration? [no] 回车 Password for root account? (will not echo) # 输入两次密码 Password for root account? (again)
8. 第八步:当系统询问安装介质位置时,输入 d 选择硬盘:
Where are the install sets? (or 'done') d
然后选择包含安装文件的硬盘设备:
A vailable disks are: wd0. Which one contains the install sets? (or 'done') [wd0] 回车
9. 第九步:接着指定安装文件所在的分区,输入 e(即 C 盘所在分区):
Partition? [a] e
10. 第十步:文件系统类型选择 msdos:
Which filesystem type? [default] msdos
11. 第十一步:输入路径时请注意大小写,正确填入:
Pathname to the sets? (or 'done') OpenBSD3.6/i386
12. 第十二步:选择需要安装的软件包。可以直接输入 all 选择全部,或逐个确认。按以下步骤操作:
The following sets are a vailable. Enter 'all' to select all, or 'done'. File name? (or 'done') 回车 Ready to install sets? [yes] 回车 Where are the install sets? (or 'done') [done] 回车
13. 第十三步:最后进行安装后的基本配置——是否默认启动 sshd、是否使用 X Window 系统以及时区设置。按如下方式回答:
Start sshd(8) by default? [yes] 回车
Do you expect to run the X Window System? [yes] no
What timezone are you in? ('?' for list) [Canada/Mountain] Asia/Shanghai
待所有软件包安装完毕后,重启计算机,OpenBSD 3.6 即成功写入硬盘。整个流程完全不依赖光驱或 U 盘,仅通过 Grub 引导加载内核镜像完成安装,堪称经典的硬盘安装方案,特别适用于无光驱设备或需要快速部署的场景。
