LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3048|回复: 0

FreeBSD常见问题集---摘引

[复制链接]
发表于 2003-7-7 07:17:29 | 显示全部楼层 |阅读模式
安装
Q: checksum.md5是干什么用的?
A: md5的校验码, 一般用于检测下载文件是否受到损坏, 可以使用md5 filename来检验

Q: 安装ports时想查找相关ports
A: make search key=

Q: 查看系统版本信息
A: 使用uname命令

Q: 系统启动反复出现

acd0:MODE_SENSE_BIG command timeout-resetting
ata1:resetting devices...done
acd0:MODE_SENSE_BIG command timeout-resetting
ata1:resetting devices...done
acd0:MODE_SENSE_BIG command timeout-resetting
ata1:resetting devices...done
..........
Probing divice,please wait(this can take a few minutes
A: 试试将光驱的master修改成slave

Q: 从硬盘安装FreeBSD, 文件拷贝到c:\freebsd\下, 系统报告说找不到文件 Q:出错提示如下:
Error mounting /dev/ad0s1 on /dist: Operation not supported by device
A: 首先,除了你常用的kern.flp和mfsroot.flp外,将driver的那张也做好, 在安装前面的一部分,有一个地方有选择问你是否要加载驱动,选择安装,然后将MSDOS的驱动加载上去, 接下去就OK了

Q: 发现FreeBSD的交换空间被耗尽
A: 不追加分区, 可以通过增加交换文件的方式实现

Example 6-1. Creating a Swapfile on FreeBSD 4.X
1.   Be certain that your kernel configuration includes the vnode
driver. It is not in recent versions of GENERIC.
pseudo-device   vn 1   #Vnode driver (turns a file into a device)
2.   create a vn-device:
# cd /dev
# sh MAKEDEV vn0
3.   create a swapfile (/usr/swap0):
# dd if=/dev/zero of=/usr/swap0 bs=1024k count=64
4.   set proper permissions on (/usr/swap0):
# chmod 0600 /usr/swap0
5.   enable the swap file in /etc/rc.conf:
swapfile="/usr/swap0"   # Set to name of swapfile if aux swapfile desired.
6.   Reboot the machine or to enable the swap file immediately, type:
# vnconfig -e /dev/vn0b /usr/swap0 swap

Example 6-2. Creating a Swapfile on FreeBSD 5.X
1.   Be certain that your kernel configuration includes the memory
disk driver ( md(4)). It is default in GENERIC kernel.
device   md   # Memory "disks"
2.   create a swapfile (/usr/swap0):
# dd if=/dev/zero of=/usr/swap0 bs=1024k count=64
3.   set proper permissions on (/usr/swap0):
# chmod 0600 /usr/swap0
4.   enable the swap file in /etc/rc.conf:
swapfile="/usr/swap0"   # Set to name of swapfile if aux swapfile desired.
5.   Reboot the machine or to enable the swap file immediately, type:
# mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0

Q: 如何将系统迁移到新的大硬盘
A: 建议重装系统,然后将数据迁移到新硬盘, 如果真的要直接将系统迁移到新硬盘一定要使用dump和restore,不要使用tar,cpio等, 它们对根目录的操作可能会出现问题, 步骤如下

1.使用newfs新建一个分区.

2.mount上该分区.

3.cd到装载点.

4.使用dump备份旧的分区, 通过管道输出到新分区

例如, 假设要将根文件系统移动到/dev/ad1s1a, 使用/mnt作为临时装载点, 命令如下
    # newfs /dev/ad1s1a
    # mount /dev/ad1s1a /mnt
    # cd /mnt
    # dump 0af - / | restore xf -

要在新硬盘上重新安排分区稍微有点麻烦, 例如要把/var文件系统放在新硬盘分区的
根文件系统下, 首先按照上面的步骤移动根文件系统, 然后在移动/var文件系统,
命令如下
    # newfs /dev/ad1s1a
    # mount /dev/ad1s1a /mnt
    # cd /mnt
    # dump 0af - / | restore xf -
    # cd var
    # dump 0af - /var | restore xf -

Q: 如何升级ports安装的软件
A: 使用cvsup, 步骤如下

1.安装cvsup 以root用户到/usr/ports/net/cvsup下make all install clean

2.新建cvsup升级配置文件 可以到/usr/share/example/cvsup/ports-supfile拷贝一份,修改 default host=cvsup.FreeBSDchina.org 然后使用 cvsup -gL 2 ports-supfile 升级ports

3.安装portupgrade 到/usr/ports/sysutils/portupgrade目录下 make all install clean

4.最后执行rehash 使用portupgrade -a更新所有ports安装的软件

Q: 为什么我的系统装有 128 MB 的 RAM,而 FreeBSD 只用了其中的 64MB
A: 因为 FreeBSD 是使用呼叫 BIOS 来取得记忆体大小的方法,因此它只能侦测到 16 bits 位元长

度的 KByte 大小(65535 KBytes = 64MB)(或者更少..。有些 BIOS 将最高记忆体大小限为只有 16MB)如果您拥有 64MB 以上的 RAM,FreeBSD 会尝试去侦测出它,但是有可能会失败 要解决这个问题,您需要使用下面所提的 kernel 设定选项。虽然有方法可以从 BIOS 中取得记忆体 的完整资讯,但是目前我们在开机区中并没有多余的空间来做这件事。当某天开机区空间不足的情形 获得解决时,我们将会使用 BIOS 的延伸功能来取得记忆体的完整资讯...但现在我们将它放在 kernel 设定选项中.

                                                                     
options "MAXMEM=n"

Q: 如何使用主板内置声卡, 如何使多个程序同时播放声音
A: 使用内置声卡需要添加内核配置

    options PNPBIOS
可以使用以下命令来配置多声音通道

    # sysctl hw.snd.pcm0.vchans=4
    # sysctl hw.snd.maxautovchans=4
配置
Q: FreeBSD sshd/telnet禁止root登录的问题
A: ssh修改/etc/ssh/sshd_config更改PermitRootLogin no为PermitRootLogin yes telnet修改/etc/login.access加入+:wheel:ALL

Q: root用户收到大量系统邮件, 想让信件发送到其他地址
A: 修改/etc/mail/aliases root: me@someserver 或在/root/.forward加入me@someserver

Q: 制作FreeBSD启动画面 A: 确定你的kernel配置中有

pseudo-devicesplash
optionsVESA# support for zhcon
然后在/etc/loader.conf中加入

splash_bmp_load="YES"# For Windows .bmp files or
splash_pcx_load="YES"# For ZSoft .PCX files (one or the other)
vesa_load="YES"# If the image is greater than 320x200
bitmap_load="YES"
bitmap_name="/boot/splash.bmp"# Name of the splash image file
#bitmap_name="/boot/splash.pcx"
等到重启后, 看到

Loading /boot/defaults/loader.conf
/kernel text=0x161db8 data=0x218ac+0x223fc syms=[0x4+0x23040+0x4+0x243e4]
/modules/splash_bmp.ko text=0x10f9 data=0xc8+0x66c syms=[0x4+0x420+0x4+0x230]
/modules/vesa.ko text=0x2330 data=0xea0+ox23c syms=[0x4+0x7a0+0x4+0x585]
...
Hit [Enter] to boot immediately, or any other key for command prompt.
按下回车就可以看到画面了. 假如出现以下错误

module_register_init: MOD_LOAD (splash_bmp, c02ee62c, 0> error 19
一般来说是kernel中没有配置options VESA, 或者是图象大小不符合, 请使用8位的bmp或pcx, 图象大小只能是vidcontrol所支持的分辨率的大小.

Q: 如何使普通用户具有mount的权限?
A: 首先设置系统变量vfs.usermount, 命令如下

# cd /etc
# cat >> sysctl.conf << EOF
>vfs.usermount=1
>EOF
# reboot
接下来, 设置设备权限, 使普通用户可读, 以光驱软驱为例

# chmod o+rx /dev/cdrom
# chmod o+rwx /dev/fd0
最后设置装载点

$ mkdir /usr/home/username/floppy
$ mkdir /usr/home/jason/cdrom
$ chown username /usr/home/username/floppy
$ chown username /usr/home/username/cdrom
$ chmod 775 /usr/home/username/floppy
$ chmod 755 /usr/home/username/cdrom
这样普通用户便可以进行mount操作了

Q: 如何在XFree86下使用滚轮鼠标?
A: 编辑/etc/X11/XF86Config, 找到鼠标配置的段, 在里面加上Option "ZAxisMapping" "4 5", 重启X, 应该就可以了
开发
更新日期: 2003年06月05日
返回(Index)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表