OpenBSD 3.6硬盘安装方法
硬件环境与系统背景 先说说这次安装所基于的硬件环境:40G硬盘、1G内存,再加一个USB光驱。系统方面,Windows XP占10G(FAT32格式),FreeBSD占15G,剩下的都是自由空间。说白了,就是在一台已经装了双系统的机器上再塞进一个OpenBSD 3.6。 核心思路:硬盘直接引导安装
硬件环境与系统背景
先说说这次安装所基于的硬件环境:40G硬盘、1G内存,再加一个USB光驱。系统方面,Windows XP占10G(FAT32格式),FreeBSD占15G,剩下的都是自由空间。说白了,就是在一台已经装了双系统的机器上再塞进一个OpenBSD 3.6。
核心思路:硬盘直接引导安装
核心思路很简单:不用刻盘、不用U盘,直接从硬盘引导安装。具体步骤是这样的——
第一步:准备安装文件
1. 先在C盘下建一个目录C:\OpenBSD3.6\i386,注意大小写不能错。然后把官方站点上i386目录下的所有文件都下载到这里。
第二步:进入GRUB命令行
2. 重启机器,进入Grub for DOS(没有的话先装一个),按 c 进入GRUB命令行模式,你会看到:
grub>
第三步:启动OpenBSD安装程序
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] 回车
第六步:分区表与disklabel确认
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. 当问到“安装介质放在哪里”时,选择 disk:
Where are the install sets (or 'done') d
然后选择硬盘设备:
Available 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 available. 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引导加载内核镜像,算是非常经典的硬盘安装方式。
