Tuesday Sep 25, 2007

你可以参考docs.sun.com上的文档,或者google一下,但是结果会让你感觉非常复杂。它会让你了解和准备各种OPTION和PROPERTY。

其实你可以完全不管它,只要十几分钟,你就可以搭建起SOLARIS-X86的网络安装服务器。

总的说来我们需要配置三种服务器 :NFS,BOOTP,DHCP服务器,前两种服务器可能比较直接,容易理解。

但DHCP服务器的配置可以很复杂,但你不用管文档如何说,只需按照下面的图示完成基本设置,外加两个额外的OPTIONS设置即可。

 1. /usr/sadmin/admin/bin/dhcpmgr, select dhcp server

2 ...

3. dhcp configuration

 
4.


5.

6.

7.


8. Add 3 properties to reednv: BootFile, BootSvrA, Router (maybe it's not needed)

 

[Read More]

Monday Sep 24, 2007

在SUN已经快两年了,早就有人跟我说,如果你想成为资深(Senior)工程师,就得抛弃Windows那一套东西,以前没当回事,随着时间的推移,越来越感觉使用Windows那一套开发工具,很不方便。

看着SUN大部分资深工程师都是直接使用EMACS/VIM,如是就试了试XEMACS。发觉果然不错,你可以完全定制它,使他完全符合你的习惯,另外他在各种平台下的表现都是一致的。只可惜自己醒悟的太晚。

下面的一段脚本是我试验了半天得出来的结果:主要目的是在文件存盘时,自动尽可能将空格转换成为TAB键,然后自动删除行尾多余的空格。如果是EMACS,你可以将其放到~/.emacs.el,如果是XEMACS,你可以将其放到~/.xemacs/init.el

...

;; Add save buffer hook
(defun reed_update_file()
        "Convert spaces to tabs, and remove useless spaces"
        (interactive)

        ;; Remove useless spaces
        (edit-picture)
        (picture-mode-exit)

        ;; Convert spaces to tabs
        (tabify (point-min) (point-max))

        ;; Save buffer
        (continue-save-buffer)
)

;; Add-hook to automate the task when we save files
(add-hook 'write-file-hooks 'reed_update_file)

...

Wednesday Aug 15, 2007

COMSTAR是一个OpenSolaris下的一个开源项目,其作用和LINUX下的SCST类似,利用它你可以将一台主机变成一个存储设备。

这对于好多国内的高校实验室和研究所有很重要的意义,他们可以在此基础上添加新特性实现磁盘阵列或者加密存储设备。


Thursday Apr 19, 2007

Fc Target Machine Hardware Requirement 
1. FC-HBA: QLA2200 (1G) or QLA2300(2G); 
 
Fc Target Machine Hardware Requirement 
1. Redhat Linux 9 
2. kernel 2.6.10 (http://www.kernel.org) 
3. scst-0.9.2 (http://scst.sourceforge.net) 
4. qla2x00-0.9.3.2 (http://scst.sourceforge.net) 
 
Compilation: 
1. Update your kernel to 2.6.10, with kernel source in 
/usr/src/linux-2.6.10 
2. ln -s /usr/src/linux-2.6.10 /lib/modules/2.6.10/build 
3. cd your work dir in /root with all the tars in it 
4. tar xvzf scst-0.9.2.tar.gz 
5. cd scst-0.9.2 
6. modify init_scst function in scst.c: cpu_online_num can't be 
resolved for NON_SMP machine; 
7. make install 
8. cd .. 
9. tar xvzf qla2x00-target-0.9.3.2 
10. cd qla* 
11. Modify Makefile, point to the right scst-0.9.2 directory 
12. make install 
 
Test: 
dd if=/dev/zero of=/vdisks/scsi_disk_file_0 count=1 
1. modprobe qla2300tgt (qla2200tgt) 
2. modprobe scst_disk_fileio dir=/vdisks count=1 
3. connect FC cables between Solaris initator and Linux Target machine. 
4. rescsn and you will find the new fc disk, and do dd or tar to test. 

(mainly from  manpage of lofiadm)
Example 1: Mounting an Existing CD-ROM Image 

You should ensure that Solaris understands the image before creating the CD. lofi allows you to mount the image and see if it works. 
This example mounts an existing CD-ROM image (sparc.iso), of the Red Hat 6.0 CD which was downloaded from the Internet. It was created with the mkisofs utility from the Internet. 
 
Use lofiadm to attach a block device to it: 
# lofiadm -a /home/mike_s/RH6.0/sparc.iso 
/dev/lofi/1 
 
lofiadm picks the device and prints the device name to the standard output. You can run lofiadm again by issuing the following command:
# lofiadm 
Block Device File 
/dev/lofi/1 /home/mike_s/RH6.0/sparc.iso 
 
Or, you can give it one name and ask for the other, by issuing the following command: 
# lofiadm /dev/lofi/1 
/home/mike_s/RH6.0/sparc.iso 
 
Use the mount command to mount the image: 
# mount -F hsfs -o ro /dev/lofi/1 /mnt 
 
Check to ensure that Solaris understands the image: 
# df -k /mnt 
Filesystem kbytes used avail capacity Mounted on 
/dev/lofi/1 512418 512418 0 100% /mnt 
# ls /mnt 

Solaris can mount the CD-ROM image, and understand the filenames. The image was created properly, and you can now create the CD-ROM with confidence.
As a final step, unmount and detach the images:
# umount /mnt 
# lofiadm -d /dev/lofi/1 
# lofiadm 
Block Device File 
...

Example 3: Making a UFS Filesystem on a File 
 
Making a UFS filesystm on a file can be useful, particularly if a test suite requires a scratch filesystem. It can be painful (or annoying) to have to re-partition a disk just for the test suite, but you don't have to. You can newfs a file with lofi 

Create the file: 
# mkfile 35m /export/home/test 

Attach it to a block device. You also get the character device that newfs requires, so newfs that:
# lofiadm -a /export/home/test 
/dev/lofi/1 
# newfs /dev/rlofi/1 
newfs: construct a new file system /dev/rlofi/1: (y/n)? y 
/dev/rlofi/1: 71638 sectors in 119 cylinders of 1 tracks, 602 sectors 
35.0MB in 8 cyl groups (16 c/g, 4.70MB/g, 2240 i/g) 
super-block backups (for fsck -F ufs -o b=#) at: 
32, 9664, 19296, 28928, 38560, 48192, 57824, 67456, 

Note that ufs might not be able to use the entire file. Mount and use the filesystem:  
# mount /dev/lofi/1 /mnt 
# df -k /mnt 
Filesystem kbytes used avail capacity Mounted on 
/dev/lofi/1 33455 9 30101 1% /mnt 
# ls /mnt 
./ ../ lost+found/ 
# umount /mnt 
# lofiadm -d /dev/lofi/1

Wednesday Apr 18, 2007

1. # cdrecord -scanbus  (to get the CD/DVD writer device name)
2.
# cdrecord -dev=0,0,0 /net/kungfu/export/home1/simon/supplement.iso (to burn)
3.
# mkisofs -J -r -L -V My_Test_Image -o /var/tmp/myimage.iso /some/directory (to create an image from the directory)

More information (mainly from manpage of cdrecord):
If the overall speed of the system is sufficient and the structure of the filesystem is not too complex, cdrecord will run without creating an image of the ISO 9660 filesystem. Simply run the pipeline:

# mkisofs -R /master/tree | cdrecord -v fs=6m speed=2 dev=2,0 -

To create an image for a ISO 9660 filesystem with Rock Ridge extensions:
# mkisofs -R -o cdimage.raw /home/joerg/master/tree

To check the resulting file before writing to CD on Solaris:
# mount -r -F fbk -o type=hsfs /dev/fbk0:cdimage.raw /mnt

Thursday Jul 20, 2006

吴伟,罗怡,陈宁,程炜烨,聂宏杰,李湘娜,李旭,裴亚丽,贺梨

陈康林,宁剑,万继光,老婆,我,谭志虎,魏沁淇

[Read More]

This blog copyright 2009 by reed