Category Archives: FreeBSD

forget to update the bootloader when updating ZFS filesystems.

Today, when I reboot my freebsd server. Server can’t boot. The error message is

ZFS: unsupported ZFS version 5000 (should be 28)
can't find /boot/zfsloader

default: ssd::/boot/kernel/kernel

boot:
can't find /boot/zfsloader

The problem is caused by that after I update zfs version, I should update bootloader at the same time.

Fix it:

Download the latest Freebsd 9.1 current image. Note:if you are using the stable image, the bootloader in the image is still old and can’t support zfs 29.

Then use the image to boot the server, then enter ‘shell’,run below command for all boot disks:

#gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 mfid0

then reboot the server

Freebsd 7.0 install notes

cd /etc/ssh
vi sshd_config
修改允许root登录
/etc/rc.d/sshd restart
 
———freebsd可以用ports或者portsnap更新—–
 安装ports
 sysinstall—>configure—–>distributions—–>ports—–>选择Ftp或其它的网络连接即可
——–使用portsnap,从freebsd 6.0开始———–
portsnap fetch
portsnap extract
portsnap update
 
安装源码
如果您的系统中 没有 /usr/src/sys 这样一个目录, 则说明没有安装内核源代码。安装它最简单的方法是通过以 root 身份运行 sysinstall, 选择 Configure, 然后是 Distributions、 src,选中其中的 base 和 sys。
———-编译内核
http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/handbook/kernelconfig-building.html
 
——更新源码部分
安装cvsup,没有图形界面,所以
cd /usr/ports/net/cvsup-without-gui/
make
make install
 
#cd /usr/share/examples/cvsup/
#cp ports-supfile /root/
#cp stable-supfile /root/
#cp standard-supfile /root/
#cd /root/
rehash 不然会出现command not found
修改 ports-supfile,
 *default host=cvsup.FreeBSD.org
 cvsup -g -L 2 ports-supfile
修改stable-cupfile
同样是
  *default host=cvsup.FreeBSD.org
 
 
 
————-编译内核
 cd /usr/src/sys/i386/conf
 mkdir /root/kernels
cp GENERIC /root/kernels/SYXIN
ln -s /root/kernels/SYXIN
vi SYXIN
修改配置
cd /usr/src/sys/i386/conf
# /usr/sbin/config SYXIN
# cd ../compile/SYXIN
# make depend
# make
# make install
 
 
 
 
 
——–安装lighttpd———-
# cd /usr/ports/www/lighttpd
# make
# make config
# make install
# make clean
 
—-安装mysql————
# cd /usr/ports/databases/mysql50-server/
#make WITH_CHARSET=utf8  WITH_XCHARSET=gbk WITH_XCHARSET=gb2312 WITH_PROC_SCOPE_PTH=yes BULD_OPTIMIZED=yes BULID_STATIC=yes SKIP_DNS_CHECK=yes WITHOUT_INNODB=YES
#make install
# cd /usr/ports/databases/mysql50-scripts/
#make
#make install
# cd /usr/ports/lang/php5
# make
# make install
# make clean
#cd /usr/ports/lang/php5-extensions
#make config
#make
#make install
#make search name=ImageMagick
#>cd /usr/ports/graphics/ImageMagick
#>make install
 
 
 
 

lighttpd+fastcgi under freebsd

## for PHP don’t forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server             = ( “.php” =>
                               ( “localhost” =>
                                 (
                                   “socket” => “/tmp/php-fastcgi.socket”,
                                   “bin-path” => “/usr/local/bin/php-cgi”
                                 )
                               )
                            )