作者:小项-怪物猪
分类:FreeBSD
要让机器使用carp有两种方法实现:
1、加入内核
cd /usr/src/sys/i386/conf #进入内核目录
cp GENERIC NEWKERNEL #复制一个新文件
vi NEWKERNEL #编辑我们复制的新内核文件
在里面加入
device carp
开始编译{以前都用这种}
config NEWKERNEL
cd ../compile/NEWKERNEL
make cleandepend && make depend
make
make install
或者是{现在好像都用这种}
cd /usr/src
make buildkernel KERNXONF=NEWKERNEL
make installkernel KERNCONF=NEWKERNEL
各机配置:
Server1 机:
IP: 192.168.0.204
vi /etc/rc.conf
加入
cloned_ifterfaces="carp1"
#ifconfig_carp1="vhid 1 pass 123123 192.168.0.218/24"
ifconfig_carp1="vhid 1 pass 123123 192.168.0.204/24"
Server2 机:
IP: 192.168.0.226
vi /etc/rc.conf
加入
cloned_ifterfaces="carp2"
#ifconfig_carp2="vhid 2 pass 123123 192.168.0.234/24"
ifconfig_carp2="vhid 2 pass 123123 192.168.0.226/24"
Backup 机:
IP: 192.168.0.223
vi /etc/rc.conf
加入
cloned_ifterfaces="carp1 carp2"
ifconfig_carp1="vhid 1 pass 123123 192.168.0.204/24"
ifconfig_carp2="vhid 2 pass 123123 192.168.0.226/24"
#ifconfig_carp1="vhid 1 pass 123123 192.168.0.218/24"
#ifconfig_carp2="vhid 2 pass 123123 192.168.0.234/24"
经过测试发现,如果carp的ip设定跟本机ip不同的时候会出来Server1机断开后通过204不能访问到Backup机;但是通过218的就可以访问。
虚拟机里面测试为了区分个web的访问都加了不同的端口, 在Backup机的httpd.conf 里面必须加上两个Server机的访问端口{为这个问题折腾了一宿}。
/etc/sysctl.conf 加入
net.inet.carp.preempt=1 # 当主机中有一个 CARP 网络接口失去响应时, 这个选项将停止这台主机上所有的 CARP 接口。 默认禁用
net.inet.carp.arpbalance=1 # 使用 ARP 均衡本地网络流量。 默认禁用。
net.inet.carp.log=2 # 当值为 0 表示禁止记录所有日志。 值为 1 表示记录损坏的 CARP 包。任何大于 1 表示记录 CARP 网络接口的状态变化。默认值为 1。
作者:小项-怪物猪
分类:FreeBSD
sysctl 是一个用来在系统运作中查看及调整系统参数的工具。有的 sysctl
参数只是用来回报目前的系统状况,例如回报目前已开机时间、所使用的操作系统版本、核心名称等等;而有的可以让我们修改参数以调整系统运作的行为,例如网
络暂存内存的大小、最大的上线人数等等。而这些可以调整的参数中必须在一开机系统执行其它程序前就设定好,有的可以在开机完后任意调整。
首先我们可以使用下列指令来查看目前所有的 sysctl 参数及其状况:
# sysctl -a | more
kern.ostype: FreeBSD
kern.osrelease: 5.2.1-RELEASE
kern.osrevision: 199506
kern.version: FreeBSD 5.2.1-RELEASE #0: Sun Apr 11 16:16:08 CST 2004
alex@alexwang.com:/usr/src/sys/i386/compile/ALEX
kern.maxvnodes: 17812
kern.maxproc: 2020
kern.maxfiles: 4040
kern.argmax: 65536
kern.securelevel: -1
kern.hostname: alexwang.com
kern.hostid: 0
kern.clockrate: { hz = 100, tick = 10000, profhz = 1024, stathz = 128 }
kern.posix1version: 200112
kern.ngroups: 16
kern.job_control: 1
kern.saved_ids: 0
kern.boottime: { sec = 1081672724, usec = 885137 } Sun Apr 11 16:38:44 2004
kern.domainname:
kern.osreldate: 502010
kern.bootfile: /boot/kernel/kernel
kern.maxfilesperproc: 3636
kern.maxprocperuid: 1818
kern.ipc.maxsockbuf: 262144
kern.ipc.sockbuf_waste_factor: 8
kern.ipc.somaxconn: 128
kern.ipc.max_linkhdr: 16
kern.ipc.max_protohdr: 60
kern.ipc.max_hdr: 76
kern.ipc.max_datalen: 132
kern.ipc.nmbclusters: 9024
………略………
我们也可以使用 sysctl 显示单一的参数值,例如:
# sysctl kern.ipc.maxsockbuf
kern.ipc.maxsockbuf: 262144
并非所有的参数都可以使用 sysctl 进行调整,而且有的参数对于效能的影响并不大。我们仅在此说明一些影响较明显的设定。
9.2.1 kern.ipc.maxsockets
这是用来设定系统最大可以开启的 socket 数目。如果您的服务器会提供大量的
FTP 服务,而且常快速的传输一些小档案,您也许会发现常传输到一半就中断。因为 FTP 在传输档案时,每一个档案都必须开启一个 socket
来传输,但关闭 socket 需要一段时间,如果传输速度很快,而档案又多,则同一时间所开启的 socket
会超过原本系统所许可的值,这时我们就必须把这个值调大一点。除了 FTP 外,也许有其它网络程序也会有这种问题。
然而,这个值必须在系统一开机就设定好,所以如果要修改这项设定,我们必须修改 /boot/loader.conf 才行。例如,我们要将它改成最多同时可以有 16424 个 socket,则必须在 /boot/loader.conf 中加入下列这一行:
kern.ipc.maxsockets=”16424″
9.2.2 net.inet.ip.portrange.*
net.inet.ip.portrange.* 是用来控制 TCP 及 UDP 所使用的 port 范围,这个范围被分成三个部份,低范围、预设范围、及高范围。让我们看一下目前各范围 port 的情形:
# sysctl -a|grep portrange
net.inet.ip.portrange.lowfirst: 1023
net.inet.ip.portrange.lowlast: 600
net.inet.ip.portrange.first: 1024
net.inet.ip.portrange.last: 5000
net.inet.ip.portrange.hifirst: 49152
net.inet.ip.portrange.hilast: 65535
一般的网络程序都会用到预设范围的 port,然而,这个预设范围只从 1024 到
5000,这对于一台忙碌的 FTP server 或 proxy server 可能会有不足的情形。所以我们可以手动调整一下
net.inet.ip.portrange.last 这个值,将它调为 10000、20000、甚至 40000
都是合理的。如果要在一开机就调整这个值,我们可以修改 /etc/sysctl.conf,并增加下列这一行:
net.inet.ip.portrange.last=40000
9.2.3 kern.ipc.shm_use_phys
kern.ipc.shm_use_phys 这个选项预设为 0
(关闭),我们可以将它设为 1 (打开)。如果我们将它设成 1,则所有 System V 共享内存 (share
memory,一种程序间沟通的方式)部份都会被留在实体的内存 (physical memory) 中,而不会被放到硬盘上的 swap
空间。我们知道物理内存的存取速度比硬盘快许多,而当物理内存空间不足时,部份数据会被放到虚拟的内存上,从物理内存和虚拟内存之间移转的动作就叫作
swap。如果时常做 swap 的动作,则需要一直对硬盘作 I/O,速度会很慢。因此,如果我们有大量的程序 (数百个)
需要共同分享一个小的共享内存空间,或者是共享内存空间很大时,我们可以将这个值打开。
这个值可以在开机完成后才设定,因此只要放在 /etc/sysctl.conf 中即可:
kern.ipc.shm_use_phys=1
9.2.4 vfs.vmiodirenable
这个选项预设被设为 1,也就是打开的状态。它被用来决定一个目录中的结构
(目录下的其它文件名称等等)
被快取在内存中的行为。一般的目录结构可能都不大,而这些目录结构会被快取在物理内存中。物理内存中所存放的目录结构快取有限,所以不管我们的物理内存有
多大,预设都只会快取一定大小的目录结构。如果我们将这个选项打开,系统将 buffer cache
放在虚拟内存的快取中,目录结构也就会被存放在虚拟内存中。这样的好处是所有的内存空间都可以被拿来做目录的快取,而缺点是最小用来存放目录结构的快取会
从 512 bytes 变成 4K。
如果您的系统物理内存空间有限,建议您将这个选项关闭。但如果您的系统需要进行大量档案操作,例如 proxy、多人使用的邮件服务器、或是 news server 等,建议将这个选项打开。
9.2.5 vfs.write_behind
这个选项预设为
1,也就是打开的状态。在打开时,在系统需要写入数据在硬盘或其它储存设备上时,它会等到收集了一个 cluster
单位的数据后再一次写入,否则会在一个暂存区空间有写入需求时就立即写到硬盘上。这个选项打开时,对于一个大档案写入速度非常有帮助。但如果您遇到有很多
行程延滞在等待写入动作时,您可能必须关闭这个功能。
9.2.6 vfs.hirunningspace
这个值决定了系统可以将多少数据放在写入储存设备的等候区。通常使用默认值即可,但当我们有多颗硬盘时,我们可以将它调大为 4MB 或 5MB。但必须注意的是,太大的值反而会造成效能低落。
9.2.7 net.inet.tcp.sendspace 及 net.inet.tcp.recvspace
这二个选项分别控制了网络 TCP
联机所使用的传送及接收暂存区的大小。预设的传送暂存区为 32K,而接收暂存区为 64K。如果需要加速 TCP
的传输,可以将这二个值调大一点,但缺点是太大的值会造成系统核心占用太多的内存。如果我们的机器会同时服务数百或数千个网络联机,那么这二个选项最好维
持默认值,否则会造成系统核心内存不足。但如果我们使用的是 gigabite
的网络,将这二个值调大会有明显效能的提升。传送及接收的暂存区大小可以分开调整,例如,假设我们的系统主要做为网页服务器,我们可以将接收的暂存区调小
一点,并将传送的暂存区调大,如此一来,我们就可以避免占去太多的核心内存空间。
还有要注意的是,除了这二个选项可以控制网络传输暂存区大小外,route 这个指令也可以用来依路由路径的不同指定暂存区大小。另外 ipfw 等防火墙软件也可以用来限制每个联机所能使用的网络频宽。
如果我们将传送或接收的暂存区设为大于
65535,除非我们的服务器本身及客户端所使用的操作系统支持 TCP 协议的 windows scaling extension (请参考
RFC 1323 文件)。FreeBSD 预设已支援 rfs1323 (即 sysctl 的 net.inet.tcp.rfc1323 选项)。
9.2.8 net.inet.tcp.always_keepalive
当这个选项打开时,系统会定期送出「keepalives」以检查一个 TCP
联机是否中断。在打开的状况下,所有运作的网络程序都会有定时检查联机是否中断的功能,否则只有当应用程序本身支持时才有此功能。这个选项打开的好处是让
系统更便于管理网络联机,尤其是当我们系统中常有一些莫名其妙就中断联机的使用者时。例如,当一个使用者利用拨接连到系统时,很可能在完成一个完整的
TCP 联机之前,就因为拨接中断而造成联机异常中断。当然,在某些情况下,也有可能会造成系统误判网络联机已中断而结束这个 TCP 联机。
9.2.9 net.inet.tcp.delayed_ack
TCP 协议有一个特性,就是当收到客户端的数据时,会传回一个 ACK
(acknowledgement) 的封包,以确认已收到数据。然而,我们也可以将 ACK 封包和所要回传的资料一起送出。例如,当我使用
telnet 进入系统时,在输入指定时,当我们在键盘上敲打一个字符,系统会送回一个表示已接收到该字符的 ACK
封包,并传回一个含有该字符的封包以在终端机上显示。当 net.inet.tcp.delayed_ack 打开时,系统会将 ACK
和显示该字符的封包一传送,而不需分成二个封包。所以这个选项打开时,可以将封包数量减少一半,以加速网络传输。其它的网络服务,例如,WWW、
SMTP、POP3 等也都具有这种特性。
9.2.10 kern.ipc.somaxconn
这个选项控制了 TCP 联机等候区最多可以等待的联机数量,其默认值为
128,不过这个值对于一台忙碌的服务器而言可能小了点。例如大型的网页服务器、邮件服务器,我们可以将它设为
1024。要注意的是在一些网络服务的程序中,如 Apache 及 sendmail
也有自己的等待数量设定,我们可能也要在那些软件上做一些设定才会让 kern.ipc.somaxconn
发生作用。将这个选项的值调大一点还有一个好处,就是在面对 Denial of service 的攻击时,有较好的防卫能力。
9.2.11 kern.maxfiles
这个选项控制了系统中支持最多开启的档案数量,这个值通常是几千个档,但对于一台忙碌的数据库系统或是会开启许多档案的服务器而言,我们可以将它调高为一、二万。
9.2.12 kern.maxusers
这是用来控制系统内部表格(internal system
tables)大小的参数,它的值大约是您期望系统同一时间会上线使用的使用者数量。我们在核心设定档中有一个 maxusers
的选项,如果您使用的是 FreeBSD 4.5 以上的版本,建议您只要在核心设定档中将它 0
即可,系统会在一开机时自动依您的内存大小调整这个值。如果我们使用的是 FreeBSD 4.5 以后的版本,要调整这个值时,我们可以在
/boot/loader.conf 中加入该选项的设定,例如:
kern.maxusers=256
如果您使用 FreeBSD 4.4 以前的版本,则只能重新编译核心以改变这项设定。
这个值一定要设定大于四,maxusers
的值决定了处理程序所容许的最大值,20+16*maxusers 就是你将得到的所容许处理程序。系统一开机就必须要有 18 个处理程序
(process),即便是简单的执行指令 man 又会产生 9 个 process,所以将这个值设为 64
应该是一个合理的数目。如果你的系统会出现 proc table full 的讯息的话,可以就把它设大一点,例如
128。除非您的系统会需要同时开启很多档案,否则请不要设定超过 256。
9.2.13 kern.ipc.nmbclusters
这个值用来调整系统在开机后所要分配给网络 mbufs 的 cluster
数量,由于每个 cluster 大小为 2K,所以当这个值为 1024 时,也是会用到 2MB
的核心内存空间。我们可以简单的估计出大约需要的大小,例如,假设我们的网页同时约有 1000 个联机,而 TCP 传送及接收的暂存区大小都是
16K,则最糟的情况下,我们会需要 (16K+16K) * 1024,也就是 32MB 的空间,然而所需的 mbufs
大概是这个空间的二倍,也就是 64MB,所以所需的 cluster 数量为 64MB/2K,也就是 32768。对于内存有限的机器,建议值是
1024 到 4096 之间,而当拥有海量存储器空间时,我们可以将它设定为 4096 到 32768 之间。我们可以使用 netstat
这个指令并加上参数 -m 来查看目前所使用的 mbufs 数量。
当我们要修改这个值是,必须在一开机就修改,所以只能在 /boot/loader.conf 中加入修改的设定,例如:
kern.ipc.nmbclusters=16384
这个是我在实际使用服务器中的参数,请在:/etc/sysctl.conf 加入参数
kern.ipc.somaxconn=8192
kern.ipc.maxsockbuf=2097152
kern.maxfilesperproc=32768
kern.maxfiles=65536
#kern.securelevel=0
net.inet.tcp.sendspace=65536
net.inet.tcp.recvspace=32768
net.inet.udp.maxdgram=57344
net.inet.icmp.drop_redirect=1
net.inet.icmp.log_redirect=0
net.inet.ip.redirect=0
net.inet6.ip6.redirect=0
net.inet.icmp.icmplim=100
net.inet.tcp.always_keepalive=0
net.inet.tcp.delayed_ack=0
net.inet.tcp.log_in_vain=0
net.inet.udp.log_in_vain=0
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
net.local.stream.sendspace=65535
net.local.stream.recvspace=32768
net.inet.ip.fastforwarding=1查看 # sysctl -a |grep syncookies 是否打开,开着可以防小规模的DDOS
如:# sysctl net.inet.tcp.syncookies=1
# ee /boot/loader.conf
kern.maxdsiz="536870912"
kern.ipc.maxsockets="4008"
kern.ipc.nmbclusters="32768"
kern.ipc.nmbufs="65535"
kern.ipc.nsfbufs="2496"
net.inet.tcp.tcbhashsize="2048"
作者:小项-怪物猪
分类:FreeBSD,临时文件
#
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the config(5) manual page,
# and/or the handbook section on Kernel Configuration Files:
#
# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files.
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.519.2.12.2.1 2010/12/21 17:09:25 kensmith Exp $
#cpu I486_CPU
cpu I586_CPU
#cpu I686_CPU
ident GENERIC // 内核标识,没什么特殊意义『搜来的,我也不懂』
# To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" # Default places to look for devices.
# Use the following to compile in values accessible to the kernel
# through getenv() (or kenv(1) in userland). The format of the file
# is 'variable=value', see kenv(1)
#
# env "GENERIC.env"
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols // Debug 的什么东西
options SCHED_ULE # ULE scheduler // ULE调度
options PREEMPTION # Enable kernel thread preemption // 启用内核线程抢占
options INET # InterNETworking // IPV4 的网络
options INET6 # IPv6 communications protocols // IPV6 的什么东西
options SCTP # Stream Control Transmission Protocol // 流控制传输协议
options FFS # Berkeley Fast Filesystem // Berkeley 快速文件系统
options SOFTUPDATES # Enable FFS soft updates support // 启用 FFS 软件更新支持
options UFS_ACL # Support for access control lists // 启用访问列表控制
options UFS_DIRHASH # Improve performance on big directories // 改进大目录的支持效果
options UFS_GJOURNAL # Enable gjournal-based UFS journaling // UFS 的日志
options MD_ROOT # MD is a potential root device // 根设备文件
options NFSCLIENT # Network Filesystem Client // 网络文件系统客户端
options NFSSERVER # Network Filesystem Server // 网络文件系统服务端
options NFSLOCKD # Network Lock Manager // 网络锁定管理器
options NFS_ROOT # NFS usable as /, requires NFSCLIENT // NFS 为根目录,需要 NFSCLIENT 支持
options MSDOSFS # MSDOS Filesystem // MSDOS 文件系统
options CD9660 # ISO 9660 Filesystem // 光盘文件系统
options PROCFS # Process filesystem (requires PSEUDOFS) // 进程文件系统『需要 PSEUDOFS 支持』
options PSEUDOFS # Pseudo-filesystem framework // 伪文件系统框架
options GEOM_PART_GPT # GUID Partition Tables. // GUID 分区表
options GEOM_LABEL # Provides labelization // 什么标签吧 {待定}
options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty) // BSD 4.3 的 TTY 支持
options COMPAT_FREEBSD4 # Compatible with FreeBSD4 // 兼容 FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5 // 兼容 FreeBSD5
options COMPAT_FREEBSD6 # Compatible with FreeBSD6 // 兼容 FreeBSD6
options COMPAT_FREEBSD7 # Compatible with FreeBSD7 // 兼容 FreeBSD7
options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI // 延迟(毫秒),然后探测SCSI
options KTRACE # ktrace(1) support // 允许调试跟踪内存单元
options STACK # stack(9) support // stack 支持
options SYSVSHM # SYSV-style shared memory // SYSV 形式的内存共享
options SYSVMSG # SYSV-style message queues // SYSV 形式的消息列队
options SYSVSEM # SYSV-style semaphores // SYSV 信号灯??
options P1003_1B_SEMAPHORES # POSIX-style semaphores // POSIX 信号灯??
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions // POSIX 的 P1003_1B 实施扩展
options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. // 防止 print 输出被怎么滴
options KBD_INSTALL_CDEV # install a CDEV entry in /dev // 安装 CDEV 到 /dev
options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) // hwpcm 的关于内核的东西
options AUDIT # Security event auditing // 安全事件审计
options MAC # TrustedBSD MAC Framework // 可信任的 MAC 框架
options FLOWTABLE # per-cpu routing cache // cpu 的什么缓存吧
#options KDTRACE_HOOKS # Kernel DTrace hooks // 内核的 Dtree 钩子
options INCLUDE_CONFIG_FILE # Include this file in kernel // 包含这个内核文件
options KDB # Kernel debugger related code // 内核调试器相关代码
options KDB_TRACE # Print a stack trace for a panic // print什么的
# To make an SMP kernel, the next two lines are needed
options SMP # Symmetric MultiProcessor Kernel // 多核处理器的内核支持吧
device apic # I/O APIC // APIC 什么的
# CPU frequency control CPU频率控制
device cpufreq // CPU频率控制
# Bus support. 总线控制
device acpi
device eisa
device pci
# Floppy drives 软驱驱动
device fdc // 一般没什么机器还配置软驱了,注释掉好了
# ATA and ATAPI devices ATA和ATAPI设备
device ata
device atadisk # ATA disk drives // ATA 磁盘驱动器
device ataraid # ATA RAID drives // ATA RAID 驱动器
device atapicd # ATAPI CDROM drives // ATAPI CD - ROM 驱动器
device atapifd # ATAPI floppy drives // ATAPI 软盘驱动器
device atapist # ATAPI tape drives // ATAPI 磁带机
options ATA_STATIC_ID # Static device numbering // 静态设备编号
# SCSI Controllers SCSI 控制器
device ahb # EISA AHA1742 family // EISA AHA1742 系列
device ahc # AHA2940 and onboard AIC7xxx devices // AHA2940 和 AIC7xxx 驱动
options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver. // 打印什么东西的
device ahd # AHA39320/29320 and onboard AIC79xx devices // AHA39320/29320 和 AIC79xx 驱动
options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~215k to driver. // 给出容易阅读的寄存器值,用于帮助调试 『搜索来的』
device amd # AMD 53C974 (Tekram DC-390(T))
device hptiop # Highpoint RocketRaid 3xxx series
device isp # Qlogic family
#device ispfw # Firmware for QLogic HBAs- normally a module // 什么的模块
device mpt # LSI-Logic MPT-Fusion
#device ncr # NCR/Symbios Logic
device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
device trm # Tekram DC395U/UW/F DC315U adapters
device adv # Advansys SCSI adapters // Advansys SCSI适配器
device adw # Advansys wide SCSI adapters // 加了一个 wide 就有点不懂了,应该是SCSI适配器相关的 ???
device aha # Adaptec 154x SCSI adapters // 154x 的 SCSI 适配器 ???
device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. // 15[012]x 的 SCSI 适配器 ???
device bt # Buslogic/Mylex MultiMaster SCSI adapters // 多重 SCSI 适配器 ???
device ncv # NCR 53C500 // 应该是某种特定设备的驱动支持
device nsp # Workbit Ninja SCSI-3 // 同上
device stg # TMC 18C30/18C50 // 同上
# SCSI peripherals SCSI 外设
device scbus # SCSI bus (required for SCSI) // SCSI 总线 『必须』
device ch # SCSI media changers // SCSI 介质什么的
device da # Direct Access (disks) // 主通道 『磁盘』
device sa # Sequential Access (tape etc) // 次要通道 『磁带等』
device cd # CD
device pass # Passthrough device (direct SCSI access) // 磁盘类的
device ses # SCSI Environmental Services (and SAF-TE) // 磁盘类的
# RAID controllers interfaced to the SCSI subsystem RAID控制器接口的SCSI子系统
device amr # AMI MegaRAID
device arcmsr # Areca SATA II RAID
device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
device ciss # Compaq Smart RAID 5*
device dpt # DPT Smartcache III, IV - See NOTES for options
device hptmv # Highpoint RocketRAID 182x
device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx
device iir # Intel Integrated RAID
device ips # IBM (Adaptec) ServeRAID
device mly # Mylex AcceleRAID/eXtremeRAID
device twa # 3ware 9000 series PATA/SATA RAID
# RAID controllers RAID 控制器
device aac # Adaptec FSA RAID
device aacp # SCSI passthrough for aac (requires CAM)
device ida # Compaq Smart RAID
device mfi # LSI MegaRAID SAS
device mlx # Mylex DAC960 family
device pst # Promise Supertrak SX6000
device twe # 3ware ATA RAID
# atkbdc0 controls both the keyboard and the PS/2 mouse 键盘鼠标什么的
device atkbdc # AT keyboard controller // 键盘控制器
device atkbd # AT keyboard // 键盘
device psm # PS/2 mouse // 鼠标
device kbdmux # keyboard multiplexer // 多键盘支持
device vga # VGA video card driver // 显卡支持
device splash # Splash screen and screen saver support // 背景、屏保支持
# syscons is the default console driver, resembling an SCO console
device sc
device agp # support several AGP chipsets // 多种AGP芯片组支持
# Power management support (see NOTES for more options) 电源管理支持
#device apm
# Add suspend/resume support for the i8254. // i8254 的支持
device pmtimer
# PCCARD (PCMCIA) support PCCARD(PCMCIA)支持
# PCMCIA and cardbus bridge support PCMCIA和总线卡的支持
device cbb # cardbus (yenta) bridge // 总线
device pccard # PC Card (16-bit) bus // 16位
device cardbus # CardBus (32-bit) bus // 32位
# Serial (COM) ports 串口设备
device uart # Generic UART driver // 通用驱动
# Parallel port 并口设备
device ppc
device ppbus # Parallel port bus (required) // 并口总线 『必须』
device lpt # Printer // 并口打印驱动
device plip # TCP/IP over parallel // TCP/IP 相关的
device ppi # Parallel port interface device // 并口设备
#device vpo # Requires scbus and da // 不懂的
# If you've got a "dumb" serial or parallel PCI card that is
# supported by the puc(4) glue driver, uncomment the following
# line to enable it (connects to sio, uart and/or ppc drivers):
#device puc // 还是不懂 默认就行了吧
# PCI Ethernet NICs. PCI以太网网卡
device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel PRO/1000 Gigabit Ethernet Family
device igb # Intel PRO/1000 PCIE Server Gigabit Family
device ixgb # Intel PRO/10GbE Ethernet Card
device le # AMD Am7900 LANCE and Am79C9xx PCnet
device ti # Alteon Networks Tigon I/II gigabit Ethernet
device txp # 3Com 3cR990 (``Typhoon'')
device vx # 3Com 3c590, 3c595 (``Vortex'')
# PCI Ethernet NICs that use the common MII bus controller code. PCI以太网网卡,使用共同的MII总线控制器
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device miibus # MII bus support
device ae # Attansic/Atheros L2 FastEthernet
device age # Attansic/Atheros L1 Gigabit Ethernet
device alc # Atheros AR8131/AR8132 Ethernet
device ale # Atheros AR8121/AR8113/AR8114 Ethernet
device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
device bfe # Broadcom BCM440x 10/100 Ethernet
device bge # Broadcom BCM570xx Gigabit Ethernet
device dc # DEC/Intel 21143 and various workalikes
device et # Agere ET1310 10/100/Gigabit Ethernet
device fxp # Intel EtherExpress PRO/100B (82557, 82558)
device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet
device lge # Level 1 LXT1001 gigabit Ethernet
device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
device nfe # nVidia nForce MCP on-board Ethernet
device nge # NatSemi DP83820 gigabit Ethernet
#device nve # nVidia nForce MCP on-board Ethernet Networking
device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le')
device re # RealTek 8139C+/8169/8169S/8110S
device rl # RealTek 8129/8139
device sf # Adaptec AIC-6915 (``Starfire'')
device sge # Silicon Integrated Systems SiS190/191
device sis # Silicon Integrated Systems SiS 900/SiS 7016
device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
device ste # Sundance ST201 (D-Link DFE-550TX)
device stge # Sundance/Tamarack TC9021 gigabit Ethernet
device tl # Texas Instruments ThunderLAN
device tx # SMC EtherPower II (83c170 ``EPIC'')
device vge # VIA VT612x gigabit Ethernet
device vr # VIA Rhine, Rhine II
device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# ISA Ethernet NICs. pccard NICs included. ISA以太网网卡,PCCARD网卡包含在其中
device cs # Crystal Semiconductor CS89x0 NIC
# 'device ed' requires 'device miibus' 也是网卡类的不过好像很少见
device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
device ex # Intel EtherExpress Pro/10 and Pro/10+
device ep # Etherlink III based cards
device fe # Fujitsu MB8696x based cards
device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc.
device sn # SMC's 9000 series of Ethernet chips
device xe # Xircom pccard Ethernet
# Wireless NIC cards 无线网卡支持
device wlan # 802.11 support
options IEEE80211_DEBUG # enable debug msgs
options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
options IEEE80211_SUPPORT_MESH # enable 802.11s draft support
device wlan_wep # 802.11 WEP support
device wlan_ccmp # 802.11 CCMP support
device wlan_tkip # 802.11 TKIP support
device wlan_amrr # AMRR transmit rate control algorithm
device an # Aironet 4500/4800 802.11 wireless NICs.
device ath # Atheros pci/cardbus NIC's
device ath_hal # pci/cardbus chip support
options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
device ath_rate_sample # SampleRate tx rate control for ath
device ral # Ralink Technology RT2500 wireless NICs.
device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
#device wl # Older non 802.11 Wavelan wireless NIC.
# Pseudo devices. 伪设备支持
device loop # Network loopback // 网络回环
device random # Entropy device // 不知道什么设备
device ether # Ethernet support // 以太网支持
device vlan # 802.1Q VLAN support // 802.1q VLAN 支持
device tun # Packet tunnel. // PPPoE 好像会用这个设备
device pty # BSD-style compatibility pseudo ttys // BSD风格的伪终端设备
device md # Memory "disks" // 内存盘设备
device gif # IPv6 and IPv4 tunneling // IP4 OR 6 设备的什么
device faith # IPv6-to-IPv4 relaying (translation) // IPV6 转换 IPV4 的什么东西
device firmware # firmware assist module //
# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device bpf # Berkeley packet filter // 数据包过滤器?? 还是不懂 默认好了
# USB support USB支持
options USB_DEBUG # enable debug msgs
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices
device uhid # "Human Interface Devices"
device ukbd # Keyboard
device ulpt # Printer
device umass # Disks/Mass storage - Requires scbus and da
device ums # Mouse
device urio # Diamond Rio 500 MP3 player
# USB Serial devices USB串行设备
device u3g # USB-based 3G modems (Option, Huawei, Sierra)
device uark # Technologies ARK3116 based serial adapters
device ubsa # Belkin F5U103 and compatible serial adapters
device uftdi # For FTDI usb serial adapters
device uipaq # Some WinCE based devices
device uplcom # Prolific PL-2303 serial adapters
device uslcom # SI Labs CP2101/CP2102 serial adapters
device uvisor # Visor and Palm devices
device uvscom # USB serial support for DDI pocket's PHS
# USB Ethernet, requires miibus USB以太网,需要miibus
device aue # ADMtek USB Ethernet
device axe # ASIX Electronics USB Ethernet
device cdce # Generic USB over Ethernet
device cue # CATC USB Ethernet
device kue # Kawasaki LSI USB Ethernet
device rue # RealTek RTL8150 USB Ethernet
device udav # Davicom DM9601E USB
# USB Wireless USB无线网卡
device rum # Ralink Technology RT2501USB wireless NICs
device uath # Atheros AR5523 wireless NICs
device ural # Ralink Technology RT2500USB wireless NICs
device zyd # ZyDAS zb1211/zb1211b wireless NICs
# FireWire support 防火墙支持
device firewire # FireWire bus code
#device sbp # SCSI over FireWire (Requires scbus and da)
device fwe # Ethernet over FireWire (non-standard!)
device fwip # IP over FireWire (RFC 2734,3146)
device dcons # Dumb console driver
device dcons_crom # Configuration ROM for dcons
作者:小项-怪物猪
分类:Ubuntu,FreeBSD
shell命令行中:
vim file_name -c "e ++enc=cp936"
作者:小项-怪物猪
分类:Ubuntu
chroot $LFS /usr/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/bin/bash --login