網絡依然還是計算機,Sun還是Sun!

SUN相关的问题的整理和汇总(1)

上一篇 / 下一篇  2007-08-21 00:05:07 / 个人分类:Solaris學習

查看( 188 ) / 评论( 2 )
1、 solaris 系统下怎么查看磁盘的block size IXPUB技术博客_$S j]J`
fstyp -v /dev/rdsk/cxtxdxsx |grep -i bsize
1s"g4c j+w&ZpAK'^7590422 2、怎么配置邮件客户端?solaris做为客户端 IXPUB技术博客0H*n]R\et9|xU
1.remove the /etc/mail/submit.cf
;|#f(m"R#{%k7590422 2.write the mailhost to /etc/hosts, just like:
^F+T,W%zt1z y:R8Q7590422    10.10.10.11        aserver        mailhost
.tEZ?6l7590422 3、SunCluster3.1中的Quorum设备如何重置? IXPUB技术博客Kr!}%Ko-F v]!G-fA
先reset一下看看,如果不行需要重新指定:
vAB"FEQV7590422 # scconf -c -q reset
$`pu._Q:i7590422
`5}7|([ uN*e)c7590422 重新指定一个新的把原来删掉即可: IXPUB技术博客/\+k W JS1Av \ }cK
# scconf -a -q globaldev=d4
1@'AN,dh-M,V7590422 # scconf -r -q globaldev=d5
Z%piTG9r7590422
TlA;qNcj3I7590422 或者用scsetup交互式命令指定和删除也可以! IXPUB技术博客'p5hy"w i~
4、如何拷贝SYMBOL LINK FILE
A!| uXN)[ l#a7590422 assuming the 2 new file systems are mounted on /mnt/sapmnt, /mnt/sap -
i7a jz\H*P?7590422 #(cd /; tar -cf - sapmnt) | ( cd /mnt; tar -xf -) IXPUB技术博客1X0L,I v8p[
#(cd /usr; tar -cf - sap) | (cd /mnt; tar -xf -)
/^ }&Y)O5]7590422 IXPUB技术博客A F0NcmhH
then, umount /sapmnt, /usr/sap, /mnt/sapmnt, /mnt/sap, and mount the 2 new file systems on /sapmnt, /usr/sap respectively
;}6S*F Io7590422 5、如何修改stack size?
Yz+Jy Sv8q/zgz Q7590422 ulimit –s 8192
!l NUdGC0N,A7590422 ulimit -a IXPUB技术博客O&}$f4FLW8qyC0v&?a

X C Zk"F7o7590422 core file size (blocks)     unlimited IXPUB技术博客'\0b%C0KU:x9u0o
data seg size (kbytes)      unlimited IXPUB技术博客8N`"t~6XH
file size (blocks)          unlimited IXPUB技术博客sfA!o5? O
open files                  1024 IXPUB技术博客 ~8H+T(rO(?
pipe size (512 bytes)       10 IXPUB技术博客t)FV7}_~
stack size (kbytes)         8192
M0_ F\ bg:M7590422 cpu time (seconds)          unlimited
-o$@-z5Q%{7590422 max user processes          29995
Z!WI[S+EK7590422 virtual memory (kbytes)     unlimited
8Y9DM+B4e%_+ai#iB7590422 6、提示符设置为主机名和登陆当前目录等
5I K D;VjGM i*@7590422 在.profile加入 IXPUB技术博客:K#Jn}x9Bv$Z
ccd()
~}Q}7S+y"X W8W`7590422 { IXPUB技术博客m a{_T!G0H$U?r
cd $1
r cm.jV;cz7590422 PS1="`id |cut -d '(' -f2|cut -d ')' -f1' '`@`uname -n``pwd`>" IXPUB技术博客 NK/HQ-`+D&VWjE7d'\^
}
#Ll8l7GV5YA.r7590422 alias cd=ccd
#C~8\9wM |Z7590422 或者直接加:PS1='[${UNAME}@${PWD}]'; export PS1
$M/k5v,PP6C1~7590422 7、VXVM恢复已经RAID5卷
.D rH`G7590422 系统崩溃或I/O错误会损坏已经景象卷的一个或多个plex,并使得plex均不处于CLEAN或ACTIVE状态。可以将plex中的一个标记为CLEAN,并指示系统使用该plex作为恢复其他plex的源。步骤如下:
2X`g`-Vj7590422 1、 使用以下命令将预定的plex置于CLEAN状态:
q"WK%AW7pW"H6O\\7590422 vxmend fix clean plex IXPUB技术博客P!hJbD5uA
2、 若要由CLEAN plex恢复卷中的其他plex,必须禁止卷,而这些plex必须处于STALE状态。如有必要,可通过在每个plex上依次运行以下命令,是所有其他的CLEAN或ACTIVE plex的状态变为STALE: IXPUB技术博客zd4DK4~
vxmend fix stale plex
9O7r a9Lc|%b:[7590422 3、 若要启用CLEAN plex并倨次恢复STALE plex,使用以下命令: IXPUB技术博客W7Z&C5qU8P@
vxvol start volume IXPUB技术博客/Vv,L'hn-@ K'r
或者:# vxvol -g userdg2 stop v21
d(\({9w }$b;d7590422 # vxprint -g userdg2 -ht IXPUB技术博客.m2Z6o@X` k9CM
# vxvol -g userdg2 -f start v21 IXPUB技术博客)o6M;V)wxWw'^
如果不行,就
Br*FaqX&EQ7590422 vxplex -f -o rm dis <log plex> IXPUB技术博客1w@y[/YKo
vxassist -g <dg> addlog <volume>
'o)J;p4` ^3J0@e7590422 vxvol -g <dg> start <volume> IXPUB技术博客[#| v.y{t-\
IXPUB技术博客Uu.r0L%o]9EH\z
8、SOLARIS下有抓图的键或者命令吗?
5wqp&^(B1r5o7590422 /usr/dt/bin/sdtimage可以取窗口/屏幕/矩形框截取图片,可存.gif/.jpg等
d _/C_Yh$_)P7590422 IXPUB技术博客L^,A BOI.Q

fv/SSr VK ~rq7590422 ASC   - The additional sense code IXPUB技术博客j[,ha'G+S
ASCQ - The additional sense code qualifier IXPUB技术博客[z&Q]?A
IXPUB技术博客(L"s;Rz2_ D
Please get more information about SCSI standards.
^w0u D2_s4S7590422 9、如何在主机中看HBA卡的WWN号
/A8n)u+R\K;k9e7590422 luxadm -e dump_map {enclosure[,dev]... | pathname...} IXPUB技术博客os AH-zWAF
Upon startup, the Platform Information and Control Library daemon, loads and IXPUB技术博客[ Q3\P"m2d+o Z
initializes plug-in modules. To get information from the PICL tree, you can IXPUB技术博客B.u.P [Lj"|1WL
use the prtpicl command interface. IXPUB技术博客/~q'r5m/S.f3p7}
IXPUB技术博客qv't+rr/?O
In the output following, I have noted the port & node WWN with this IXPUB技术博客-z\O*s"Zf
symbol: <======
F.unhv.OJ7590422 IXPUB技术博客@%Nv9gP)ya
To determine the WWN of a Sun[TM] Qlogic HBA, run the following  
Eo!q"YX;x+~l(N7590422 command(sample output included):
`9Ki*@{&sV7ftMM/k7590422 IXPUB技术博客%QKGp"|PG!gQ$o)\
#prtpicl -v -c scsi-fcp IXPUB技术博客+u3N1z`H3E/ro
SUNW,qlc (scsi-fcp, 3e00000272)
W(Msk)X@u7590422 eviceID      0x1  
8l F!L0k h7590422 :UnitAddress   1  IXPUB技术博客+k(q+E AL
:vendor-id     0x1077  
*aiA2K7eM8b7590422 :device-id     0x2312  
$gT*s3noD{7590422 :revision-id   0x2  IXPUB技术博客S\)T@'E
:subsystem-id  0x10a  
g8[4A.h$V8s.dY7590422 :subsystem-vendor-id   0x1077  
3Y6N8~y-a(@/j!t7590422 :min-grant     0x40  IXPUB技术博客9EP)k1ppE%@
:max-latency   0  IXPUB技术博客Kn;~/W gp
:interrupts    00  00  00  01  IXPUB技术博客[H R%M:\O3d
:class-code    0xc0400  IXPUB技术博客GI a~ Bw X2j
:devsel-speed  0x1  
r7DJx ^5P4G/ow#G0k7590422 :fast-back-to-back IXPUB技术博客q;W V$H7Z(Cx` W/Tw6O
:66mhz-capable
OO}){5I1A-~)rC3^!|X7590422 :fcode-rom-offset      0  
G _gW9F6_i0}6E Nt7590422 :version       ISP2312 FC-AL Host Adapter Driver: 1.13.08 04/10/02  IXPUB技术博客#YE7pa d(W0^1z
:device_type   scsi-fcp  IXPUB技术博客^IEv'Qu0wy;t
:#address-cells        0x2  IXPUB技术博客^ yJ0_GY-f
:#size-cells   0  
4?*q;a.`(IIh7590422 :manufacturer  QLGC  
;WWT&x [r+y7590422 :compatible   (3e0000027dTBL)  
"BV8@/O.Px1b I"zH7590422   | pci1077,2312.1077.10a.2 | IXPUB技术博客Z*fvm1x)_lw m um
  | pci1077,2312.1077.10a | IXPUB技术博客 B(C8`$w&\;^/fI4d
  | pci1077,10a | IXPUB技术博客2sEN%{x9P*x
  | pci1077,2312.2 |
6F{9{ I'Xnt$Ba7590422   | pci1077,2312 |
4o#`&xl-xUY&h;|L7590422   | pciclass,0c0400 |
&IH*Hm [0M7590422   | pciclass,0c04 |
8`&y}1w#S*~X5c7590422 :reg   IXPUB技术博客fo(j~+S f} T1w
00  02  08  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
%CD9UY r+wmV.j`7590422 00  01  02  IXPUB技术博客+a&?)Z{o1SS
08  10  00  00  00  00  00  00  00  00  00  00  00  00  00  00  01  00  02 IXPUB技术博客'e5QAl$D\
02  08  14  IXPUB技术博客m%F)R1W%m iF'j
00  00  00  00  00  00  00  00  00  00  00  00  00  00  10  00  
#aGo^8o Y*d`"Z0j'Ug7590422 :node-wwn      20  00  00  e0  8b  0a  57  77   <==================== IXPUB技术博客1q*`|}&\-v r
ort-wwn      21  00  00  e0  8b  0a  57  77   <====================
3m!TIT,L2W7590422 :assigned-addresses   
-A*r UaL7590422 81  02  08  10  00  00  00  00  00  00  20  00  00  00  00  00  00  00  01
-JK~+f-\7590422 00  82  02  
3\9h.Sw#iD8x7{+T t7590422 08  14  00  00  00  00  00  20  00  00  00  00  00  00  00  00  10  00  IXPUB技术博客9L ]xPAf6N{
:devfs-path    /pci@1f,0/pci@1/SUNW,qlc  IXPUB技术博客!d(Vg8b)X_
:binding-name  SUNW,qlc  
JxBCT(N9V$}7590422 :instance      -1  IXPUB技术博客@5y b.h2dE3E

'y(p ZjS7Z A\_Dt7590422 or try this script, it report only the wwn and the device path :
g"f'Krl c9S7590422 IXPUB技术博客 c;dtD0N S
echo IXPUB技术博客 Qd k`bA.l
printf "See below the results :\n" IXPUB技术博客(Y/Z-kf)Db"Ep
echo IXPUB技术博客.de9B;S C(_
prtpicl -v -c scsi-fcp | grep port-wwn > /tmp/port-wwn IXPUB技术博客nk!Gc-cqNtF
prtpicl -v -c scsi-fcp | grep devfs-path > /tmp/devfs-path IXPUB技术博客'y%v{J,Bg2q
paste -d "\t" /tmp/devfs-path /tmp/port-wwn
N"EL1XN7590422 IXPUB技术博客4kn[x"W w*dC
To determine the WWN of a Sun JNI HBA, run the following command: IXPUB技术博客y K&oY1`tx
IXPUB技术博客IbBQ0aT6K
# prtpicl -v -c scsi
A:N2En b"C4SM U7590422 SUNW,jfca (scsi, 8e0000023c) IXPUB技术博客R$|;~*r#rs;av
eviceID      0x2  
]${;_@ {:E7590422 :UnitAddress   2  
b](k i/GM7590422 :vendor-id     0x1242  
K&x4|9~ c-D Ww*]7590422 :device-id     0x1560  
jZI5Zi5DlX(`7590422 :revision-id   0xb2  IXPUB技术博客|g+|;b'ZJs)|)b S-N
:subsystem-id  0x656b  IXPUB技术博客n ` s!v \!V}
:subsystem-vendor-id   0x1242  
*J6~a;d.{3d+P7590422 :min-grant     0x8  
no`]ycs,F7590422 :max-latency   0x8  
o-h(ZkM`/X7590422 :interrupts    00  00  00  01  
*i,_3x_+CI0b7OW7590422 :class-code    0xc0400  IXPUB技术博客g:LN)xt;E'Q
:devsel-speed  0x1  IXPUB技术博客` l:Yr9r
:66mhz-capable
KzU Js!IT7590422 :fcode-rom-offset      0  
T?!K8Lo!c4N7590422 :device_type   scsi  IXPUB技术博客]T+`5l:V:z
:#size-cells   0  IXPUB技术博客p_gN\BP8f
:#address-cells        0x2  
$E0A `2|&jS7590422 :manufacturer  JNIC  
.h5B7Y+d7j.o K7590422 :copyright     Copyright (c) 2000-2003 by JNIC  IXPUB技术博客sky%y0G2u L
:fcode_revision        Version 1.0  
7kQ)T+\_(A}l.C7590422 :version       Version 1.0  IXPUB技术博客Y x4`%B3tQ}6d
:reg   
L3N6\q~7590422 00  00  10  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  IXPUB技术博客1cm v\ K W
01  00  10  10  00  00  00  00  00  00  00  00  00  00  00  00  00  00  01  00  IXPUB技术博客LEBhf3gr?C
03  00  10  14  00  00  00  00  00  00  00  00  00  00  00  00  00  00  10  00  IXPUB技术博客["s&a] d/f
01  00  10  1c  00  00  00  00  00  00  00  00  00  00  00  00  00  00  01  00  IXPUB技术博客 N4SF[/S PA)K
02  00  10  30  00  00  00  00  00  00  00  00  00  00  00  00  00  08  00  00  
B}r L9A1G$o+}lS~7590422 ci_slot      0x1000  IXPUB技术博客0|Lw6K3F*s3a9JXv6y
ower-consumption     
)`)~gT ~7590422 00  00  00  00  00  00  00  00  03  30  00  00  03  61  50  00  00  00  00  00  
)td^%m_3}7590422 00  00  00  00  00  60  00  00  01  00  00  00  00  00  00  00  00  00  00  00  
d*A.~z3}}+H7590422 :model         FCX2-6562-L  IXPUB技术博客e-j,nY5}ZB
:my_wwn_lo     0x7300e0ca  IXPUB技术博客 w)EW@ t
:my_wwn_hi     0x10000001  IXPUB技术博客ZK*bX&_r
:board_id      0xe0ca  IXPUB技术博客&r7}%X)IC
:board_revision        0x8001  
uH8S^'iN,{@8Zs0|'f7590422 :lport_cfg     0xffffffff  
$g.|6e-~$`l7590422 :seq_vers      MIL_32_v4eng9     
(j7k-z'Qi^R`T7590422 :fcode_cksum   0xf16  IXPUB技术博客t@ X$|8~2a2f
:sequencer_cksum       0x598a  IXPUB技术博客*Z/? @ TDG1p
:boots_wwn_lo  0xffffffff  
GF;o3g FdZ8|_ Jg7590422 :boots_wwn_hi  0xffffffff  
Kkfg+L/T\I7590422 :bootp_wwn_lo  0xffffffff  
D3K#E$tL7590422 :bootp_wwn_hi  0xffffffff  
WBxt6_{h M'?7590422 :assigned-addresses   
b2i'c9fH+bT$V-I7590422 81  00  10  10  00  00  00  00  00  00  18  00  00  00  00  00  00  00  01  00  IXPUB技术博客)Tz.zCFt
83  00  10  14  00  00  00  00  00  11  00  00  00  00  00  00  00  00  10  00  
'f3Zb-}1Q:O7590422 81  00  10  1c  00  00  00  00  00  00  1c  00  00  00  00  00  00  00  01  00  IXPUB技术博客h7R2i'bd/p`6X7n3U r
82  00  10  30  00  00  00  00  00  18  00  00  00  00  00  00  00  08  00  00  IXPUB技术博客yM$tm6I+KB1c)@
:cache-line-size       16  IXPUB技术博客1ziQ+BT!w
:latency-timer         64  
rp,`i4c2R-gP8Vm7590422 :node-wwn      10  00  00  01  73  00  e0  ca  <=============== IXPUB技术博客fb au P,J l
ort-wwn      20  00  00  01  73  00  e0  ca  <===============
l[-r4y b]W)K!U7590422 :devfs-path    /pci@1f,4000/SUNW,jfca@2  
W xW]%T.s L7590422 :driver-name   jfca  IXPUB技术博客Bpu.v/X Cj
:binding-name  SUNW,jfca  IXPUB技术博客Pm$Mc/gM$@7?D
:bus-addr      2  
xv z;V;R\4?+\2u7590422 :instance      0  
0t0@-p.xv?,{A7590422 :_class        scsi  IXPUB技术博客Q_\tLx b
:name  SUNW,jfca
I ZD;Z:S8~Z-hR3M7590422 IXPUB技术博客0QQTW"M/QQ)d;LW^
or try this script, it report only the wwn and the device path : IXPUB技术博客 x-]qeWC0M

|4m'DZ9b7590422 echo
Lp&wB3p1q#{7590422 printf "See below the results :\n" IXPUB技术博客"|3g$TY;f8W+yFZ%e
echo
| s%UB6o lT)Rj7Lq7590422 prtpicl -v -c scsi | grep port-wwn > /tmp/port-wwn IXPUB技术博客E:b+Iu^.Ev
prtpicl -v -c scsi | grep devfs-path > /tmp/devfs-path
J2U*?\6kIQ7590422 paste -d "\t" /tmp/devfs-path /tmp/port-wwn IXPUB技术博客xes%E@
IXPUB技术博客d3b8byY2qJ1oT
NOTE: You will not be able to locate a SUN Branded Emulex cards WWN while the system is up and running.
9{3U)f {VeNLl,T%Pt1z7590422 IXPUB技术博客BI3}*zI!M#IM
you will need to use .properties command at the ok prompt.
%H/Oi2U4\[ s8P7590422 IXPUB技术博客2h+kPN)Lz
The prtpicl command does not work with SBus Sun Qlogic cards (x6757, Ivory). To IXPUB技术博客 wx!F#P*cMc`/c P
find the WWN of these cards, 'prtconf -vp' can be used instead (reference infodoc 76953:
tE+m_LRknG7590422 Sun StorEdge[TM] SAN Software: How to Get the WWN of Sun FiberChannel HBAs for LUN Masking.) IXPUB技术博客 ae$oI`wO2Zy
如何查看系统中安装了哪些shell,并且还能支持哪些shell?
O0e)J TuJ7590422 # pkginfo | grep -i shell IXPUB技术博客5[fKg N6k es
IXPUB技术博客+t?+[ RQ)EpL
and,
#D%Ofj|'y-P`7590422
B3v)e$ho E!D7590422 ls -al /bin/*sh /usr/bin/*sh /usr/local/bin/*sh | egrep -v "hash|remsh|rsh|p.*sh"IXPUB技术博客a5UtBU;m9u

f s o!km2}7590422 IXPUB技术博客:MD}1T4FJuC8F;g

#oEG;WL4h!fue3j(w7590422 --------------------------------------------------------------------------------IXPUB技术博客uY9r"jl h7z{
风之幻想 回复于:2006-12-28 17:06:29
%~'k.h B3@M,HN7590422
)ZBb9sky f7590422 solaris怎么样查看一个文件是哪个包安装出来的? IXPUB技术博客}Y1^'s{)c
pkgchk -lp yourfilename
K)H2I"HRe }7590422 如何实现文件的即时监控? IXPUB技术博客;IG0aq'L;r;nI
可能徐对文件做校验,并比较,
p S\TA S m7590422 IXPUB技术博客(vBJ~D2t
如用Solaris 10里有cksum,可比较文件变化前后的校验,如校验Solaris 10 DVD光盘media文件:
"i&M9N)Q PI)BLW8t7590422
m%RA.YvSo7590422 # cksum solarisdvd.iso                    IXPUB技术博客v*t8Rt.| uNm
3842565141      3133603840      solarisdvd.iso
L)i+bAuk7590422
&q1}se_7590422 Solaris 10里还有BART,Basic Auditing and Reporting Tool,校验目录,帮助快速可靠的检查已部署的系统,创建已配置好的系统上的文件列表manifest,在系统上发现文件一级的改变,所以在配置好系统后应尽快建立系统或关键目录的文件列表manifest,并按系统的变化经常更新,如校验/etc目录:
!D)\8?m4p7590422
s"dd6[_$O7590422 # bart create  -R /etc > etc2005-05-20  
4L2[O1b$O/ZD7590422 # bart create  -R /etc > etc2006-01-16  IXPUB技术博客T8y(_O#Tvt V

^xC)PC-X?kG\3M7590422 Solaris 10里算法很多,自己琢磨下,选个速度满意的: IXPUB技术博客b` c/qJ6LMT wFK
IXPUB技术博客I'_+P hk
# cryptoadm list
4t5~$w'if&~$B+|7P7590422 IXPUB技术博客vq0P1}C!b
用户级的提供者: IXPUB技术博客3~mmH%b1e
提供者: /usr/lib/security/$ISA/pkcs11_kernel.so
6nBfT^7590422 提供者: /usr/lib/security/$ISA/pkcs11_softtoken.so IXPUB技术博客a$`3I dI!c\

p4M@#z v/DEk7590422 内核软件提供者:
1ax~-j"XXLlC7590422         des IXPUB技术博客*F.U5vC/Ok&C
        aes IXPUB技术博客(V.A4Q _;I4}P?(Z
        arcfour
$G.?7DxWdU/y E Q7590422         blowfish
W0Q_,G9aT7590422         sha1
k6I|E*@!R`/V_7590422         md5
&?\)?z xw7590422         rsa IXPUB技术博客v/IQ&b^5F
        swrand IXPUB技术博客oIn Y@};a
。。。 IXPUB技术博客8?,c#KU)s.QE
IXPUB技术博客iw9Ne;J7\ER9C
再如用md5签名校验:
"m5L+a8`i%x-K1O7590422 IXPUB技术博客1H2]"wbI`@
# digest -l
7{/{~+T'f&bvfzZ cI"s7590422 sha1
"@(rF#\S.v~'?7590422 md5 IXPUB技术博客)Cz}/Qa [6t-Wo"{

?z#ejca7590422 # digest -a md5 /etc/hosts IXPUB技术博客ZV.kk q+UK@
6cda1541bb58d86f3d3c9b13cf87aea7
TQagUj8WK9u6H7590422
p+s*U%iS W;e3J7590422 校验越频繁,CPU消耗越大,
.TAYs5B:S"o${7590422 solaris下如何把登陆日志全部删除呢?
a7EiRo-n3B6@7590422 # cd /var/adm
KFNU)`{m2\'o7590422 # /usr/lib/acct/fwtmp < wtmpx > wtmpx.ascii IXPUB技术博客FYl&p!I!Xv g9~
# vi + wtmpx.ascii
aM'uz;Ra-t|f7590422
h8f#YI8\TN)|7590422    remove some lines including your login information
qL}^`)eT9R7590422 IXPUB技术博客^%aZ#lI1_;k4g#WN
# /usr/lib/acct/fwtmp -ic < wtmpx.ascii > wtmpx
OI5| _5gz#Q R7590422 # rm wtmpx.ascii
O2N-ix3t+`7590422 # last | head IXPUB技术博客1ubf:K1]
scripting crontab 动态修改 IXPUB技术博客3sV2q&r;Q c:c
Remove # IXPUB技术博客G_V ^NWC
CODE:
y*@7[3w:\!G@nk0L7590422 [Copy to clipboard]
,|%Lh;T'qn5Il7590422 #!/bin/sh
+Z'dL6Z6C:q8hI,C7590422 IXPUB技术博客a[{hS*T
EDITOR=/bin/ed; export EDITOR
2]?Lh*yY,M"`7590422 /bin/crontab -e <<EOF IXPUB技术博客 |? R X:d&x/c9?1CV
1,$ s/^#*\([0-9]\)/\1/
e AS3^$M2Yt6t"~7590422 w
%n3a'DN$v4| s:c7590422 EOF
0g(Q {$A6xfwqIU$Z7590422 Add #
9j2D]u~ [&Z7dCA7590422 CODE: IXPUB技术博客4b3J9E/p1~)@_ ^val
[Copy to clipboard] IXPUB技术博客#c.\l/J/S3bsJ{.D
#!/bin/sh
8QBSMp7590422 IXPUB技术博客\o6y H8q8f2Z
EDITOR=/bin/ed; export EDITOR IXPUB技术博客B|OM D
/bin/crontab -e <<EOF IXPUB技术博客nZ7MD3Tl
1,$ s/^\([0-9]\)/#\1/ IXPUB技术博客2G}8a(K1z(qf.q:}4p
w
W&L"F u(T7590422 EOF
V/U9~,{(`Qc7590422 IXPUB技术博客]R3KW6H)r R F
SDS故障盘的更换恢复 IXPUB技术博客Miy v$O s
System information: IXPUB技术博客}\5Pp`1M/X Qu,u
Fire v880 operates on Solaris 8 with 6 disks.disk1 was organized as mirror of root disk disk0 and disk2 disk3 disk4 disk5 were oragnized as a raid 5 volume by disksuite4.2 . 2 replicas were placed at disk0-5 slice 4 so that system can boot correctly in case there is one disk failure .
6F,X4P8G%~3^V6El2?Z{7590422 IXPUB技术博客.Q%B4Q:cDN L:T
Error information:
L*{,gF @WZ7590422 metastat command display that logic devices at disk0 (c1t0d0s2) need maintenace .
}*?0Zzf$A7590422
E#u p+l5J{ Qc7590422 solution:
@VO"C6Ffn[9x^7590422 replace the failed disk c1t0d0s2 (disk0)
dOl Ue7590422
]+^m;ol7Su;g.f v R7590422 procedure:
n} Jqn7590422 1.        gether system information
9EWi4W;b&^v:A7590422 check the meta device state
w0@,u5q[f+C J7590422         #metastat IXPUB技术博客 dE-q u _6o8q Y0I
        #metadb –i IXPUB技术博客DP&R${x@7B~
check the slice location  
4z-Uz it(p| ~:{ c(Q7590422         #format
"XHX i)`2R;A/DZ`7590422         #more /vfstab
7N5HAB@ Cc(L7590422 2.        reboot from mirror disk
x7ZT^ _-X S7590422 you can create the alias previously IXPUB技术博客Y3J&V|8@2Nd
        ok nvalias disk1 /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0:a
%xiWc FM!E1n7590422         pathname listed here is not in a 880 server but from a test machine Ultra1 IXPUB技术博客 d1rRS ?{[-Cp
        ok setenv boot-device disk disk1
6h4cIb"^T j!u7590422 #reboot - - disk1
&a5je9{ hQ/Co'q.S7590422 if there is no sufficient replicas , not in this case , when rebooting system will enter system maintenance due to the replica quorum .You can delete the replicas on the bad disk by: IXPUB技术博客y vpo g(Ehb
        #metadb –d –f c1t0d0s4
Wh}}k&a'N u2U(f7590422 then you can boot system  
4QV.~srM7590422 3.        replace hard disk (hot plug)
u V6pzI B b7590422 #luxadm remove_device /dev/rdsk/c1t0d0s2
^7n^%q8A,b;M)j7590422 while OK-to-Remove LED is lighting  physically pull up the error disk from disk bay and insert the new disk. Then use command IXPUB技术博客 I]9n&QrE
        #luxadm insert_device FCloop,s0 IXPUB技术博客|u)hO ~c%C m
or  
Y0} e'?pjLs[7590422         #devfsadm –C IXPUB技术博客lR qPf ?+gJG
In the command luxadm enclosure_name can get by command  
/w._W CMe7590422         #luxadm probe IXPUB技术博客4U-e.|~kc
Identify the new disk by compare the WWN number in the output of belowing command  IXPUB技术博客:WU-v0|sg@3{
        #format
~)o&M?G({$M#^7590422         #ls –al /dev/rdsk/c1t0d0s2  
1_z%[%mi c7590422 4.        repair replica database IXPUB技术博客pIj3^9d+T:l rw!g K|
#prtvtoc /dev/rdsk/c1t1d0s2 | fmthard - /dev/rdsk/c1t0d0s2
it j o6E7590422 #metadb –a –c 2 /dev/rdsk/c1t0d0s4
'y G'`T8?:w%m.@.a Cp7590422 5.        resyncing the sub-mirrors IXPUB技术博客@\)`2Va;t6b
#metadetach d0 d10 IXPUB技术博客,S } _Sz])u)W
#metadetach d1 d11
VI @]tZ7oY7590422 #metadetach d3 d13
]a1N;j @7590422 #metadetach d5 d15 IXPUB技术博客4Ab1e'?LhHn
#metadetach d6 d16
-d#?U eRl)gf7590422 #metadetach d7 d17 IXPUB技术博客 ~$v)Gvy'G&`
#metaclear d10 d11 d13 d15 d16 d17
j-t2h)Io9m7590422 #metainit d10 1 1 c1t0d0s0 IXPUB技术博客+z.Q e+bp J
#metainit d11 1 1 c1t0d0s1 IXPUB技术博客4V^1O7l(p#}`
#metainit d13 1 1 c1t0d0s3 IXPUB技术博客w0I(C b]%\9OgK k%Z&H
#metainit d15 1 1 c1t0d0s5
aMg.ghK%Y8T$_6~&zs7590422 #metainit d16 1 1 c1t0d0s6
1V a],\#b GmM t7590422 #metainit d17 1 1 c1t0d0s7
"^]i1S3K7W ? N7590422 #metattach d0 d10
MIPmi0x;PK7o7590422 #metattach d1 d11 IXPUB技术博客!N#['}(s[F l[
#metattach d3 d13 IXPUB技术博客0|*qTh1N*r/|_
#metattach d5 d15 IXPUB技术博客(_2~ wD%mp;b:A!j
#metattach d6 d16
E-QjA5c:K \7590422 #metattach d7 d17
'MTv;c)k;P7590422 #metastat |grep %  IXPUB技术博客 r O2rL;};hP.tR'f
#reboot IXPUB技术博客@9t%t\2F L
#metastat
Vv9yEs/WE7590422
$TG[7y N d@7590422 tricks: IXPUB技术博客 @$kz#ty@a'\d+o
1.        sds user guide had mentioned the command metareplace to auto replace error submirror .But we have failed in using this command .You can find the same problem at InfoPartner Document BugReports Doc ID: 4777440.
p[6a W"B]0c3^t"r7590422 2.        when you mirror the root disk you must use command installboot bootblk ,but when you replace the root disk you will not need the same procedure.
tO!A;J!^(zm7590422
&`xY&\E-nv7590422 IXPUB技术博客0Ld"z.z7_idF ^
开机时报warningcisch0:in0 0x16 has been blocked
QWg0D%k7M/X7590422             warning:usba10_ehcio:interrupt #0 has been blocked IXPUB技术博客2r4ctl ~5E9g.}
Try a workaround. IXPUB技术博客5k!up7JGf

Mi~7gv4e5e9x7590422 1. Add a line to /etc/system IXPUB技术博客B2|s Q9z%K:Lf8w
IXPUB技术博客n]y0W5e+Z/?#C7E.t
set pcischci_unclaimed_intr_max=0x7fffffff
?+h~z2rZ7590422 IXPUB技术博客A A&B}T.?
2. reboot IXPUB技术博客5O_(pb,U8y n0@E
在SUN下用snoop抓包,看到如下内容,只有*** Header ,内部的DD在哪啊? IXPUB技术博客#X?}!\eeo)LH
# snoop -v port 7777 IXPUB技术博客?.w ohQ(a Cg
# snoop -v -x 0 port 7777
f X#SK.I8gk7590422 所有root拥有的文件全部改为ROot,如何快速恢复?
0~T4wUuq%j7590422 find dir-path -user ROot -exec chown root {} \; IXPUB技术博客}llf:j

q4@,X+b"y(b7590422 try IXPUB技术博客5U/Yc7J g,]
IXPUB技术博客/B.WT3I!?dT(|y
# crle -u
o_0d:Euat7590422 # ldd /usr/sbin/vxdg
O(U$_ J^0qn'Q`H$?7590422 # crle
2V/B p)No*f8D7590422 IXPUB技术博客`xYsfZC#W$h!A
If failed IXPUB技术博客!w!_CC+J5E

v |-{ Y O!r9u \,Q7590422 # mv /var/ld/ld.config /var/ld/ld.config.old
0Fz\0XC7590422 # crle -u
U4s1f_'zexCjN7590422 # ldd /usr/sbin/vxdg IXPUB技术博客'~o Dl)p
# crleIXPUB技术博客iJFZPR

v)p/oB/M EF7590422
Hrna}(ZYF7590422 --------------------------------------------------------------------------------IXPUB技术博客.a3j*Ph/c+k5m
风之幻想 回复于:2006-12-28 17:07:02IXPUB技术博客*fZL+X:q!rLh(Z
IXPUB技术博客,D$l5k1H-? uW Y
SUN做路由器的办法
$~&ZC6rE0_7590422 1.在sunos中设置两块网卡pcn0(168.9.203.239)、pcn1(192.168.9.11)
1C/H'sM(K2X5G)v\!\7590422 # ifconfig -a
v/Y] qv*LY{K7590422 lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
}-B+|c&^(g+] y7590422         inet 127.0.0.1 netmask ff000000 IXPUB技术博客0npJ+q3T!ou
pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 IXPUB技术博客*~Vv3d3q#f_*@/Q
        inet 168.9.203.239 netmask fffffc00 broadcast 168.9.203.255 IXPUB技术博客X@%D]0_,L T:m*Jr
        ether 0:c:29:7d:3a:2a
|v{:lR"Vg7590422 pcn1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3 IXPUB技术博客6f"Xd ]W Z1r,o
        inet 192.168.9.11 netmask ffffff00 broadcast 192.168.9.255
%j5F.e~*yE'J7590422         ether 0:c:29:7d:3a:34
m^)~$D_S,LR7590422 IXPUB技术博客P!xLq1B
2.修改/etc/hosts文件 IXPUB技术博客la6yr6^~2zp
127.0.0.1       localhost
?lcP8cs\7590422 168.9.203.239   sophia  loghost sophia.partner.com IXPUB技术博客moUH0?~g
192.168.9.11    partner
.L,`3csL7590422
FwE#j!l;u;}0TQ3p7590422 3.增加/etc/hostname.pcn1 IXPUB技术博客W/ydw7C O5\q
partner IXPUB技术博客q9G$HO1oT5X
IXPUB技术博客[[(eT7?

w\kI,K;pI!Y)F7590422 4.设置ip包转发 IXPUB技术博客G`va^%v `r7pI
# ndd -set /dev/ip ip_forwarding 1
!j,z"v}1h!a$\[7590422 # ndd -set /dev/ip ip_forward_directed_broadcasts 1 IXPUB技术博客/V'?NA:j
# ndd -set /dev/ip ip_forward_src_routed 1 IXPUB技术博客 TG(S-c3X$Sj
IXPUB技术博客0t;\9? qq}!v-a;P
修复4800CPU的软错误
3Re eM{au8ua ^7590422 Please kindly help to check about this:
Smx n3rq%H*q7uo7590422 IXPUB技术博客R+\{ U I
SC> showcomponent -d a IXPUB技术博客H+C*Rab+S:w1L'bp

-l,K]D?k[fHad-R7590422 Component           Status   Pending  POST   Description IXPUB技术博客/zXI5f,au
---------           ------   -------  ----   ----------- IXPUB技术博客kB+F Y;V4K,p \
/N0/SB0/P0          enabled  -        pass   UltraSPARC-III+, 1050MHz,  
(E7uy$M$q7590422 8M ECache
2eYP A H)`7590422 /N0/SB0/P1          enabled  -        pass   UltraSPARC-III+, 1050MHz,  IXPUB技术博客Z/Zl0T uJ%R#Z
8M ECache
5p:K9Y1@R7590422 /N0/SB0/P2          enabled  -        pass   UltraSPARC-III+, 1050MHz,  IXPUB技术博客#AD4}(^T)jk(]}o
8M ECache
Q6?Wk.SB$LmG7590422 /N0/SB0/P3          enabled  -        pass   UltraSPARC-III+, 1050MHz,  
(h^0_D"~7590422 8M ECache IXPUB技术博客5jRAh'LM
/N0/SB0/P0/B0/L0    enabled  -        pass   512M DRAM IXPUB技术博客 P P8f5M#M
/N0/SB0/P0/B0/L2    enabled  -        pass   512M DRAM IXPUB技术博客5st%wm|L Xz9m
/N0/SB0/P0/B1/L1    enabled  -        pass   512M DRAM IXPUB技术博客zZy$r*F
/N0/SB0/P0/B1/L3    enabled  -        pass   512M DRAM
)W3p)z!zq c4ZL8@7590422 /N0/SB0/P1/B0/L0    enabled  -        pass   512M DRAM
^`Q-i6wJ7590422 /N0/SB0/P1/B0/L2    enabled  -        pass   512M DRAM
Qi7L%ZVS]7590422 /N0/SB0/P1/B1/L1    enabled  -        pass   512M DRAM IXPUB技术博客LeFCjEd
/N0/SB0/P1/B1/L3    enabled  -        pass   512M DRAM
I1tC(e8zr7590422 /N0/SB0/P2/B0/L0    enabled  -        pass   512M DRAM
~ @1C+GG H&i]7590422 /N0/SB0/P2/B0/L2    enabled  -        pass   512M DRAM
C8FBs-r)w!_G7590422 /N0/SB0/P2/B1/L1    enabled  -        pass   512M DRAM IXPUB技术博客H-cFA:O f2yd5w
/N0/SB0/P2/B1/L3    enabled  -        pass   512M DRAM
o5d[ R(x7590422 /N0/SB0/P3/B0/L0    enabled  -        pass   512M DRAM
9v&h8W:h\K#u{4a7590422 /N0/SB0/P3/B0/L2    enabled  -        pass   512M DRAM
X[ C'QY0G7590422 /N0/SB0/P3/B1/L1    enabled  -        pass   512M DRAM
v[kfO{ C I7590422 /N0/SB0/P3/B1/L3    enabled  -        pass   512M DRAM
)G)Y8o8o!T5A,`]7590422 /N0/SB2/P0          disabled -        chs    UltraSPARC-III+, 1050MHz,  
7kSX2dE#id%|7590422 8M ECache IXPUB技术博客Z7z4C i,p(U"L-E
/N0/SB2/P1          disabled -        chs    UltraSPARC-III+, 1050MHz,  IXPUB技术博客{,A7no~)f0b1@E
8M ECache
\kU6\"Z5Y?-P[7590422 /N0/SB2/P2          disabled -        chs    UltraSPARC-III+, 1050MHz,  IXPUB技术博客E q"Ug FZ
8M ECache IXPUB技术博客2gA,qaQ7Wx D
/N0/SB2/P3          disabled -        chs    UltraSPARC-III+, 1050MHz,  
ZF,k|E n3r7o$KX7590422 8M ECache
tA*G9Z s} s6_7590422 /N0/SB2/P0/B0/L0    disabled -        chs    512M DRAM IXPUB技术博客&t.p!r3y9{+m I^
/N0/SB2/P0/B0/L2    disabled -        chs IXPUB技术博客H1?:S'}'X&W? j
IXPUB技术博客1Gr,Yot;J3v
If the SB4 is disabled, please check the col named POST of SB4, if it is
6t2r Bev7590422 chs, please help to check:
MZ*`w%`/br2I6X7590422 IXPUB技术博客*Tr\X,X%J-c
SC> showcomponent -v SB4
@,Yp!? S.e y?7590422 SC> showerrorbuffer
u}-Vr#hL1DY9B$X7590422 IXPUB技术博客}-|0y)P,CJ3VJ
and then enter service mode:
OE-w4s#o j0g7590422 SC> service
"?I q,{ A+l.Y7590422 The use of service commands can be destructive and destabilize the system. IXPUB技术博客,Ct/De"E!s
Use of service mode is authorized only by personnel trained in its use. IXPUB技术博客PV7R2R.P

,iS*f&V xj.F7590422 Enter Password:        gGmmlHslPK
;]6Abp)N;UI*q#HM7590422
*? o l(t|.H:wK7590422
:Z:Tb#T i*n7590422 SC[service]> showchs -b
#ur9_1C\+T7590422 ....
E2P;s7} }Y7590422 SC[service]> setchs -r "enable brd" -s ok -c  sb4
h+g}}Yd:]~7590422
c"{:^ K][ m3o2u7590422 and then please poweroff domain A by setkeyswitch off, after the domain A power off, please power it on and do max POST. IXPUB技术博客Bo~zd7[2?j8I
usb键盘上用STOP+N是没用的,应该按照以下步骤来恢复NVRAM到缺省值: IXPUB技术博客,Ku[!]s9wl]
1. After turning on the power to your system, wait until the front panel power indicator IXPUB技术博客0D)aA'^&I2y
LED begins to blink and you hear an audible beep. IXPUB技术博客em)M*@&M6^/L]R
2. Quickly press the front panel power switch twice (similar to the way you would
;y%t&wy)U!JI(h7590422 double-click a mouse). IXPUB技术博客$s c%E8x4i[/N/J E7z

6Q.K!KZ M'C&V+?*q&~;h7590422 1.创建NAFO 组  IXPUB技术博客6o9j!kg2LL QIjJ
# pnmset -c nafo-group -o create adapter [adapter ...]  IXPUB技术博客No,tV Q%j.Ph%I|*h
-c nafo-group 对指定的NAFO 组执行配置子命令。必须将NAFO 组命  
P X `b K+L$a\W7590422 名为nafoN,其中N 是一个非负的整数,用来标识该组。对每个节点而言,组名都是本地名称。因而,同一NAFO 组名可在多个节点上使用。  IXPUB技术博客v[t.bi;L(j YWc
-o create 创建新的NAFO 组。  
T4E+S^ pqi7590422 adapter [ adapter ... ] 指定用作备份适配器的公共网络适配器。  IXPUB技术博客P(^.CC:_zF;{3^4`

9w$Qd(I@O8@ A\7590422 2.向NAFO 组添加适配器  IXPUB技术博客.Sr-D g*e0v R qf
# pnmset -c nafo-group -o add adapter  
eg9Y/Bg7y7590422 -c nafo-group 指定要添加新适配器的NAFO 组。  
4I)C,lN-F7590422 -o add adapter 指定要添加到指定的NAFO 组的公共网络适配器。  IXPUB技术博客W_O7Hm7S VnrxQ

6m`}_p7590422 3.如何删除NAFO 组  
?g4l4q$A7590422 要想能够删除NAFO 组,逻辑主机资源组或共享地址资源组不得使用该组。  
ckzC"W7590422 1. 成为包含要删除的NAFO 组的节点的超级用户。  
#q_5BDc(y"c1\7590422 2. 确定是否有任何逻辑主机资源或共享地址资源正在使用NAFO 组。  IXPUB技术博客,w)e8?kzJX/WF
# scrgadm -pv  
r-k'Z$T?U_aH7590422 您还可以使用scrgadm-pvv(带有两个v 标志)来确定那些正在使用将要删除的NAFO 组的资源。  
,a7z {wk\ c4HZO7590422 3. 切换使用该NAFO 组的逻辑主机资源组和共享地址资源。  
xp3AceW\/\7590422 # scswitch -z -g resource-group -h nodelist  IXPUB技术博客$mo7jL}#\nV
-z -g resource-group 切换指定的资源组。  IXPUB技术博客J3}'LP {6? qYb9c3g
-h nodelist 指定要将资源组切换到的节点的名称。  IXPUB技术博客7HX\;H|@T;Q
4. 删除NAFO 组。  
%H|3h"v#iW.P7590422 # pnmset -c nafo-group -o delete  
2T4X^;I2Ww]7590422 -c nafo-group 指定要删除的NAFO 组。  IXPUB技术博客nb~2@4Q
-o delete 删除NAFO 组。  IXPUB技术博客G!\,\b0m4r
5. 检验该NAFO 组的状态。  
EZ ut+jp7590422 列表中不应出现已删除的NAFO 组。  IXPUB技术博客"?)s,uK"m^)TD~
# pnmstat -l  IXPUB技术博客Z0A5M~2K4K(`

_~;MG,F&]{ a7590422 示例— 切换NAFO 组的活动适配器  
/aj*}6J+f7590422 以下示例说明了将活动适配器从qfe0 切换到qfe1 的过程。  
L#v h-wUz C7590422 # pnmstat -l  
4u7p&Yk t0NW7590422 group adapters status fo_time act_adp  IXPUB技术博客 g9sJ9b `X T
nafo0 qfe0:qfe1 OK NEVER qfe0  IXPUB技术博客"o hb aYV N
# pnmset -c nafo0 -o switch qfe1  IXPUB技术博客"I)f$fHM4O7P*F,E(R
# mv /etc/hostname.qfe0 /etc/hostname.qfe1  IXPUB技术博客re!y*_^6G
# pnmstat -l  IXPUB技术博客*d@3Z$u lNFy6V
group adapters status fo_time act_adp  IXPUB技术博客.r}:D-c\
nafo0 qfe0:qfe1 OK 11 qfe  IXPUB技术博客}8YMCSu%Jhw
查找NAFO 组的活动适配器  
I!K!z m@Aa7590422 # pnmptor nafo0  IXPUB技术博客S&W:_}Y^ H ^ Y
查找适配器的NAFO 组  
.Xc8Q0S]v7590422 # pnmrtop qfe5  
N#C `+R$`J7590422 IXPUB技术博客-y h'|-cuH&kV8x h-o
4.如何更改公共网络管理可调参数  
|2[y\3Z7590422 /etc/cluster/pnmparams  
1r(PuF+Q%pHV7590422
*kJs/t)B H0g D\7590422 inactive_time 当前活动适配器的包计数器在连续进行两次探测之间的秒数。缺省值为5。  
X,T$n;e'F}7590422 ping_timeout ALL_HOST_MULTICAST 和子网广播ping 的超时值(以秒为单位)。缺省值为4。  IXPUB技术博客2^/D5i7{#A-o
repeat_test 在声明活动适配器有故障并触发故障转移前执行ping 序列的次数。缺省值为3。  IXPUB技术博客1F)g-A&V @
slow_network 每次从执行ping 序列之后到检查包计数器以查看是否有任何更改之间所等待的秒数。缺省值为2。  
dv4F4[]A Q ~7590422 warmup_time 从将故障转移到备份适配器后到恢复故障监视前所等待的秒数。此设置为慢速驱动程序或缓慢的端口初始化过程保留了额外的时间。缺省值为0。
1Zjf3ltDX7590422 光纤盘DD的恢复办法。 IXPUB技术博客 hY&|bZ!t3o
dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 bs=8192k
Z-`n1D(D W'm"H7590422      将你做好的DD盘换到原系统盘的位置。 IXPUB技术博客9Ten D ` `B.G7J
ok boot cdrom –s IXPUB技术博客.qU9B Y-~,GX`
     mount /dev/dsk/c0t0d0s0 /mnt IXPUB技术博客 LH-X2p3@ oN
     drvconfig –r /mnt –p /mnt/etc/path_to_inst IXPUB技术博客1F-mbQ4gF)@.zmoy
     cd /devices
W e?)a1h{I1?;R7590422      find . –print |cpio –pduVm /mnt/devices
O:z&D!xa z$_4K7590422      disks –r /mnt IXPUB技术博客Gj1s1u'r ?k
     luxadm set_boot_dev /dev/dsk/c0t0d0s0
%MF#Ik pF~FD7590422      init 0  IXPUB技术博客aN^VU:@'P.y(M
     ok boot -r
m(UKX"`)IWY7590422 ld.so.1文件损坏或丢失后系统怎样恢复正常?
-[ b:LsQ(jQ1F\7590422 boot cdrom -s first,try to recover the system. IXPUB技术博客5}T[!D!\-b @
here is a document,may it can help.
yv_+wO1|%D)}?7590422
O9d6P#z]G5@'~7590422 IXPUB技术博客/mj)B3zZ"r
IXPUB技术博客!iP,h)d;H?4w)GT(]
实时连接器ld.so.1文件损坏或丢失后系统怎样恢复正常?  IXPUB技术博客0^ j"LX O{d![
前言:看到网上好多人遇到ld.so.1文件损坏或丢失,系统瘫痪询问怎样处理,为此我将这一故障现象进行归纳总结,供各位网友参考,希望从中得到帮助。  
pd(_-g8c%|t7590422
_5t l"Jx8DR"b7590422 一、动态连接库的概念  
\,]g6h,D`W;q7590422 大家都知道,在WINDOWS系统中有很多的动态链接库(以.DLL为后缀的文件,DLL即Dynamic Link Library)。这种动态链接库,和静态函数库不同,它里面的函数并不是执行程序本身的一部分,而是根据执行程序需要按需装入,同时其执行代码可在多个执行程序间共享,节省了空间,提高了效率,具备很高的灵活性,得到越来越多程序员和用户的青睐。  IXPUB技术博客vqPPM0`!j%|Sf
Solaris系统里面有些库文件,当编译的时候,如果把库文件也编译到文件中,那文件本身就可以执行,但这样的缺点是生成的文件十分大。所以很多情况下使用动态连接库,就是编译出的文件不包含库,而只包含到库的指针,这样在运行的时候会到指定的地方调用这个库,这样就减少了文件的大小。Solaris包含的实时连接器ld.so.1,就是动态对象的运行阶段链接程序。  IXPUB技术博客fYI/tNv8E

:[4p |"b~AV7590422 从下面的的命令中,我们可以列出可执行文件或者共享对象的动态从属关系,这玩意没了,你的什么ls,cd什么的命令就都费了,如果ld.so.1文件被破坏了,系统肯定无法正常启动。  
9r`3P$\D${+a1JjBK7590422 IXPUB技术博客aZE8bl!R
/usr/bin/ldd [filename]  IXPUB技术博客%Hq9wz6udS0@
/* List the dynamic dependencies of executable files */  IXPUB技术博客_NM.jV~%[,s8k
IXPUB技术博客!TZ+b1SNmR$K/R
# /usr/bin/ldd /usr/bin/cat  IXPUB技术博客Oi@*zg!s h
libc.so.1 => /usr/lib/libc.so.1  
6RVjb ViOl1|#X O@7590422 libdl.so.1 => /usr/lib/libdl.so.1  IXPUB技术博客%W*o.iJ*P0p)^ q U
/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1  IXPUB技术博客Jqn1IwO
# ldd /usr/bin/ls  
y w9a+["],n7590422 libc.so.1 => /usr/lib/libc.so.1  IXPUB技术博客]:A1K4]+[4c yl
libdl.so.1 => /usr/lib/libdl.so.1  IXPUB技术博客%[1f/^a Tb/o
/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1  IXPUB技术博客z)y*P |iZK,_q-mI.q6X6J
# ldd /usr/bin/cp  IXPUB技术博客uCs,zR
libc.so.1 => /usr/lib/libc.so.1  
kHv o`1]f3u7590422 libdl.so.1 => /usr/lib/libdl.so.1  IXPUB技术博客Q @&m$L E8xXu t8DP
/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1  IXPUB技术博客8T&D!I wn~

"[k*p+l{Us7590422 二、ld.so.1文件损坏或丢失解决的办法  IXPUB技术博客*ta:tvPio

3LSi\}(~/]7590422 1.如果意外的/usr/lib/ld.so.1损坏或丢失,系统没有正常启动的情况下:  IXPUB技术博客K hb|E
执行命令都会出现错误信息:  
0f.{#T1UD ]_"?~;q7590422 #reboot  
"Q\c };`*h0R7590422 Reboot :can not find /usr/lib/ld.so.1  
s!bLS B i0^3L7590422 #find  
6A[1Nn4u7590422 Find: /usr/lib/ld.so.1  IXPUB技术博客E+GplG"j)S"YJ
#ls  
o_G h6~-QD}7590422 Ls: can not find can not find  IXPUB技术博客 TR/y([]oX

Hs1| wt:G-lga:Y y7590422 这时,千万不要重启动,立即用/usr/sbin/static/mv、/usr/sbin/static/cp命令恢复 :  IXPUB技术博客Jf5Cs3oe
IXPUB技术博客9c7sI6Xs&r1u1ow
#/sbin/static/cp /etc/lib/ld.so.1 /usr/lib/  
AAH1_9z8X2vG7590422 经过实验,系统恢复正常!这时,你试试如下命令,就能体会到为什么了。  
|2C m'e1RTFR7590422 ---------------------------------------------------------------------------  IXPUB技术博客0N%|q@g&ydwKw R
# ls /usr/sbin/static  
_#f3z kF \"JW9^7590422 cp* ln* mv* rcp* tar*  
P"KU a[7590422 SUN的工程师非常聪明,为了防备了这个情况, 做了以上几个不使用动态连接库的命令  
,]XyVP7WjKz7590422 #find / -name ld.so.1 -print  
.@p+Z,H!d7590422 /usr/lib/sparcv9/ld.so.1  
5^Bq:YPO-Fc Xi |7590422 /usr/lib/ld.so.1  IXPUB技术博客{4I0S^F6m,q
/etc/lib/ld.so.1  
N,[H)Y qV7590422 blade% ls -ld /usr/lib/sparcv9/ld.so.1  IXPUB技术博客*]k@q4_ S%A.a5u(N
-rwxr-xr-x 1 root bin 191672 Jul 28 2001 /usr/lib/sparcv9/ld.so.1  
)L9A ck[)J~#n7590422 blade% ls -ld /usr/lib/ld.so.1  
H{ ^#fV~8F ]7590422 -rwxr-xr-x 1 root bin 196852 Jul 28 2001 /usr/lib/ld.so.1  
(O;yJ0B1u L'pH7590422 blade% ls -ld /etc/lib/ld.so.1  IXPUB技术博客a mb-N1p#A_.Xo
-rwxr-xr-x 1 root bin 196852 Jul 28 2001 /etc/lib/ld.so.1  IXPUB技术博客e|Ur|
---------------------------------------------------------------------------  IXPUB技术博客 ZJ9U3CP"P
从上面的,我们又可以看到,这个库文件,不仅仅在/usr/lib有,在/etc/lib、/usr/lib/sparcv9/下也有,所以你就重新在本机上拷贝一份就行了。这些信息在这个连接库不正常的情况下是看不到的。  IXPUB技术博客r DLh0a.k V$it0G,C&J

,X W%ch8t*hz6Lz P'? n7590422 2.如果意外的/usr/lib/ld.so.1损坏或丢失,系统启动的情况下:  IXPUB技术博客7r e&yg*nool:qUF
错误信息:  IXPUB技术博客 @M,s \ g^ k4`
Uname:can not find /usr/lib/ld.so.1  IXPUB技术博客j,L k;FIp$x(o}
Loadkeys: can not find /usr/lib/ld.so.1  
(EN n0m^I+{G4c/j)w7590422 Killed  IXPUB技术博客h)u)].fx7X
Cfsfstype: can not find /usr/lib/ld.so.1  IXPUB技术博客k_l)LQ:e
Expr: can not find /usr/lib/ld.so.1  IXPUB技术博客#lKV1BY)Um
Swap: can not find /usr/lib/ld.so.1  
:x4RrA1ly a8O7590422 Killed  IXPUB技术博客/tTsd a{ W
Fsck: can not find /usr/lib/ld.so.1  IXPUB技术博客2]}X,p/kD8y/O*Az GR
Killed  
(M:ZK aD^/y7590422
L\d.I9Hh!{'}\&n5B7590422 这时,用光盘启动到单用户下:  
@#Eiu6b;Hgk7590422 ok boot cdrom -s (放入启动安装光盘)  
P(n$hVd[)v7590422 #mount /dev/dsk/c0t0d0s0 /mnt (这里指定原usr目录对应的原始设备名)  
;B [e2\4l)~7590422 # cp /mnt/etc/lib/ld.so.1 /mnt/lib/(就是将/usr/etc下的这个文件拷贝到/usr/lib下。)  
F:QA'?cf/J*~4j7590422 系统重新启动,一切正常!  
g y+m4s yf ~!X8i`7590422
I*v _ pC0{ Lr7590422 3.如果/usr被改名了情况下,怎么办?  IXPUB技术博客]t^s i5XC?H
假设/usr改名成了/faint,系统没有启动  IXPUB技术博客1}-w-L*F1_ I[W1O?
马上执行  IXPUB技术博客 v-zq!e2nG5j\.M9E
#/faint/sbin/static/mv /faint /usr  IXPUB技术博客wTJC4J7]1B D

rB)V;}aqp1y7590422 假设/usr改名成了/faint,系统重新启动,这时肯定不能正常启动,同样我们启动到单用户下:  IXPUB技术博客W-^G9^A/[*a
ok boot cdrom -s (放入启动安装光盘)  IXPUB技术博客 U&O5O4^I:^,|~
mount /dev/dsk/c0t0d0s0 /mnt (这里指定原usr目录对应的原始设备名)  
7p];A.j3OPSN/c7590422 mv /mnt/faint /mnt/usr  IXPUB技术博客Y!G Ti[l'w
IXPUB技术博客#`?)yw}L8sl@?
建议把/usr/sbin/static下的东西拷一份到/sbin下或者其它比较可信的跟/在同一个文件系统下的目录下。以备系统不测.  IXPUB技术博客hN;A,fR
IXPUB技术博客[U[#S1U
之后,我又进行了多次实验,各个版本系统下的/usr/lib/ld.so.1文件互相兼容。所以也可以从其他机器拷贝过来。

TAG:

SUN microsystems chnvip001 发布于2007-08-21 15:50:37
LZ辛苦了,谢谢,俺先收下了!
云杉实验室——蝴蝶分院 云杉上的蝴蝶 发布于2007-08-21 18:43:52
此帖已收集到主题列表
我来说两句

(可选)

Open Toolbar