| FreeBSD文档 | ||
|---|---|---|
| Prev | Chapter 6 FreeBSD常见问题集合 | |
6.2.1. 系统启动反复出现timeout-resetting
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
将光驱的master修改成slave来用
不追加分区, 可以通过增加交换文件的方式实现
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
建议重装系统,然后将数据迁移到新硬盘, 如果真的要直接将系统迁移到新硬盘一定要使用dump和restore,不要使用tar,cpio等, 它们对根目录的操作可能会出现问题, 步骤如下:
使用newfs新建一个分区.
mount上该分区.
cd到装载点.
使用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 -
使用内置声卡需要添加如下内核配置
options PNPBIOS
多声道配置使用sysctl进行设置, 如下:
# sysctl hw.snd.pcm0.vchans=4
# sysctl hw.snd.maxautovchans=4
注意事项
备份系统, 备份一下总不至于吃亏
订阅对应邮件列表, 希望你的英文不至于太差, 在对应邮件列表上贴上你问题的描述, 描述清楚出现的问题及受影响的系统
STABLE: freebsd-stable@FreeBSD.org
CURRENT: freebsd-current@FreeBSD.org
升级步骤
使用cvsup将src同步到所要升级到的版本
读一下/usr/src/UPDATING, 上面由一些你可能需要注意的事项, 一定要读一下, 但并不代表这一定比从邮件列表上得到的信息有用, 所以推荐订阅邮件列表
检查/etc/make.conf, 查看/etc/make.conf和 /etc/default/make.conf的不同之处, /etc/default/make.conf中包含一些缺省定义, 不过大部分都被注释掉了, 可以考虑把它们加入到/etc/make.conf中, 不过要记得/etc/make.conf所有的make命令都起作用
更新/etc下的文件, /etc下存放配置和启动脚本, 有些文件在不同的版本中是不同的, 所以需要进行更新, 从FreeBSD 开始可以在编译前使用命令 mergemaster 加上 -p 选项. 它将检查为了正常运行buildworld和installworld而需要更新的文件, 示例如下:
# cd /usr/src/usr.sbin/mergemaster
# ./mergemaster.sh -p
进入单用户模式, 避免多用户系统带来的文件升级不成功问题, 还有一种方法就是在多用户模式下编译, 单用户下升级安装, 命令如下
# shutdown now
重启后使用boot -s 进入单用户模式
# fsck -p
# mount -u /
# mount -a -t ufs
# swapon -a
加入升级前系统如果使用本地时间而没有使用GMT, 必须打入命令
# adjkerntz -i
来调整时区等设置, 保证系统的正常安装
移除/usr/obj
# cd /usr/obj
# chflags -R noschg *
# rm -rf *
编译系统
保存编译输出, 注意不要存在/tmp目录下, /tmp下的文件可能在重启后被清除
# script /var/tmp/mw.out
Script started, output file is /var/tmp/mw.out
# make TARGET
... compile, compile, compile ...
# exit
Script done, ...
编译系统
# cd /usr/src
# make -j4 -DNOPROFILE buildworld #或者在/etc/make.conf加上NOPROFILE=true
FreeBSD 2.2.5后make world分成 make buildworld和make installworld, 注意这里只作make buildworld
耗时: PIII500/128M RAM大约需要2个钟头左右
编译安装新内核, 注意这里不是make world
# cd /usr/src
# make buildkernel
# make installkernel
编译使用GENERIC配置的内核, 推荐编译一个, 以免以后编译内核后无法使用新内核启动 没有make installworld前定制编译新内核使用下面的命令
# /usr/obj/usr/src/usr.sbin/config/config KERNELNAME
以新内核重启到单用户模式
升级系统, 注意要使用和make buildworld使用的-D选项, 并且绝对不能使用-j选项
# cd /usr/src
# make installworld
假如编译时:
# make -DNOPROFILE=true buildworld
安装时就应该:
# make -DNOPROFILE=true installworld
升级那些没有被make world升级的文件, 如/etc下的文件, 可以使用mergemaster或者手工升级, 这一点请参见mergemaster的手册, 在升级前建议备份/etc目录.
更新/dev
通常使用mergemaster, 就会重建/dev, 或使用命令 sh MAKEDEV 建立
更新/stand
# cd /usr/src/release/sysinstall
# make all install
再次重启
# fastboot
结束升级, 加入有些程序无法运行的话可以重新编译安装, 例如
# cd /usr/src/usr.bin/file
# make all install
java与xim有些冲突, 可以设置java的环境变量到C, 避免调用输入法
或者这样就可以了, XIM与Motif有些冲突
# ln -sf aj /etc/malloc.conf