免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 9815 | 回复: 25
打印 上一主题 下一主题

[OpenBSD] 菜鸟笔记:openbsd3.8的安装 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-03 11:20 |只看该作者 |倒序浏览
我是一个菜鸟,什么样的菜鸟呢?以前一直用widows,用widows来工作,用windows来做服务器,也安装过一些linux的发行版,但是,仅仅是安装好后就不再用了,对类unix系统的了解就仅仅限于此了,这段时间在网上看了一些关于bsd的文章,特别是看了《情迷OpenBSD》后,就动了念头来安装openbsd看看。用了几天时间,把openbsd安装了几遍,在安装的时候,主要参考了下面的一些资料:
    Freebird的openbsd faq  [2005] 最新简体中文版
      congli的硬盘安装OpenBSD3.6
      openbsd 3.8版本的FAQ
      Absolute Openbsd  强烈推荐这本书,虽然有些内容有点老,但是讲的很详细,特别是一些基础东西讲的很详细,即使像我这样菜的不能再菜的菜鸟,看看这本书也能看明白。可以从电驴上下一个。谁知道那里有中文版的下载,告诉我一声,看这种英文版的,对我这个几乎是英语盲的来说,不停的查字典实在是一种折磨。
接下来,把我的安装整理了一下,记录下来,网上已经有很多这方面的内容了,为什么我还要再这样做呢?因为我感觉网上很多文章都是告诉你到那一步怎么做,用什么命令,但是很少告诉你为什么这个做,这是给有一定基础的人看的,对于像我这样的菜鸟来说,跟着照做,一般可以成功,但是到最后你不知道其原理,不能举一反三,稍微有一点变化就懵了,不知道该怎么做,所以我就把我的安装过程进行了整理,加进了安装中需要知道的一些基础知识,当然,由于我是地地道道的一个菜鸟,这些东西大部分都是用别人的,我不过是进行汇总整理,方便于自己以后查看,也方便于像我一样的菜鸟查看。所以,这些东西是给象我一样的菜鸟看的,若你有一定的基础,那么看这些东西就没什么意思了。

现在开始openbsd3.8的安装
一、制作可启动的OpenBSD安装介质
    这里你可以参阅Freebird翻译的openbsd faq第四章参阅1),我的光盘镜像是从这个网站下载的(http://www.openbsd.com.cn/),若是不想制作安装介质,可以从硬盘启动,在win2000或xp或2003中,我用的是:vfloppy1.5,先下载vfloppy1.5和floppy38.fs(用于桌面PC)或floppyB38.fs(用于服务器)或floppyC38.fs(用于笔记本),这三个软盘镜像文件的区别你可以参阅(参阅1),根据自己的情况选择一个,然后启动vfloppy1.5,在映像文件中选择软盘镜像文件floppy?38.fs,其他默认,点应用就可以了,然后在我的电脑上点右键,选择属性->高级->启动与故障恢复->设置,选中"显示操作系统列表时间",并更改时间,一般应该在5秒以上,然后重新启动计算机,选择“由虚拟启动软盘启动”就可以启动openbsd的安装程序了。(需要注意的是:若你的windows安装所在分区由于其他原因显示的不是c盘,而是其他盘符,就像我的附件图片显示的那样,点应用后,需要更改boot.ini文件,把F:\BOOT\floppy38.bin="由虚拟启动软盘启动"更改为c:\BOOT\floppy38.bin="由虚拟启动软盘启动",这样才能正常启动)

待续..........

[ 本帖最后由 wuyanxiao 于 2006-3-4 15:27 编辑 ]

1.jpg (72.61 KB, 下载次数: 140)

我的vfloppy1.5界面

我的vfloppy1.5界面

论坛徽章:
0
2 [报告]
发表于 2006-03-03 11:41 |只看该作者

二、安装前的一些准备知识

二、安装前的一些准备知识
    安装前你需要知道(或者你已经成功安装成功过一次openbsd系统,你就会迫切的想要知道):我应

该怎样设置分区的大小和应该选择那些安装包?

2.1 选择哪些安装包?

      Absolute Openbsd中原文介绍如下:

Distribution Sets
Each architecture directory contains a variety of documents and files containing instructions and programs applicable to that type of hardware. For example, in the 3.1/i386 directory you'll see several INSTALL documents and a tutorial on the i386 boot architecture.

You'll also see several compressed files with names like comp31.tgz, misc31.tgz, and so on. These files are distribution sets, or compressed chunks of OpenBSD. Each distribution set contains a subsection of OpenBSD. By choosing the distribution sets you install, you can choose how much functionality your OpenBSD system will have. For example, the documentation is kept in a separate distribution set. If you're short on space and have documentation elsewhere, you might choose to save a little space and not install them on this machine. If this is a secure machine, you probably don't want a compiler on it. And if this is your experimental "learning OpenBSD" machine, you probably want to install everything.

Each distribution set has a name and a version number. For example, one distribution set of OpenBSD in release 3.1 is base32.tgz. In the next release, these same tools will be called base33.tgz.

Here are the distribution sets for OpenBSD. You'll find these on all architectures, unless noted in the architecture's release notes. If this is your first OpenBSD install, take a moment to decide which distribution sets you need. If at all possible, install them all while you're learning the OS. You can always trim them down in future installs.

bsd
This small distribution set contains the kernel. The kernel is important. The installer will complain if you don't have it and issue all sorts of dire warnings. Worse, your new system will not boot without it.

baseXX.tgz
This contains OpenBSD's core programs, all the things that make OpenBSD UNIXish. All the programs in /bin, /sbin, /usr/bin, and /usr/sbin, the system libraries, and the miscellaneous programs you expect to find on a UNIX system are in this distribution set. Without this distribution set, your OpenBSD system will not work at all.

etcXX.tgz
You might guess that this distribution set contains the /etc/ directory, but it also contains assorted other files and directories that are required by the system, such as /var/log, as well as root's home directory. You must install this distribution set if you want your OpenBSD system to actually run.

manXX.tgz
If you need the manual pages for the programs in the base and the etc set, install this distribution set. The manual pages for other sets are installed with the distribution set.

compXX.tgz
This distribution contains C, C++, and Fortran compilers, tools, and the associated toolchain for each. It also includes the manual pages and documentation for the compilers. You will want this set if you plan to develop or compile software on this system. You need this set to use the ports collection. While this distribution set isn't large, you might choose to not install in on a secure machine such as a firewall. (Intruders are generally delighted to find a properly configured compiler on a firewall; such tools make a hacker's life much easier.)

gameXX.tgz
This distribution set contains a variety of simple games and documentation for them, based on games originally distributed in the BSD 4.4-Lite software collection. Some of these, such as fortune(1), are considered UNIX classics, and old farts won't be happy unless they're installed. Others, such as rogue(6), have more advanced versions available as a port or a package. You don't really need this, unless you want to see what us old farts called "computer games" back in the day.

miscXX.tgz
This contains dictionary files and typesettable documentation. If this system is intended as a desktop, you probably want these. If it's a server, you probably don't need them.

xbaseXX.tgz
This contains the core of XFree86, such as programs, headers, libraries, and so on. If you want to use X, you need this. Although you might not have a console or monitor on this system, remember that X will allow programs on this server to display on a workstation. These functions will not work without this distribution set.

xbaseXX.tgz
This contains the fonts for XFree86. If you plan to use X on a local display, install this.

xservXX.tgz
This contains all of the XFree86 video card drivers. If you plan to use X on a local display, install this.

xshareXX.tgz
XFree86's documentation and text files are included in this distribution set. If you're one of those few people who know everything there is to know about XFree86, you can get by without this.

