X4170 with STK RAID controller 更换root disk

X4170,带STK RAID controller,两块硬盘,一块根盘一块数据,都是做了simple volume,根盘发现坏块,还好只是/export/home,保修,Oracle寄来一块硬盘,更换root disk。以下是几点提要:

1. 下载Sun StorageTek* RAID Manager for x86 Solaris* 10
URL:

https://downloadcenter.intel.com/confirm.aspx?httpDown=http://downloadmirror.intel.com/17959/eng/solaris_x86_raidman-arcconf_v6.10.0-17557.zip&lang=eng&Dwnldid=17959&ProductID=2875&ProductFamily=Server+Products&ProductLine=RAID+Controllers+for+OEMs&ProductProduct=Sun+StorageTek*+SAS+RAID+HBA%2c+Internal
安装在/opt/StorMan下,参考文档:http://docs.oracle.com/cd/E23383_01/html/820-2145-12/chapter2.html#0_pgfId-1001484

2. 安装后获取information

arcconf getversion
arcconf getconfig $CNUM
arcconf getstatus $CNUM
arcconf getlogs $CNUM uart
arcconf getlogs $CNUM device
arcconf getlogs $CNUM dead
arcconf getlogs $CNUM event
arcconf getlogs $CNUM event tabular
其中$CNUM是控制器号,

3. 添加new disk,热插拔,然后在arcconf getconfig里可以看到硬盘

Device #7
Device is a Hard drive
State : Ready
Supported : Yes
Transfer Speed : SAS 3.0 Gb/s
Reported Channel,Device : 0,7 —————————-> so you need to note this information
Reported Location : Enclosure 1, Slot 7
Reported ESD : 2,1
Vendor : SEAGATE
Model : ST914603SSUN146G
Firmware : 0B70
Serial number : 00112083G17Q 6SD3G17Q
World-wide name : 5000C5003AAD501C
Size : 140009 MB
Write Cache : Unknown
FRU : None
S.M.A.R.T. : No

4. 使用new disk创建新volume

# arcconf create 1 logicaldrive max volume 0 7 noprompt
or
# arcconf CREATE 1 LOGICALDRIVE NAME Data-2 max Simple_volume 0,2

“1″ means controller #; “0 7″ means “Reported Channel,Device” in the “arcconf getconfig 1″,
By default, once new disk inserted ,you just need to run one command “arcconf create” to generate one new disk

# devfsadm -vCc disk //this commands is not mandatory

5. 分区,创建文件系统,然后把现有系统dump到新硬盘上,比如/var

mount /dev/dsk/c0t2d0s3 /a
cd /a
ufsdump 0f – /dev/rdsk/c0t0d0s3 | ufsrestore rvf –
所有分区都dump完成之后安装grub:

# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t0d0s0

注意此时不要编辑/etc/vfstab和/boot/solaris/bootenv.rc,这点是因为这个raid控制器会把启动硬盘自动设置成卷0,也就是说c0t2d0在设置为启动卷之后,就成了c0t0d0,这种反人类思维让我烦恼了好久
也记录一下,如果需要编辑bootenv.rc时,setprob bootpath的内容应该是format看到的硬盘信息,例如:/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0:a,a表示分区0

6. 重新启动,按提示按ctrl+A进入adaptec控制器utility,在manage volume里看到新建的卷,光标移上去按 ctrl+b设置为启动卷,此时可以看到volume的list顺序发生了改变,这个bootable的volume成了1st

7. 所以其实然后只要启动就好,然后可以在系统里删除logic drive

arcconf delete logictdrive 2

Alameda County Fair – 美国式的庙会

类型:表演,游乐会,游乐园,展览,shopping,美食
特色:和羊驼梅花鹿山羊袋鼠共处一室的petting zoo,free style motor show,小猪赛跑,火车模型展(相当细致),小动物展,音乐会,乡村演唱会
时间:区间型,2013年是6月19到7月7号
费用:门票,停车($10)

之所以叫美国式庙会,就是这个alameda county fair各种东西都有,各种show,race,exhibition,concert,游乐设施,还有各种互动节目,吃的,还有shopping。

亮点:

1. Petting zoo:和小动物共处一室来亲近,女士和儿童最爱。梅花鹿会咬你的衣服,被截掉了角的山羊,毛软软的羊驼,还有袋鼠,长得很奇怪的猪,甚至还有鸭子,一个不小心梅花鹿就在后面开始嚼你的衣服了,所以门口说了,不对动物造成的衣物损坏负责!

2. railroad model exhibition:不得不说老美还真是闲啊,这个模型展里有一个大型的微缩铁路,还有中央控制台,各种火车模型跑来跑去,细节制作相当精美,连旁边的屋子门口晾衣杆上挂的衣服都很惟妙惟肖,你就知道有多细节了

3. free style motor show:老美的极限运动,骑着摩托冲上半空各种惊险动作,甚至脱离了摩托车,惹人阵阵惊呼

4. pig racing:这个两小时一次,就是小猪赛跑,得提前至少半个小时抢占好位置才能看得到

 

分享好用的免费和开源软件

1. 文本编辑器
Notepad++
功能上实在不错,各种插件很丰富。我比较喜欢的几个功能是:1)列编辑模式很简单,2)支持正则表达式查找替换,3)shell脚本高亮支持非常好。觉得不足的地方有:1)对大文本处理不如editplus,2)没有html直接编辑菜单,3)目前好像还没有好的16进制编辑器

2. 图片编辑
Paint.Net
比画图高级,支持中文,重要的是开源免费,绝大多数时候我觉得自己并不需要PS,这是个好东西。