下面是我搬着字典翻译的,红色的是我的注释,其中有些地方不会翻译,很多地方表达不正确,请大家指正:
分发包(Distribution Sets)
每一个体系的目录里都有包含与这种体系硬件相对应的用法说明和程序的各种各样的文档和文件。例如,在3.1/i386目录,你会看到几个安装文档和(a tutorial我不知道该怎样翻译)在i386启动体系上。
    同样,你会看到文件名若comp31.tgz, misc31.tgz之类的压缩文件,这些文件是分发包或者openbsd的压缩块。每个分发包包含openbsd的一小部分。通过选择你要安装的压缩包,你可以选择你要安装的openbsd系统有多少功能。例如,文档被放在一个分发包里,如果你的空间不够或者在其他地方有文档,你可以选择不安装文档来节省一点空间。如果这是一个以安全为主的机器,你或许不想在它上面安装编译器,或者,如果这是一台用来试验的“学习openbsd”机器,你可能会安装所有的东西。
    每一个分发包都有一个名字和版本数,例如,在3.1的openbsd发行版中,有一个分发包base32.tgz(?应该是base31.tgz吧?),在下一个发行版中,相同的工具会被命名为base33.tgz。
    下面这些是openbsd的分发包,除了某些体系在发行说明中有专门说明的,你可以在所有体系中找到这些分发包。如果你是第一次安装openbsd,请用一点时间来确定你需要安装哪些分发包。在以后安装时你可以删减他们。
Bsd
    这个小小的分发包包含内核,内核非常重要,如果没有它,安装程序会出现各种各样的紧急告警,更糟的是,你的新系统将不能启动。
Base**.tgz
    这包含openbsd的核心程序,一切使openbsd是一个unixish的东西。所有在/bin, /sbin, /usr/bin和 /usr/sbin目录里的程序,系统库文件和所有你期望在unix系统上存在的程序都包含在这个分发包中。没有这个分发包,你的openbsd系统根本不能工作。
Etc**.tgz
    你可能会猜想这个分发包包含/etc/目录,实际上它还包含系统需要的其他各类文件和目录,例如:/var/log,root的home目录。若你想要openbsd系统真正运行起来,必须安装这个分发包。
manXX.tgz
    如果你需要base和etc分发包中程序的手册页,安装这个分发包。其他分发包的手册页包含在各自的分发包中。
compXX.tgz
    这个分发包包含C, C++, 和 Fortran的编译器、工具和与各自相关的工具链。它同样也包含编译器的手册页和文档。如果你希望在这个系统上开发或者编译软件,请安装这个分发包。你需要这个分发包来使用ports collection。虽然这个分发包不大,在一个安全的机器上你可以选择不安装它,例如作为一个防火墙的机器(入侵者会很高兴在一个防火墙上发现正确配置的编译器,这些工具使黑客的生活变的更加容易)。
gameXX.tgz
    这个分发包包含种种小游戏及其文档,基于随BSD 4.4-Lite software collection分发的游戏。他们中的一些,例如fortune,被认为是unix的经典,老farts是不安之不快。另外的像rogue则以port 或 package方式有更多的高级版本。你实际上不需要这个,除非你想看看这些过去被我们老farts称之为“计算机游戏”的东西长的怎么样。
miscXX.tgz
    包含字典文件和可定制类型的文档,如果系统要作为桌面,你可能想要安装它,如果作为服务器,你可能不需要安装它。
xbaseXX.tgz
    包含XFree86的核心,像头文件、库文件等等。如果你想要使用x,你需要他。尽管在你的系统上可能没有终端或显示器,记住x可以让服务器上的程序显示在客户端。不安装这个分发包,这些功能就不能实现。
xbaseXX.tgz
    包含XFree86字体,如果你计划使在本地显示系统上使用x,安装它。
xservXX.tgz
    包含所有XFree86显卡驱动,如果你计划使在本地显示系统上使用x,安装它。
xshareXX.tgz
    XFree86的文档和文本文件包含在这个分发包中,如果你属于对XFree86无所不知的那一少部分人,没有他,你也过得去。

FAQ3.8中介绍如下:

4.6 - What files are needed for installation?
The complete OpenBSD installation is broken up into a number of separate file sets. Not every application requires every file set. Here is an overview of each:


bsd - This is the Kernel. Required
bsd.mp - Multi-processor (SMP) kernel (only some platforms)
bsd.rd - RAM disk kernel
base38.tgz - Contains the base OpenBSD system Required
etc38.tgz - Contains all the files in /etc Required
comp38.tgz - Contains the compiler and its tools, headers and libraries. Recommended
man38.tgz - Contains man pages Recommended
misc38.tgz - Contains misc info, setup documentation
game38.tgz - Contains the games for OpenBSD
xbase38.tgz - Contains the base install for X11
xetc38.tgz - Contains the /etc/X11 and /etc/fonts configuration files
xfont38.tgz - Contains X11's font server and fonts
xserv38.tgz - Contains X11's X servers
xshare38.tgz - Contains manpages, locale settings, includes, etc. for X
The etc38.tgz and xetc38.tgz sets are not installed as part of an upgrade, only as part of a complete install, so any customizations you make will not be lost. You will have to update your /etc, /dev and /var directories manually.

翻译如下:
4.6 所有的openbsd安装文件被分离成了一些单独的文件包。并不是每一个程序都需要每一个安装包。下面是这些文件包的概述:
•        bsd – 内核. 必须的
•        bsd.mp – 多处理器内核 (仅仅在某些平台)
•        bsd.rd – 参见后面的介绍
•        base38.tgz – 包含基础的OpenBSD系统 必须的
•        etc38.tgz – 包含 /etc中的所有文件 必须的
•        comp38.tgz – 包含编译器和他的工具、头文件、库文件. 建议的
•        man38.tgz – 包含 man 手册页 建议的
•        misc38.tgz – 包含 misc 信息, 安装文档
•        game38.tgz – 包含 OpenBSD的游戏
•        xbase38.tgz – 安装x11的基础
•        xetc38.tgz – 包含 /etc/X11 和 /etc/fonts 配置文件
•        xfont38.tgz – 包含x11字体服务和字体
•        xserv38.tgz – 包含X11的 X 服务
•        xshare38.tgz – 包含x的 manpages, locale settings, includes, 等等.
etc38.tgz 和 xetc38.tgz包在升级安装时不能被安装,除非是全新的安装,因此,任何你定制的东西都不会丢失,你不得不手工升级你的/etc, /dev 和 /var目录。

    由于Absolute Openbsd版本较老,和3.8的不太一样,两者可以综合起来看,看了以上内容,我想你就应该明白根据你的目的需要安装哪些文件了。你可以选择不同的文件多安装几次看看。
下面是如何选择分区大小,待续..............

[ 本帖最后由 wuyanxiao 于 2006-3-3 11:44 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2006-03-03 16:02 |只看该作者
写的不错!顺便欢迎来到BSD的世界!

论坛徽章:
0
4 [报告]
发表于 2006-03-04 15:05 |只看该作者

2.2 安装openbsd时怎样确定分区大小

Absolute Openbsd中原文介绍如下:

Partitioning
The most difficult part of installing OpenBSD is deciding how to partition your hard drive. When you don't know how partitions work, choosing a partition layout can be troublesome. Unlike many installers that have fancy menus or graphic tools, OpenBSD's installer expects you to know how to use low-level disk management tools.

Partitions are logical subsections of a hard drive. Different partitions can be handled in different ways and can even have different file systems or different operating systems on them. We're going to discuss partitioning for both single-OS and multiple-OS installs.

Note  Get a piece of paper to make some notes about your partitioning. Start by writing down the size of your hard disk. This is the amount of space you have to divide between your partitions. Write down the size of every partition you want and the order in which you want those partitions to lie. This will make installing OpenBSD much easier!


Why Partition?
Partitioning might seem like a pain; why should you bother? Many commercial operating systems allow you to simply have one large partition over your entire hard disk, giving you a single 80-gig partition. What are the advantages of partitioning?

Different operating systems have different partition types and different requirements for disk layout. A Microsoft operating system simply cannot recognize an OpenBSD disk format and will insist upon formatting it before using it. Although OpenBSD can mount partitions designed for most other popular operating systems, do not put the main OpenBSD system programs on a foreign partition. Let each OS run on its own section of disk. If you want to have multiple operating systems on your machine, you must partition.

But when you're running a dedicated OpenBSD machine, why should you bother to split up your hard drive? On a physical level, different parts of the disk move at different speeds. By putting frequently accessed data on the fastest parts of the disk, you can improve system performance. The only way to arrange this is by using partitions. Also, the operating system handles each partition separately. This means that you can configure each partition differently or set it to use different rules. The root partition is the only partition that should have device nodes, for example, so you can tell other partitions to not recognize device nodes. Partitions that contain user data should not have setuid programs, and you might not even want to allow them to have programs at all. Separate partitions enforce that easily. You want the main system configuration directory to be unchangeable, so an intruder or a clumsy user cannot alter it? That's trivial with separate partitions. If one partition is damaged, chances are that damage will not extend to other partitions. You can boot the system using the intact partitions and attempt to recover the data on the damaged partition. Finally, correct use of partitioning can enhance security. Not only will hackers have a more difficult time if they do break into your machine, but your own users will find it more difficult to accidentally damage the system. Before partitioning a hard drive, decide what the system will be used for. Is this a mail server? A Web server? A desktop machine? We'll discuss the requirements for each partition for different types of servers.
Standalone OpenBSD Partitioning
If you're installing a dedicated OpenBSD machine, you don't have to worry about sharing the hard drive with another operating system. This simplifies the partitioning process — you only have to worry about OpenBSD's requirements.

The main partitions you'll need to consider are / (root), swap space, /tmp, /var, /usr, and /home. If you forget to create any of these partitions, the installer will put the files that should go in the partitions into your root partition. This will quickly fill up your root partition!

Root
The root partition holds the main system configuration files and the most essential UNIX utilities needed to get a computer into single-user mode. Your system should have fast access to its root file system, so put it first on the disk. Because it holds only these basic utilities and configuration files it doesn't need to be large; on a modern hard drive, I find a 500MB root partition comfortably roomy. I would recommend no smaller than 50MB for a root partition. (You could scrape by with a few megabytes smaller; the exact minimum size varies with the version of OpenBSD.)

If you're familiar with other some other UNIX-like operating systems, such as some distributions of Linux, you might be used to simply using a single large root partition and putting everything on it. This is a bad idea for a variety of reasons. With a partition safely constraining your log files, a process or user gone amok cannot fill your entire drive; while it could fill a partition, you would still be able to create and edit files on other partitions, giving you the flexibility you need to address the actual problem. Also, with a single partition, you cannot control where files are put on the disk. This hurts performance. Damage to the disk is probably spread across many different files in unrelated parts of the system, which means that your chances of recovering from a damaged disk or file system problems drop dramatically.

Root Limitations
Over the years, i386 systems have been expanded time and time again to surpass their own limits. They're based upon an architecture that could originally handle a maximum of 640KB of RAM, after all! The OpenBSD kernel — indeed, all modern operating system kernels — work around these limits in a manner mostly transparent to the user, but when the system is first booting you're trapped with the BIOS limitations.

Many old i386 systems have a 504MB limit on hard drives, on which the BIOS cannot get at anything beyond the first 504MB of data on a disk. If your BIOS cannot find your operating system kernel in that first 504MB, it cannot boot the system. Check your hardware manual; if it makes any references to a 504MB limit, this affects you. You absolutely must place your entire root partition within the first 504MB of disk.

Additionally, for some time i386 systems had a similar (not identical) 8GB limit. OpenBSD still obeys that 8GB limit. Even if your system is not susceptible to the 504MB limit, your entire root partition must be completely contained within the first 8GB of disk.

Of course, if you follow my advice and make your root partition 500MB you will never have to worry about either of these restrictions and the potential damage that they can inflict.

If you break these rules, your system will probably appear to work. The second you upgrade your system, or move the file /bsd, the computer will quite probably refuse to boot. Save yourself much pain; make the root partition 500MB, and the first partition on the disk, and this problem will never affect you.

Swap Space
The next partition on your drive should be swap space, the disk space used by virtual memory. When your computer fills its physical memory, it will start to move information that has been sitting idle in memory into swap. If things go well, your system will almost never need swap space, but if you do need it, it needs to be fast.

So, how much swap space do you need? This is a matter of long debates between sysadmins. The short answer is, "It depends on the system." General wisdom says that you should have at least twice as much swap as you have physical memory. This isn't a bad rule, so long as you understand that it's very general. More won't hurt. Less might, if your system runs out of RAM.

If you find that you need more swap space, you should probably buy more memory instead. If that's not an option, you can use a regular file as a swap file. Still, if you have a reasonable amount of disk space, simply assigning an amount of swap equal to twice the amount of RAM you have is sensible.

You should also consider possible future upgrades. If a computer has 500MB of RAM today, but you plan to upgrade it to 3GB of RAM in a couple of months, perhaps assigning 6GB of disk space to swap is a good idea. After all, if you can afford three gigs of RAM and you have the hardware to manage it, certainly that much disk is not an issue!

Swap Splitting
If you have multiple disks, you can vastly improve the efficiency of your swap space by splitting it among multiple drives. Put the first swap partition on the second-outermost ring of the drive with your root partition, and other swap space on the outermost edge of their drives. This splits reads and writes among multiple disk controllers.

For swap splitting to work best, however, the drives must be SCSI. If you have IDE drives, the drives need to be on different IDE controllers. Remember, each IDE controller splits its total data throughput among all the connected hard drives. If you have two hard drives on the same IDE controller and you're accessing both drives simultaneously, each disk will average half as fast as it would if you were running it alone. The major bottleneck in using swap space is data throughput speed, and you won't gain speed by creating contention on your IDE bus.

/tmp
The /tmp directory is system-wide temporary space. If you do not create a separate /tmp partition, it will be included on your root partition. This means that your system-wide temporary space will be subject to the same conditions as the rest of your root drive. This probably isn't what you want, especially if you plan to mount your root partition read-only!

Requirements for a /tmp directory are generally a matter of opinion — after all, you can always just use a chunk of space in your home directory as temporary space. On a modern hard drive, I like to have at least 500MB in a /tmp directory. Automated software installers frequently want to extract files in /tmp, and having to work around these installers when /tmp fills up is possible but tedious.

/var
The /var partition contains frequently changing logs, mail spools, temporary run files, the default website, and so on. If your server is a Web server, your website logs will go to this partition, and you may need to make it 1GB or more. On a small "generic Internet mail/Web server," I'll frequently give /var 20 percent of my remaining disk space. If the server handles only email or databases, I'll kick this up to 70 percent or more, or just assign a space to the remaining partitions and throw everything else I have on /var. If you're really cramped for space, you might assign as little as 30MB to /var. (Again, actual minimum requirements vary depending on your version of OpenBSD.)

/usr
The /usr partition holds the operating system programs, system source code, compilers and libraries, and other little details like that. Much of this changes only when you upgrade your system.

On a modern hard drive, I recommend using about 6GB on your /usr partition. This should be more than sufficient for all the contents of /usr and just about any add-on packages you might desire, and should also leave room for any OpenBSD source you might want to install. Without the X Window System, you could make /usr as small as 200MB. If you need X, you should assign /usr at least 350MB.

/home
The /home partition is where users keep their files. If you have more disk space than is good for you, assign it here. Your home directory will quickly fill up with all sorts of stuff that you'll be tripping across years from now.

The /home partition can easily be the last on your disk; it doesn't need to be fast. It also doesn't need to be large; the only files on the drive will be the ones that you need.

Note  If you've been adding this up, you should notice that it's entirely possible to have a complete OpenBSD system (without the X Window System) in less than 300MB. Just for kicks, compare that to the amount of space a minimal install of Windows XP requires or the size of an minimal Solaris 9 box installation. Your complete install, with all your user programs, may be far larger than 300MB — but all that space is used up because of things you specifically want, not OS overhead.


Multiple Hard Drives
If you have a second hard drive of comparable quality to your main drive, you can make excellent use of it with proper planning. First, use the outer edge of the drive for swap, as discussed earlier in the "Swap Splitting" section. Use the rest of the drive to segregate your data from your operating system. Do this by assigning the remainder of the drive to the partition that stores files for whatever your server does the most of. If it's a Web server, make the second drive /www or /home. If it's a mail server, use it for /var or /var/mail. If it's a network logging host, assign the second drive to /var/log.

In general, segregating your operating system from the data you're serving increases system efficiency. Like all rules of thumb, this is debatable. But no sysadmin will tell you that this is an actively bad idea, while one can argue endlessly about what the "absolute best" idea is.

If you have no idea what your system will be for, make your second drive /usr and split your first hard drive amongst /var, /tmp, /, and swap space.

If your second drive is much slower than your main system drive, don't bother using it. Not only will its performance be poor, chances are that it is much older than your main drive and far more likely to fail.

If you need to install more than one operating system on your computer, an extra hard drive is an excellent and easy way to do that.

论坛徽章:
0
5 [报告]
发表于 2006-03-04 15:07 |只看该作者
翻译如下:
分区
安装openbsd时最困难的是确定如何分区你的硬盘,当你不知道分区如何工作时,选择一个分区布局是很棘手的。不像很多安装程序提供了华丽的菜单和图形工具,openbsd安装程序认为你会使用低级磁盘管理工具。
分区是一块硬盘逻辑上的一部分,不同的分区可以用不同的方法来处理,甚至可以有不同的文件系统或不同的操作系统安装在他们上面。我们将讨论单个操作系统和多重操作系统安装的分区。
注:用一张纸记下关于你分区的一些东西,从记录你的硬盘容量开始(这是你用来划分分区的总的空间大小),到记录下你想要划分分区的大小和分区放置顺序。这将使你的openbsd安装更加容易。
为什么分区?
分区看起来可能使人厌烦,但为什么你要费心于它?很多商业操作系统允许你在整个硬盘上简单的仅有一个大的分区,给你一个单个的80-gig分区。分区的优点是什么?
不同的操作系统有不同的分区类型和硬盘布局需求。一个微软的操作系统不能认出openbsd的磁盘格式,在使用它前,一定要先格式化它。但是openbsd能够安装大多数为现在流行的操作系统设计的分区,不要把openbsd操作系统的主要程序放在不属于他的分区上,让每个操作系统运行在磁盘上属于他们的那一块,如果你想在你的机器上安装多个操作系统,那你就必须分区。
但是当你运行一个只安装openbsd操作系统得机器时,为什么还要为划分硬盘费心?在物理级,硬盘的不同部分运行速度不同,把需要频繁存取的数据放在磁盘运行速度快的那部分,你可以提高系统性能。要实现这个安排的唯一办法就是分区。操作系统单独地控制每个分区,也意味着你可以有差别地配置每个分区或用不同的规则来设置它们。例如,Root分区是唯一需要设备节点的分区,因此你可以告诉其他分区不识别设备节点,包含用户数据的那些分区应该没有setuid程序,甚至你可能不想让这些分区包含任何程序,单独的分区使这些都变得很容易。你想要主系统配置目录不能被改变,以便于入侵者或新手不能修改它?使用单独的分区是很平常的。如果一个分区被损坏,可能性是损坏没有扩展到其他分区,你可以使用完好的分区来引导系统并尝试恢复损坏分区上的数据。最后,正确的使用分区可以提升系统的安全性,不但黑客更加难以入侵你的机器,而且你们自己的使用者也会发现偶然地损坏系统也会更加困难。在为一个硬盘分区前,考虑一下系统将被用来做什么,一个邮件服务器?一个web服务器?还是一个桌面pc?接下来我们将讨论在不同类型的服务中每个分区的需求。

单独openbsd电脑的分区
如果你正在安装一个openbsd专用的机器,你不用为与其他操作系统分享硬盘而操心,这简化了分区过程——你只需要操心openbsd的需求。
你主要需要考虑的分区是/(root),交换空间(swap),/tmp,/var,/usr和/home分区。如果你忘记建立任何这些分区,安装程序将会把原本属于这些分区的文件放到你的root分区,这将很快填满你的root分区。
Root
Root分区包含主系统配置文件和大多数使计算机进入单用户模式所需的unix工具。你的计算机应该快速存取root文件系统,因此,把root分区第一个放在磁盘上。由于这个分区仅仅包含那些基本工具和配置文件,因此它不需要很大。在现代的硬盘上,我发现500MB的root分区就很宽裕了。建议你的root分区不要小于50MB。(根据不同版本openbsd确切的最小空间需求,你可以使用更少的空间来勉强度日。这一句我不知道怎样表达好,就这样先凑合着吧)
如果你熟悉一些其他类unix操作系统,例如一些linux发行版,你可能习惯简单的使用一个大的root分区,并把所有的东西放在它上面,从种种原因来说,这是一个坏主意。用一个分区来安全地限制你的日志文件,一个陷入狂乱的进程或用户不能填满你的整个磁盘;然而他可以填满一个分区,这样你仍然可以在其他分区上创建和编辑文件,给你查找真正的问题所在带来便利。另外,使用一个分区,你不能控制文件在磁盘上放置的位置,这样损害了性能。对硬盘的损害会扩展到系统不相关部分的不同文件,这就意味着你从一个被损害的磁盘或文件系统问题中恢复的可能性会明显降低。
根分区限制
这段就不翻译了,主要是说以前的老机器上的一些504M或8gb限制,现在的电脑上一般没有这些问题,例如我的电脑上op就是装在13g以后的空间中了,用起来也没什么问题。
交换空间
在你的驱动器上接下来的分区应该是交换空间,被虚拟内存使用的磁盘空间。当你的计算机填满它的物理内存,它将把内存中空闲不用的信息移到交换分区,如果事情进行的很好,你可能永远也不会使用到交换空间,但是如果你确实需要使用它,你需要使他更快。(注:所以要把交换分区放在第二个分区上,越靠近硬盘头部,速度越快
那么,你需要多大的交换空间呢?这是在系统管理员之间争论了很很长时间的一件事,简短的回答是“这取决于你的系统”,一般的看法是你至少需要两倍于物理内存大小的交换空间,如果你的系统耗尽了内存,这是一个不错的规则,就像你所知道的,这是很笼统的,多一点没有害处,少一点也可以。
相反,如果你发现需要更多的交换空间,你可能需要买更多的内存。如果这不是一个选择,你可以用一个规则的文件来作为交换文件。尽管如此,如果你有一个合理的磁盘空间数量,简单的分配两倍于内存数量的磁盘空间是明智的。
你也应该考虑到以后的升级,如果你现在有500MB的内存,并计划在几个月内把它升级到3GB,可能分配6G的磁盘空间给交换分区是一个好主意。毕竟,如果你能提供3G的内存和硬件来管理他,无疑那么多的磁盘是没有争议的(注:这句话我自己都不明白,更不知道怎么表达了
交换分区分割
如果你有多个磁盘,通过把交换空间分割到多个磁盘,你可以极大地提升交换空间的效率。把第一个交换分区放在root分区后面,其他交换空间放在其所在磁盘的最外边,这样分担读写在多个磁盘控制器上。
然而,为了使交换分区分割更好的工作,这些磁盘必须是scsi接口的磁盘。如果你使用ide磁盘,这些磁盘需要在不同的ide控制器上。记住,ide控制器他的数据吞吐量分割到所有连接到它上面的硬盘上,如果你有两个硬盘连接到同一个ide控制器上,并且你同时存取这两个硬盘,每一个硬盘均分的速度是他们单独运行时速度的一半。在使用交换空间时的主要瓶颈就是数据吞吐速度,在你的ide总线上引起竞争不能增加速度。
/tmp
/tmp目录是系统范围的临时空间,如果你不单独创建一个/tmp分区,它将包含在你的root分区,这就意味着你的系统范围的临时空间将遵从root分区剩余部分一样的条件,这可能不是你想要的,特别是你计划要把root分区安装成只读时。
毕竟,/tem目录的需求是有关看法的一件事,你可以在你的home目录里用一大块空间作为临时空间。在一块现代的硬盘上,我喜欢给/tmp目录至少分配500MB空间。自动的软件安装程序经常需要把文件解压到/tmp目录,当/tmp有可能被充满但是冗长时不得不围绕这些安装程序工作。
/var
/var目录包含经常变化的日志文件、mail spools(邮件卷轴?)、临时性的运行文件、默认的web站点等等。如果你的服务器是一个web服务器,你的web站点日志将会放在这个分区,你可能需要为他分配1GB或更大的空间。在一个小的普通的mail/web服务器上,我经常把剩余磁盘空间的20%分配给/var,如果这个服务器只运行email或数据库,我将分配给他70%或更多的空间。或者把剩余的分区分成一个空间,把我所有其他的东西都放在/var中,如果你确实空间不足,至少要为/var分配30MB空间。(确切的最小需求依赖于因openbsd版本的不同而不同)
/usr
/usr目录包含操作系统程序、系统源代码、编译器和库以及其他的像这样的一些小细节。他们中的许多只有在你升级系统时才改变。
在一个现代的的硬盘上,我建议你给/usr目录分配大约6GB,这对/usr下的内容和你想要增加的包来说足够用,并且还为你想要安装的任何openbsd源程序留出了空间。如果不安装x窗口系统,至少要为/usr分配200MB,如果你需要x,那么/usr至少要有350MB。
/home
用户把他们的文件保存在/home分区中。如果你有更多的磁盘空间,对你来说是好事,在这里分配它。在未来的几年里,/home目录会很快被各种材料填满。
无疑,/home分区被作为磁盘上的最会一个分区,它既不需要很快也不需要很大,在这个分区上只包含你需要的文件。
注:如果你把上面的这些加起来,你就会注意到完全安装openbsd(不包括x)不超过300MB。作为一时的兴趣,与winxp或solaris 9的最小安装对比一下。如果你完全安装还包括你的用户程序,将会远远超过300MB,这并不是操作系统本身有这么大,而是你特殊需要的程序占用了空间。
多个硬盘
如果你有第二块和主硬盘性能一样的硬盘,通过恰当的计划,你可以很好的使用它。首先,像swap分区那节讨论的一样,把这块硬盘最外的部分作为交换分区。使用剩余的空间把你的数据从操作系统中分离出来,通过把服务经常使用的文件存储到剩余空间划分的分区来达到这个目的。如果是一个web服务器,把第二块硬盘分区成/www或者/home,如果是一个邮件服务器,把它分区成/var或/var/mail;如果是网络登陆主机,把它分区成/var/log。
一般情况下,把数据从操作系统中分离出去可以提高系统性能,像其他的拇指规则一样,这也是存在争议的,尽管人们可以无止境的争论什么是“最好”的主意,但是没有一个系统管理员会告诉你这确实是一个坏主意。
如果你对你的系统没有什么主意,可以把第二块硬盘作为/usr,第一块硬盘划分成/var, /tmp, /, 和 swap space。
如果你有比主系统盘慢得多的第二块硬盘,不要操心来使用它,不但他的性能会低的可怜,而且可能比主系统盘要老的多,甚至于处在即将报废的边缘。
如果你需要安装多个操作系统,多余的硬盘是很好的,这将使这项工作变得容易的多。

[ 本帖最后由 wuyanxiao 于 2006-3-4 15:16 编辑 ]

论坛徽章:
0
6 [报告]
发表于 2006-03-04 15:11 |只看该作者
openbsd faq 3.8中介绍原文如下:

4.7 - How much space do I need for an OpenBSD installation?
Obviously, the answer to this question varies tremendously based on your use of the system. However, these numbers can be used as a starting point:

(root)             100MB
/usr               250MB (no X) or 400MB (with X)
/var               25MB
/tmp               50MB
swap               32MB

Those are minimum suggested filesystem sizes for a full system install. The numbers include enough extra space to permit you to run a typical home system that is connected to the Internet, but not much else.
Keep the following facts in mind, however:

These are minimum values. Disk space is relatively cheap now, trying to squeeze your system into the smallest possible disk is rarely worth the effort. For special purpose applications, the above numbers can be made smaller, but you will need to experiment with it.
If you plan to install a significant amount of third party software, make your /usr partition much larger. How large will depend on your applications, of course.
For a system that handles lots of email or web pages (stored, respectively, in /var/mail and /var/www) you will want to make your /var partition significantly larger, or put them on separate partitions.
For a multiuser system which may generate lots of logs, you will want to make your /var partition significantly larger still, or create a separate log partition (/var/log).
If you plan to rebuild the kernel and system from source, you will want to make the /usr partition significantly larger, 3G is not a bad size.
Compiling some ports from source can take huge amounts of space on your /usr and /tmp partitions. This is another reason we suggest using pre-compiled packages instead.
The /tmp partition is used in the compiling of ports, among other things, so how big you make it depends on what you do with it. 50M may be plenty for most people, but some large applications may require 100M or more of /tmp space.
The 'b' partition of your first drive automatically becomes your system swap partition -- we recommend a minimum of 32MB but if you have disk to spare make it at least 64MB. If you have lots of disk space to spare, make this 256MB, or even 512MB. On the other hand, if you are using a flash device for disk, you probably want no swap partition at all. Many people follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. This rule is nonsense. On a modern system, that's a LOT of swap, most people prefer that their systems never swap. Use what is appropriate for your needs.
Swap and /var spaces are used to store system core dumps on in the event of a crash(8). If this is a consideration for you, your swap space should be slightly larger than the amount of main memory you are likely to ever have in the system. Upon reboot, savecore(8) will attempt to save the contents of the swap partition to a file in /var/crash so again, if this is a priority for you, your /var partition must have enough free space to hold these dump files. Be realistic -- few developers will want to look at your 1GB dump file, so if you aren't planning on investigating a crash locally, this is probably not a concern.
There are several reasons for using separate filesystems, instead of shoving everything into one or two filesystems:

Security: You can mark some filesystems as 'nosuid', 'nodev', 'noexec', 'readonly', etc. This is done by the install process, if you use the above described partitions.
Stability: A user, or a misbehaved program, can fill a filesystem with garbage if they have write permissions for it. Your critical programs, which of course run on a different filesystem, do not get interrupted.
Speed: A filesystem which gets written to frequently may get somewhat fragmented. (Luckily, the ffs filesystem that OpenBSD uses is not prone to heavy fragmentation.)
Integrity: If one filesystem is corrupted for some reason then your other filesystems are still OK.
Size: Many machines have limits on the area of a disk where the boot ROM can load the kernel from. In some cases, this limit may be very small (504M for an older 486), in other cases, a much larger limit (for example, 2G, 8G, or 128G on i386 systems). As the kernel can end up anywhere within the root partition, the entire root partition should be within this area. For more details, see this section. A good guideline might be to keep your / partition completely below 2G, unless you know your platform (and particular machine) can handle more (or less) than that.
Some additional thoughts on partitioning:

For your first attempt at an experimentation system, one big / partition and swap may be easiest until you know how much space you need. By doing this you will be sacrificing some of the default security features of OpenBSD that require separate filesystems for /, /tmp, /var, /usr and /home. However, you probably should not be going into production with your first OpenBSD install.
A system exposed to the Internet or other hostile forces should have a separate /var (and maybe even a separate /var/log) for logging.
A /home partition can be nice. New version of the OS? Wipe and reload everything else, leave your /home partition untouched. Remember to save a copy of your configuration files, though!
A separate partition for anything which may accumulate a large quantity of files that may need to be deleted can be faster to reformat and recreate than to delete. See the building by source FAQ for an example (/usr/obj).
If you wish to rebuild your system from source for any reason, the source will be in /usr/src. If you don't make a separate partition for /usr/src, make sure /usr has sufficient space.
A commonly forgotten fact: you do not have to allocate all space on a drive when you set the system up! Since you will now find it a challenge to buy a new drive smaller than 20G, it can make sense to leave a chunk of your drive unallocated. If you outgrow a partition, you can allocate a new partition from your unused space, duplicate your existing partition to the new partition, change /etc/fstab to point to the new partition, remount, you now have more space.
If you make your partitions too close to the minimum size required, you will probably regret it later, when it is time to upgrade your system.
If you make very large partitions, keep in mind that performing filesystem checks using fsck(8) requires about 1M of RAM per gigabyte of filesystem size, and may be very time-consuming or not even feasible on older, slower systems (please also refer to this section).
If you permit users to write to /var/www (i.e., personal web pages), you might wish to put it on a separate partition, so you can use quotas to restrict the space they use, and if they fill the partition, no other parts of your system will be impacted.

翻译如下:
4.7 安装openbsd时需要多少空间?
很显然,答案极端地依赖于你如何使用系统,然而下面的这些数据可以作为一个开始点。
(root)             100MB
/usr               250MB (no X) or 400MB (with X)
/var               25MB
/tmp               50MB
swap               32MB
对于完全的系统安装来说,这是建议的最小文件系统大小。这些数据包含足够的额外空间来允许你运行连接于internet家庭系统,但是没有更过的空间来做其他。
记住下面的这些事实:
        这些是最小的值。硬盘空间是相当的节省的了,试着把你的系统压缩到最小的空间是无谓的努力。对于特殊目的的应用,上面的这些数值还可以再小一点,但是你应该对此非常有经验。
        如果你计划安装大量的第三方软件,给你的/usr分区更大的空间,当然,分配多大的空间依赖于你的应用程序。
        对一个控制很多的电子邮件或web页面(分别存储在/var/mail 和 /var/www)的系统来说,你应该给/var分区大得多的空间,或者给这些目录分配单独的分区。
        对一个会产生很多日志文件的系统来说,你仍然需要给/var分区大得多的空间,或者为/var/log创建单独的分区。
        如果你计划从源代码重建内核和系统,你需要给/usr大得多的分区,3G是一个不错的数值。
        从源代码编译一些ports会占用大量的/usr和/tmp空间,这就是为什么我们反而建议你使用预先编译好的packages。
        /tmp被用来编译ports和其他的一些事情,因此,它的大小依赖于你要用它来做什么,对大多数人来说50M就足够了,但是一些大一点的应用程序需要100M或更多的/tmp空间。
        你的第一个硬盘上的b分区被自动的分配给系统交换分区,我们建议的最小大小是32MB,但是如果你有可分配的磁盘空间,我们建议你最少把它设置为64MB,如果你有许多可分配的磁盘空间,你可以把它设置为256MB甚至是512MB。从另一方面来说,如果你使用闪存设备来当作硬盘,你可能根本就不需要交换分区。许多人遵从这样一个旧的拇指规则:交换空间两倍于内存大小。这个规则是胡说,在一个现代的系统上,这是一个很大的交换空间,很多人宁愿他的系统从来就不使用交换分区。使用多少空间应该和你的需要相符。
        在使用crash(8)的情况下,交换空间和/var被用来转存系统核心,如果这是你的一个考虑,你的交换空间应该始终比你的内存稍微大一点。在系统重启的时候,savecore(8)将尝试把交换空间中的文件保存到/var/crash的一个文件中,如果这是你优先考虑的,你的/var分区应该有足够的空间来容纳转存的文件。实际上,很少开发者想要看到你转存1GB的文件,因此如果你不计划在本地研究crash,这可能不是一个要关心的事情。
下面是一些使用单独的文件系统而不是把所有的东西都挤在一个或两个文件系统中的原因:
        安全性:你可以把一些文件系统设置为'nosuid', 'nodev', 'noexec', 'readonly'等等,这被安装进程来完成,如果你使用上面描述的分区的话。
        稳定性:一个对某个文件系统有写权限的用户或不良程序可以把这个文件系统填满垃圾,你运行在其他分区上的关键程序可以继续运行而不被打断。
        速度:一个经常被写的文件系统会产生一些碎片。(幸运的是,openbsd使用的ffs文件系统不容易产生大量的碎片)
        健全:如果你的某个文件系统因某种原因被打断,其他文件系统还会运行的很好。
        大小:许多机器的引导rom在引导内核时对内核在硬盘上所处的区域有限制。在某些情况下,这个限制值非常小(在486机器上是504MB),另外一些情况下,这个限制值会大一点(例如,在386系统上有2G, 8G, 或 128G)。因为内核可能结束于整个root分区的任何地方,所以整个root分区应该在这个区域内。一个好的指导方针是把你的/分区放在2G之内,除非你知道你的平台可以比这个控制更多(或更少)。
对分区的一些进一步想法:
        对于你的第一次尝试体验这个系统的时候,一个大的/分区和交换分区会更容易一些,直到你知道你需要多大的空间。对于openbsd这样需要单独的/, /tmp, /var, /usr 和 /home分区的系统来说,这样做你将会损失一些系统默认的安全性。然而如果不这样做,你的第一次openbsd安装有可能会完不成。
        对于一个连接与internet或被迫暴露于敌人面前的系统来说,需要一个单独的/var分区(甚至是一个单独的/var/log分区)用来记录日志。
        一个单独的/home分区会很好,一个新版本的OS将会摸除和重载除了这个分区以外的所有其他东西。尽管这样,记着把你的配置文件备份一份。
        为需要删除大量堆积文件的目录建立一个单独的分区来格式化或重建要比删除文件快的多。
        如果你因为其他原因想要从源代码重建系统,源代码保存在 /usr/src,如果你不能为它建立一个单独的分区,你需要确保/usr有充足的空间。
        一个经常被遗忘的事实是:在安装系统的时候,你不得不把你磁盘空间耗尽。因此,从现在开始你就应该找个机会购买一块小于20G的硬盘,这样将会给你带来一块没有被分配的硬盘空间的益处。如果你的一个分区空间不够用,你就可以从你没有使用的空间中重新为其分配一个分区,使用duplicate来把你现有的分区转移到一个新的分区上,改变/etc/fstab把他指向到一个新的分区上,这样你将获得更多的空间。
        如果你把你的分区分成很接近建议的最小空间的时候,你很可能在不久的将来就后悔这样做,那时就是你升级系统的时候。
        如果你创建很大的分区,请记住:使用fsck(8)来检查文件系统,每G文件系统空间需要1MB内存,这将很浪费时间,并且不适用于老的、更慢的系统。
        如果你允许/var/www可写,你可能希望把它放在一个单独的分区,这样你就可以使用quotas来限制他们使用的空间,这样,如果他们填满这个分区,你的系统将没有其他的空间来被他们使用。

看了上面这些内容你就应该明白如何分配你的分区大小,如果不明白,那就是我翻译的太烂,还不如直接看英文版,所幸,我在这里引用了原版的英文版可供你观看。

基础知识知道了,下面我们将开始系统安装。
未完,待续..............

[ 本帖最后由 llzqq 于 2006-3-7 07:34 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2006-03-04 15:33 |只看该作者
晕,上面的“8 )”被“”代替了。

论坛徽章:
0
8 [报告]
发表于 2006-03-04 16:38 |只看该作者
真不错,楼主辛苦:)
(你提到的那篇文章是我写的,见笑^_^)
另外,我以前在CU发过一篇定制OpenBSD的ISO的文章,不过已经沉下去好久了。
链接是:http://bbs.chinaunix.net/viewthr ... mp;highlight=diogin
    由于OpenBSD官方未提供ISO,所以很多网友除了下载别人做的ISO外,只能自己定制。
虽然麻烦了点,但定制ISO可以让你真正领略到OpenBSD的“小即是美”的强大魅力,这点
上OpenBSD倒把我们兴趣给提起来了,害得我花了好久研究怎么彻底做个适合自己使用的
ISO,呵呵。
    OpenBSD FTP的3.8/i386目录里提供了一个可启动的ISO,叫做cd38.iso,但这个只
能做启动用,里面除了一个RAMDISK的Kernel外,没别的有用的东西。在这里我们就拿这
个文件开刀,在Windows下把它做成适合我们自己使用的定制过的ISO。
    首先下载这个cd38.iso,然后准备好UltraISO——一个制作和编辑ISO文件的工具。
用UltraISO打开这个cd38.iso,可以看到里面的目录树如下:

OpenBSD/i386    3.8 boot-only CD
│  TRANS.TBL

├─3.8
│  │  TRANS.TBL
│  │
│  └─i386
│          boot.catalog
│          bsd.rd
│          cdboot
│          cdbr
│          TRANS.TBL

└─etc
        boot.conf
        TRANS.TBL

首先我来讲讲这几个文件都有什么用。

TRANS.TBL     这个文件是传统的光盘映射用的,它把每个目录下的原始文件映射为
              cd9600格式的文件名。由于在这里没有这个文件也没什么事,我就把
              它删除了,如果你不放心,保留也没什么大碍。

boot.catalog  这个文件我用UltraEdit打开看了看,只有一个copyright的信息,没
              什么用,也直接删除了。

bsd.rd        这个是用光驱引导的时候启动的一个RAMDISK的Kernel,也就是说你用
              光驱启动的时候运行的是这个内核,当你安装好后运行的是bsd内核,
              但bsd内核在这个cd38.iso里没有提供。如果你要光盘安装,就一定要
              这个文件。这个内核内含安装时所需要的可执行代码。

cdboot        这个是由光盘引导程序直接引导的文件,用来加载内核。它运行的时
              候,会提示boot>,如果你几秒钟内没动,它就会自动加载/3.8/i386/
              bsd.rd,而如果你在光盘的这个目录下没有bsd.rd这个文件,它就会
              尝试bsd.old内核文件,如果还没有,它就尝试obsd这个内核文件,如
              果还是没有……它就一直重复,我狂汗。当然,你可以在开始那几秒
              钟里手动填入自己想引导的内核,来把它中断。它默认是按上面说的
              那个路径寻找内核的,这个路径通过/etc/boot.conf来设定。知道了
              这点后,我们就来解决它!由于我不喜欢在光盘根目录下看到/etc目
              录,所以我直接把/etc目录干掉,这样boot.conf文件自然也没了,
              本来以为cdboot就不知道该在哪找bsd.rd了,结果这家伙居然还知道
              应该在/3.8/i386/bsd.rd处找,我再ft!看来它是把这个目录写进文
              件本身了,我用UltraEdit打开它看了看,果然找到一段文字:
              ./3.8/i386/bsd.rd./bsd./obsd./bsd.old
              由此看来,它一直循环查找这4个路径,这下好办了,你可以修改这个
              文件,改成你自己喜欢的,不过我没试成功,因为对改这个没经验…
              所以,就暂时老实些,把bsd.rd放到/3.8/i386/bsd.rd去吧,呵呵。

cdbr          这个文件存放的是光盘的引导信息,用UltraEdit打开也能看到,它
              的目的是定位cdboot这个文件,然后由cdboot来进一步引导内核。其
              实说起来一点也没什么。如果你要空手开始做bootable光盘,你就要
              把这个文件设置成boot file(在UltraISO里的那个齿轮按钮就是完成
              这个功能用的),这样一来,ISO就成了bootable了,呵呵。

boot.conf     里面就一行:set image /3.8/i386/bsd.rd,前面已经说了,cdboot
              没这个文件也能自己找路径,所以这个文件没什么用,直接删了。

好了,总结一下:

    如果你全新开始做ISO,就要把cdbr引入,以制作bootable的ISO,如果是修改
cd38.iso,就不用引进了,它里面已经包含了。其它的,把/etc目录删了,把那些
看着不舒服的TRANS.TBL也删了,cdbr在引入可引导信息后(或者你修改cd38.iso),
也直接删了,boot.catalog也删了。最后的目录如下:

OpenBSD
└─3.8
    └─i386
            bsd.rd
            cdboot

    注意,我把光盘名称也改了,好看一点。
    接下来,我们往里面添加必要的文件。首先当然是从FTP上下载3.8/i386目录下的
必要的文件了,下载到本地随便哪一个目录,过会儿要把它添加到ISO的3.8/i386目录
下的。至于要下哪些文件,就看你自己的需要了,各文件说明如下。

base38.tgz //一定要
bsd        //GENERIC内核,不是SMP内核都要
bsd.mp     //因为我机器没有多个处理器,所以这个就不用了
bsd.rd     //跟cd38.iso里的bsd.rd一样,所以就不用下了
cd38.iso   //前面已经下了……
cdboot     //同上,cd38.iso里已经有了
cdbr       //同上
cdemu38.iso//对一般的机器,这个没用
cdrom38.fs //我不用软盘的,不要
CKSUM      //校验和,可以用winmd5对照着检查一下,我就不下了
comp38.tgz //C与C++等编译环境,明显要,不然写个程序都没得编译
etc38.tgz  //要,/etc下的文件
floppy***  //不要,我不用floppy
game38.tgz //游戏,不玩,不要
index.txt  //就是这个目录的索引了,可以下过来看看,我是没下的
INSTALL.i386 //这个文件很详细,强烈推荐下载过来看看!
INSTALL.linux //多系统共存用的,也可以下载过来看看
man38.tgz  //man文档,明显要
MD5        //校验用,同CKSUM
misc38.tgz //杂类工具,什么字典之类的,随便,我没下
pxeboot    //网络安装用的,我不要
TRANS.TBL  //这个。。。扔了
xbase38.tgz//装x的话,要
xetc38.tgz //同上
xfont38.tgz//同上
xserv38.tgz//同上
xshare38.tgz//同上

其它的文件我就没注意了,我只下了以下几个:

base38.tgz
bsd
comp38.tgz
etc38.tgz
man38.tgz

没有X,注意了。接下来,把上面5个文件添加到cd38.iso的3.8/i386目录下,此时
cd38.iso的结构为:

OpenBSD
└─3.8
    └─i386
            base38.tgz
            bsd
            bsd.rd
            cdboot
            comp38.tgz
            etc38.tgz
            man38.tgz

就这样,一个经典简洁的OpenBSD Bootable ISO就做好了。当然如果你还有其它东
西,完全可以再添加进去。

    如果你还要再加点其它的东西呢?比如源码包——src.tar.gz和sys.tar.gz之
类的,这样的话你就在根目录下新建一个目录,比如source,然后把包放进去。可
以只下ports.tar.gz(ports的源码)、src.tar.gz(系统软件源码)、sys.tar.gz(内
核源码)。这样一来,目录结构变为:

OpenBSD

└─3.8
     │
     ├─i386
     │     base38.tgz
     │     bsd
     │     bsd.rd
     │     cdboot
     │     comp38.tgz
     │     etc38.tgz
     │     man38.tgz
     │
     └─source
            ports.tar.gz
            src.tar.gz
            sys.tar.gz

接下来直接另存这个ISO为OpenBSD-3.8-i386.iso就一切搞定。
这样做出来的ISO没有X,容量大小为197M。放入VMWare5.0里试了下,完全正常。
至于怎么安装OpenBSD,这里就不说了,推荐你看看那个INSTALL.i386文件,强
列推荐!
     
其实OpenBSD也并不像想象中的那么麻烦,捣鼓一番觉得还是挺简单的。
另外,OpenBSD的“小即是美”真的很有诱惑力,推荐大家去尝试一下:)

论坛徽章:
0
9 [报告]
发表于 2006-03-05 08:48 |只看该作者
我把openbsd的安装过程成分成了两部分:
第一部分:安装过程的前半部分,无论才采用何种安装方式(光盘安装、硬盘安装或网络安装),这部分的内容都一样。
第二部分:安装过程的后半部分,根据你安装方式的不同,提示的内容也不一样。

      需要注意的是:第一部分,根据你采用的启动镜像文件不同和你的计算机设备的不同,出现的提示也有一点差别,我这里因条件的限制,主要依据openbsd官方网站上3.8的安装过程来为大家描述出现的内容,至于你实际安装时的不同情况,如果你不熟悉english,请你查字典来解决。

闲话少说,我们现在开始i386平台上的openbsd3.8安装:
第一部分:
      无论你是使用光盘、软盘、硬盘或网络启动,在第一部分,你获得的提示内容应该基本相同。(光盘、软盘和硬盘启动介质的制作,前面已经说过,至于网络启动,我想应该可以,但是我这里不具备相应的条件,所以就没有试过,如果你有这个兴趣和相应的条件,可以baidu或google这方面的内容,并且试试。当然,前三种启动介质的制作方法应该还有很多很多种,如果你有这方面的兴趣和精力,尽可以一个一个的试试:wink:)
      下面这些提示内容,你可以轻易的在网上找到许多原创,我不过是在这些内容的基础上汇总了一些一个菜鸟第一次安装时我认为应该知道到的一些东西,所以,请不要嫌我罗嗦。
       :oops:好了,现在真正开始安装了:

安装程序引导后,停在这里:
1、
  rootdev=0x1100 rrootdev=0x2f00 rawdev=0x2f02
  erase ^?, werase ^W, kill ^U, intr ^C, status ^T
  (I)nstall, (U)pgrade or (S)hell?

提供了三个选项(I)nstall, (U)pgrade 和 (S)hell,你可以在问号后输入这三个选项,也可以输入括号内的字符来选择其中的一项来继续进行。
(I)nstall:是进行全新的安装;
(U)pgrade:是在已有的op系统上进行升级使用的;
(S)hell:进入引导程序的shell界面,如果你使用过其他的一些光盘版运行的操作系统,你就会发现这个界面和那些差不多,当然,这只具备一个完整系统的一部分功能,你可以使用这个来进行一些操作。在这个界面输入:install,你可以重新进行安装。
当然,做为本文的目的,你输入i,然后回车,进行全新的安装。
2、
Welcome to the OpenBSD/i386 3.8 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.

  Specify terminal type: [vt220] 回车               //注释:指定终端类型
  kbd(8) mapping? ('?' for list) [none] 回车               //注释:选择一个键盘编码表

大多数情况下,默认的终端类型就可以。但是如果你使用串行控制台进行安装,你就不能用默认的了,必须做适当的回答。(注意:从开始安装到结束,中括号[]内显示的内容是默认值,如果你直接回车,就相当于你输入中括号中的内容然后回车。)

如果你不需要选择一个键盘编码表,你将默认使用US键盘布局。
3、
  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] y                      //注释:问你是否继续进行安装,当然要输入y了