3. 终端
XShell
这个软件是home/school免费,所以。。。好处是1)带local shell,不用连接server即可使用一些常见命令比如ssh,2)下拉式的session tree很方便,连配置修改都有工具栏下拉式tree,缺点是1)对于del和backspace的处理需要修改一些配置,2)不直接支持page up和page down,需要按住shift,3)没有按住就hold的功能,如果屏幕在刷新就会继续跑下去不能选中,4)每次使用sftp都要弹出它那个什么xftp的提示

4. Mysql 客户端
HediSQL,其实没什么好说的,这个是我找到的没有sqlyog每次那样的购买提示的客户端。

5. epub电子书编辑器
Sigil
这个是在威锋上找到的,一个开源免费软件,懂点html就会用的很好,缺点就是中文显示不太好,文件大时处理较慢,不过对于我这样的容忍不了烂排版和错字太多的,自己拿来修改一本书不错

 

Apache/Tomcat tips

1. Apache httpd单地址多域名设置/Apache multi-name based on single IP
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:443

<VirtualHost *:443>
DocumentRoot /www/example1
ServerName www.example.com

# Other directives here

</VirtualHost>

<VirtualHost *:443>
DocumentRoot /www/example2
ServerName www.example.org

# Other directives here

</VirtualHost>

一定注意红色这一句,否则你会出现这个错误,第二个virtualhost不生效/Without the red instruction, the second virtualhost definition wont take effect:

[Fri Jun 21 15:20:54 2013] [warn] _default_ VirtualHost overlap on port 443, the first has precedence

2. 如果你定义了ProxyPass /,你会发现其他的定义都覆盖了
ProxyPass / will override other definition under / unless if you put into a virtualhost section
3. 定义LogLevel 为debug可以检查问题
Change LogLovel directive to debug can be used for debug

Solaris 10 network installation/网络安装提要

Server side
1. Find the mac address of client
2. Edit /etc/ethers, to add the MAC address into the file:
0:14:4f:79:b4:56        Meno
3. Add hostname and IP to /etc/hosts
10.10.10.101    Meno
4. Download the ISO files and mount
a. lofiadm -a /data/sol10-u11.iso

b.  lofiadm —–check result
c.  mount -F hsfs -o ro /dev/lofi/1 /a
5. Add client
cd /a/Solaris_10/Tools
./add_install_client Meno sun4u
6. Check NFS/RPC bind and NFS share
svcs -a | grep nfs
svcs -a | grep rpc/bind

online 21:46:22 svc:/network/rpc/bind:default
online 21:46:23 svc:/network/nfs/server:default
online 21:46:23 svc:/network/nfs/mapid:default
online 21:46:22 svc:/network/nfs/rquota:default
online 21:46:23 svc:/network/nfs/status:default
online 21:46:23 svc:/network/nfs/nlockmgr:default
online 21:46:22 svc:/network/rpc/bootparams:default
online 21:45:18 svc:/network/rarp:default
# share
–               /a   ro,anon=0   “”
Client:
{0} ok boot net – install

openboot prom下查看mac address

{0} ok devalias
cdrom /pci@0,600000/pci@0/pci@0/scsi@0/disk@4,0:f
net /pci@0,600000/pci@0/pci@1/pci@0/network@4
disk /pci@0,600000/pci@0/pci@0/scsi@0/disk@0
name aliases

{0} ok cd /pci@0,600000/pci@0/pci@1/pci@0
{0} ok ls
f00cdd30 network@4,1
f00c68e0 network@4
{0} ok cd network@4
{0} ok .properties
status okay
assigned-addresses 82062010 00000000 00800000 00000000 00200000
82062018 00000000 00610000 00000000 00010000
compatible pci14e4,1678.10cf.147a.a3
pci14e4,1678.10cf.147a
pci10cf,147a
pci14e4,1678.a3
pci14e4,1678
pciclass,020000
pciclass,0200
reg 00062000 00000000 00000000 00000000 00000000
03062010 00000000 00000000 00000000 00200000
03062018 00000000 00000000 00000000 00010000
local-mac-address 00 0b 5d e5 bb 72
max-frame-size 00010000
address-bits 00000030
network-interface-type ethernet
device_type network
name network
66mhz-capable
fast-back-to-back
devsel-speed 00000001

Solaris 10 x86上编译Apache HTTPD 2.2.24 with SSL

Apache HTTPD 2.2.24 在Solaris 10 x86上编译,使用命令是:
./configure –enable-proxy –enable-ssl

只要求SSL和proxy,遇到很多问题,现记录2个:
1.  No recognized SSL/TLS toolkit detected
Solution: 加上了–with-ssl=dir,命令成为
./configure –with-ssl=/usr/local/ssl –enable-proxy –enable-ssl

2.  Error, SSL/TLS libraries were missing or unusable
Solution: 安装了openssl 1.0.0j,1.0.0e都不行

 

Solaris 10 Patch Issues Summary

1. If you removed /var/sadm/pkg/*, you’ll not be able to maintenance the normal patch process. Maybe you get an error:

Target boot environment not identified as solaris 10

The reason is missing of SUNWcsr and SUNWcsu

Solution: if you have the same OS with the same patch level, duplicate the /var/sadm/pkg/* to this server. Then install the recommended patch

2. Don’t put the unzipped patch cluster in a directory that the “nobody” cannot read. Otherwise you’ll not be able to install any patch.

3. If you want to save disk space of /var, you can remove /var/sadm/pkg/*/save. You’ll not be able to revert to previous patch version but doesn’t impact next patch

mesg: cannot change mode

如果profile里加了mesg n 这句话,在使用su – 的时候会得到mesg: cannot change mode的提示,这是因为su – 的用户不能改变登陆用户的mesg的mode,事实上不影响tty或者terminal的状况,所以可以忽略