4、设定磁盘分区
  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] 回车             //注释:问你使用那个磁盘作为根磁盘。

根磁盘就是启动系统的那个磁盘,一般交换分区也位于该盘。通常,默认就可以。如果不是这样,你就需要知道如何强迫计算机从一个非标准的磁盘启动。IDE硬盘为wd0,wd1等,SCSI和RAID以及usb存储设备显示为sd0,sd1等。OpenBSD能找到的所有磁盘将显示在这里,输入你想要的磁盘符号然后回车就可以了,如果你的硬盘没有显示在这里,那么可能是不支持或者是硬件配置错误。
5、
Do you want to use *all* of wd0 for OpenBSD? [no] 回车       //注释:问你是否把上一步选择的设备整个分配给OpenBSD,默认是否(no)

如果你输入"yes",整个硬盘将会分配给OpenBSD.这将会将标准MBR和分区表写入磁盘,分区只有一个,大小为整个硬盘,OpenBSD分区类型,并且也是启动分区。这一般只用于大多数的将OpenBSD用商用的情况。然而,有些系统却不允许你这么做。许多Compaq系统,laptop和一些Dell及其他系统使用一个"maintenance"或者"Suspend to Disk"分区,不能对它进行修改。假如你的系统有其他的类型的其他分区,并且你不想删除它,请不要选择"yes".
我们的例子假设对已存在Windows 2000分区的磁盘划分OpenBSD分区,所以我们使用默认的"no",它将会带我们进入fdisk程序。你可以在此获得关于fdisk(8)的更多信息。

上面几步内容的解释基本上全部来源于Freebird翻译的openbsd faq第四章的拷贝,下面的分区操作,我们将在这个基础上进行更加基础、详细的介绍。
未完,待续.............

[ 本帖最后由 llzqq 于 2006-3-7 07:34 编辑 ]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
10 [报告]
发表于 2006-03-05 10:22 |只看该作者
实在很抱歉,FAQ当初翻译得很潦草,呵呵,我希望可以找个时间重新翻译一次。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP