亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
12下一頁
最近訪問板塊 發(fā)新帖
查看: 27338 | 回復: 19
打印 上一主題 下一主題

SUN相關的問題的整理和匯總(1) [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2006-12-28 17:05 |只看該作者 |倒序瀏覽
1、        solaris 系統(tǒng)下怎么查看磁盤的block size
fstyp -v /dev/rdsk/cxtxdxsx |grep -i bsize
2、怎么配置郵件客戶端?solaris做為客戶端
1.remove the /etc/mail/submit.cf
2.write the mailhost to /etc/hosts, just like:
   10.10.10.11        aserver        mailhost
3、SunCluster3.1中的Quorum設備如何重置?
先reset一下看看,如果不行需要重新指定:
# scconf -c -q reset

重新指定一個新的把原來刪掉即可:
# scconf -a -q globaldev=d4
# scconf -r -q globaldev=d5

或者用scsetup交互式命令指定和刪除也可以!
4、如何拷貝SYMBOL LINK FILE
assuming the 2 new file systems are mounted on /mnt/sapmnt, /mnt/sap -
#(cd /; tar -cf - sapmnt) | ( cd /mnt; tar -xf -)
#(cd /usr; tar -cf - sap) | (cd /mnt; tar -xf -)

then, umount /sapmnt, /usr/sap, /mnt/sapmnt, /mnt/sap, and mount the 2 new file systems on /sapmnt, /usr/sap respectively
5、如何修改stack size?
ulimit –s 8192
ulimit -a

core file size (blocks)     unlimited
data seg size (kbytes)      unlimited
file size (blocks)          unlimited
open files                  1024
pipe size (512 bytes)       10
stack size (kbytes)         8192
cpu time (seconds)          unlimited
max user processes          29995
virtual memory (kbytes)     unlimited
6、提示符設置為主機名和登陸當前目錄等
在.profile加入
ccd()
{
cd $1
PS1="`id |cut -d '(' -f2|cut -d ')' -f1' '`@`uname -n``pwd`>"
}
alias cd=ccd
或者直接加:PS1='[${UNAME}@${PWD}]'; export PS1
7、VXVM恢復已經RAID5卷
系統(tǒng)崩潰或I/O錯誤會損壞已經景象卷的一個或多個plex,并使得plex均不處于CLEAN或ACTIVE狀態(tài)?梢詫lex中的一個標記為CLEAN,并指示系統(tǒng)使用該plex作為恢復其他plex的源。步驟如下:
1、        使用以下命令將預定的plex置于CLEAN狀態(tài):
vxmend fix clean plex
2、        若要由CLEAN plex恢復卷中的其他plex,必須禁止卷,而這些plex必須處于STALE狀態(tài)。如有必要,可通過在每個plex上依次運行以下命令,是所有其他的CLEAN或ACTIVE plex的狀態(tài)變?yōu)镾TALE:
vxmend fix stale plex
3、        若要啟用CLEAN plex并倨次恢復STALE plex,使用以下命令:
vxvol start volume
或者:# vxvol -g userdg2 stop v21
# vxprint -g userdg2 -ht
# vxvol -g userdg2 -f start v21
如果不行,就
vxplex -f -o rm dis <log plex>
vxassist -g <dg> addlog <volume>
vxvol -g <dg> start <volume>

8、SOLARIS下有抓圖的鍵或者命令嗎?
/usr/dt/bin/sdtimage可以取窗口/屏幕/矩形框截取圖片,可存.gif/.jpg等


ASC   - The additional sense code
ASCQ - The additional sense code qualifier

Please get more information about SCSI standards.
9、如何在主機中看HBA卡的WWN號
luxadm -e dump_map {enclosure[,dev]... | pathname...}
Upon startup, the Platform Information and Control Library daemon, loads and
initializes plug-in modules. To get information from the PICL tree, you can
use the prtpicl command interface.

In the output following, I have noted the port & node WWN with this
symbol: <======

To determine the WWN of a Sun[TM] Qlogic HBA, run the following
command(sample output included):

#prtpicl -v -c scsi-fcp
SUNW,qlc (scsi-fcp, 3e00000272)
eviceID      0x1
:UnitAddress   1
:vendor-id     0x1077
:device-id     0x2312
:revision-id   0x2
:subsystem-id  0x10a
:subsystem-vendor-id   0x1077
:min-grant     0x40
:max-latency   0
:interrupts    00  00  00  01
:class-code    0xc0400
:devsel-speed  0x1
:fast-back-to-back
:66mhz-capable
:fcode-rom-offset      0
:version       ISP2312 FC-AL Host Adapter Driver: 1.13.08 04/10/02
:device_type   scsi-fcp
:#address-cells        0x2
:#size-cells   0
:manufacturer  QLGC
:compatible   (3e0000027dTBL)
  | pci1077,2312.1077.10a.2 |
  | pci1077,2312.1077.10a |
  | pci1077,10a |
  | pci1077,2312.2 |
  | pci1077,2312 |
  | pciclass,0c0400 |
  | pciclass,0c04 |
:reg  
00  02  08  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
00  01  02
08  10  00  00  00  00  00  00  00  00  00  00  00  00  00  00  01  00  02
02  08  14
00  00  00  00  00  00  00  00  00  00  00  00  00  00  10  00
:node-wwn      20  00  00  e0  8b  0a  57  77   <====================
:port-wwn      21  00  00  e0  8b  0a  57  77   <====================
:assigned-addresses   
81  02  08  10  00  00  00  00  00  00  20  00  00  00  00  00  00  00  01
00  82  02
08  14  00  00  00  00  00  20  00  00  00  00  00  00  00  00  10  00
:devfs-path    /pci@1f,0/pci@1/SUNW,qlc
:binding-name  SUNW,qlc
:instance      -1

or try this script, it report only the wwn and the device path :

echo
printf "See below the results :\n"
echo
prtpicl -v -c scsi-fcp | grep port-wwn > /tmp/port-wwn
prtpicl -v -c scsi-fcp | grep devfs-path > /tmp/devfs-path
paste -d "\t" /tmp/devfs-path /tmp/port-wwn

To determine the WWN of a Sun JNI HBA, run the following command:

# prtpicl -v -c scsi
SUNW,jfca (scsi, 8e0000023c)
eviceID      0x2
:UnitAddress   2
:vendor-id     0x1242
:device-id     0x1560
:revision-id   0xb2
:subsystem-id  0x656b
:subsystem-vendor-id   0x1242
:min-grant     0x8
:max-latency   0x8
:interrupts    00  00  00  01
:class-code    0xc0400
:devsel-speed  0x1
:66mhz-capable
:fcode-rom-offset      0
:device_type   scsi
:#size-cells   0
:#address-cells        0x2
:manufacturer  JNIC
:copyright     Copyright (c) 2000-2003 by JNIC
:fcode_revision        Version 1.0
:version       Version 1.0
:reg  
00  00  10  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
01  00  10  10  00  00  00  00  00  00  00  00  00  00  00  00  00  00  01  00
03  00  10  14  00  00  00  00  00  00  00  00  00  00  00  00  00  00  10  00
01  00  10  1c  00  00  00  00  00  00  00  00  00  00  00  00  00  00  01  00
02  00  10  30  00  00  00  00  00  00  00  00  00  00  00  00  00  08  00  00
:pci_slot      0x1000
:power-consumption   
00  00  00  00  00  00  00  00  03  30  00  00  03  61  50  00  00  00  00  00
00  00  00  00  00  60  00  00  01  00  00  00  00  00  00  00  00  00  00  00
:model         FCX2-6562-L
:my_wwn_lo     0x7300e0ca
:my_wwn_hi     0x10000001
:board_id      0xe0ca
:board_revision        0x8001
:lport_cfg     0xffffffff
:seq_vers      MIL_32_v4eng9   
:fcode_cksum   0xf16
:sequencer_cksum       0x598a
:boots_wwn_lo  0xffffffff
:boots_wwn_hi  0xffffffff
:bootp_wwn_lo  0xffffffff
:bootp_wwn_hi  0xffffffff
:assigned-addresses   
81  00  10  10  00  00  00  00  00  00  18  00  00  00  00  00  00  00  01  00
83  00  10  14  00  00  00  00  00  11  00  00  00  00  00  00  00  00  10  00
81  00  10  1c  00  00  00  00  00  00  1c  00  00  00  00  00  00  00  01  00
82  00  10  30  00  00  00  00  00  18  00  00  00  00  00  00  00  08  00  00
:cache-line-size       16
:latency-timer         64
:node-wwn      10  00  00  01  73  00  e0  ca  <===============
:port-wwn      20  00  00  01  73  00  e0  ca  <===============
:devfs-path    /pci@1f,4000/SUNW,jfca@2
:driver-name   jfca
:binding-name  SUNW,jfca
:bus-addr      2
:instance      0
:_class        scsi
:name  SUNW,jfca

or try this script, it report only the wwn and the device path :

echo
printf "See below the results :\n"
echo
prtpicl -v -c scsi | grep port-wwn > /tmp/port-wwn
prtpicl -v -c scsi | grep devfs-path > /tmp/devfs-path
paste -d "\t" /tmp/devfs-path /tmp/port-wwn

NOTE: You will not be able to locate a SUN Branded Emulex cards WWN while the system is up and running.

you will need to use .properties command at the ok prompt.

The prtpicl command does not work with SBus Sun Qlogic cards (x6757, Ivory). To
find the WWN of these cards, 'prtconf -vp' can be used instead (reference infodoc 76953:
Sun StorEdge[TM] SAN Software: How to Get the WWN of Sun FiberChannel HBAs for LUN Masking.)
如何查看系統(tǒng)中安裝了哪些shell,并且還能支持哪些shell?
# pkginfo | grep -i shell

and,

ls -al /bin/*sh /usr/bin/*sh /usr/local/bin/*sh | egrep -v "hash|remsh|rsh|p.*sh"

論壇徽章:
0
2 [報告]
發(fā)表于 2006-12-28 17:06 |只看該作者
solaris怎么樣查看一個文件是哪個包安裝出來的?
pkgchk -lp yourfilename
如何實現(xiàn)文件的即時監(jiān)控?
可能徐對文件做校驗,并比較,

如用Solaris 10里有cksum,可比較文件變化前后的校驗,如校驗Solaris 10 DVD光盤media文件:

# cksum solarisdvd.iso                  
3842565141      3133603840      solarisdvd.iso

Solaris 10里還有BART,Basic Auditing and Reporting Tool,校驗目錄,幫助快速可靠的檢查已部署的系統(tǒng),創(chuàng)建已配置好的系統(tǒng)上的文件列表manifest,在系統(tǒng)上發(fā)現(xiàn)文件一級的改變,所以在配置好系統(tǒng)后應盡快建立系統(tǒng)或關鍵目錄的文件列表manifest,并按系統(tǒng)的變化經常更新,如校驗/etc目錄:

# bart create  -R /etc > etc2005-05-20
# bart create  -R /etc > etc2006-01-16

Solaris 10里算法很多,自己琢磨下,選個速度滿意的:

# cryptoadm list

用戶級的提供者:
提供者: /usr/lib/security/$ISA/pkcs11_kernel.so
提供者: /usr/lib/security/$ISA/pkcs11_softtoken.so

內核軟件提供者:
        des
        aes
        arcfour
        blowfish
        sha1
        md5
        rsa
        swrand
。。。

再如用md5簽名校驗:

# digest -l
sha1
md5

# digest -a md5 /etc/hosts
6cda1541bb58d86f3d3c9b13cf87aea7

校驗越頻繁,CPU消耗越大,
solaris下如何把登陸日志全部刪除呢?
# cd /var/adm
# /usr/lib/acct/fwtmp < wtmpx > wtmpx.ascii
# vi + wtmpx.ascii

   remove some lines including your login information

# /usr/lib/acct/fwtmp -ic < wtmpx.ascii > wtmpx
# rm wtmpx.ascii
# last | head
scripting crontab 動態(tài)修改
Remove #
CODE:
[Copy to clipboard]
#!/bin/sh

EDITOR=/bin/ed; export EDITOR
/bin/crontab -e <<EOF
1,$ s/^#*\([0-9]\)/\1/
w
EOF
Add #
CODE:
[Copy to clipboard]
#!/bin/sh

EDITOR=/bin/ed; export EDITOR
/bin/crontab -e <<EOF
1,$ s/^\([0-9]\)/#\1/
w
EOF

SDS故障盤的更換恢復
System information:
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 .

Error information:
metastat command display that logic devices at disk0 (c1t0d0s2) need maintenace .

solution:
replace the failed disk c1t0d0s2 (disk0)

procedure:
1.        gether system information
check the meta device state
        #metastat
        #metadb –i
check the slice location
        #format
        #more /vfstab
2.        reboot from mirror disk
you can create the alias previously
        ok nvalias disk1 /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0:a
        pathname listed here is not in a 880 server but from a test machine Ultra1
        ok setenv boot-device disk disk1
#reboot - - disk1
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:
        #metadb –d –f c1t0d0s4
then you can boot system
3.        replace hard disk (hot plug)
#luxadm remove_device /dev/rdsk/c1t0d0s2
while OK-to-Remove LED is lighting  physically pull up the error disk from disk bay and insert the new disk. Then use command
        #luxadm insert_device FCloop,s0
or
        #devfsadm –C
In the command luxadm enclosure_name can get by command
        #luxadm probe
Identify the new disk by compare the WWN number in the output of belowing command
        #format
        #ls –al /dev/rdsk/c1t0d0s2
4.        repair replica database
#prtvtoc /dev/rdsk/c1t1d0s2 | fmthard - /dev/rdsk/c1t0d0s2
#metadb –a –c 2 /dev/rdsk/c1t0d0s4
5.        resyncing the sub-mirrors
#metadetach d0 d10
#metadetach d1 d11
#metadetach d3 d13
#metadetach d5 d15
#metadetach d6 d16
#metadetach d7 d17
#metaclear d10 d11 d13 d15 d16 d17
#metainit d10 1 1 c1t0d0s0
#metainit d11 1 1 c1t0d0s1
#metainit d13 1 1 c1t0d0s3
#metainit d15 1 1 c1t0d0s5
#metainit d16 1 1 c1t0d0s6
#metainit d17 1 1 c1t0d0s7
#metattach d0 d10
#metattach d1 d11
#metattach d3 d13
#metattach d5 d15
#metattach d6 d16
#metattach d7 d17
#metastat |grep %
#reboot
#metastat

tricks:
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.
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.


開機時報warning:pcisch0:in0 0x16 has been blocked
            warning:usba10_ehcio:interrupt #0 has been blocked
Try a workaround.

1. Add a line to /etc/system

set pcisch:pci_unclaimed_intr_max=0x7fffffff

2. reboot
在SUN下用snoop抓包,看到如下內容,只有*** Header ,內部的DD在哪。
# snoop -v port 7777
# snoop -v -x 0 port 7777
所有root擁有的文件全部改為ROot,如何快速恢復?
find dir-path -user ROot -exec chown root {} \;

try

# crle -u
# ldd /usr/sbin/vxdg
# crle

If failed

# mv /var/ld/ld.config /var/ld/ld.config.old
# crle -u
# ldd /usr/sbin/vxdg
# crle

論壇徽章:
0
3 [報告]
發(fā)表于 2006-12-28 17:07 |只看該作者
SUN做路由器的辦法
1.在sunos中設置兩塊網(wǎng)卡pcn0(168.9.203.239)、pcn1(192.168.9.11)
# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 168.9.203.239 netmask fffffc00 broadcast 168.9.203.255
        ether 0:c:29:7d:3a:2a
pcn1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 192.168.9.11 netmask ffffff00 broadcast 192.168.9.255
        ether 0:c:29:7d:3a:34

2.修改/etc/hosts文件
127.0.0.1       localhost
168.9.203.239   sophia  loghost sophia.partner.com
192.168.9.11    partner

3.增加/etc/hostname.pcn1
partner


4.設置ip包轉發(fā)
# ndd -set /dev/ip ip_forwarding 1
# ndd -set /dev/ip ip_forward_directed_broadcasts 1
# ndd -set /dev/ip ip_forward_src_routed 1

修復4800CPU的軟錯誤
Please kindly help to check about this:

SC> showcomponent -d a

Component           Status   Pending  POST   Description
---------           ------   -------  ----   -----------
/N0/SB0/P0          enabled  -        pass   UltraSPARC-III+, 1050MHz,
8M ECache
/N0/SB0/P1          enabled  -        pass   UltraSPARC-III+, 1050MHz,
8M ECache
/N0/SB0/P2          enabled  -        pass   UltraSPARC-III+, 1050MHz,
8M ECache
/N0/SB0/P3          enabled  -        pass   UltraSPARC-III+, 1050MHz,
8M ECache
/N0/SB0/P0/B0/L0    enabled  -        pass   512M DRAM
/N0/SB0/P0/B0/L2    enabled  -        pass   512M DRAM
/N0/SB0/P0/B1/L1    enabled  -        pass   512M DRAM
/N0/SB0/P0/B1/L3    enabled  -        pass   512M DRAM
/N0/SB0/P1/B0/L0    enabled  -        pass   512M DRAM
/N0/SB0/P1/B0/L2    enabled  -        pass   512M DRAM
/N0/SB0/P1/B1/L1    enabled  -        pass   512M DRAM
/N0/SB0/P1/B1/L3    enabled  -        pass   512M DRAM
/N0/SB0/P2/B0/L0    enabled  -        pass   512M DRAM
/N0/SB0/P2/B0/L2    enabled  -        pass   512M DRAM
/N0/SB0/P2/B1/L1    enabled  -        pass   512M DRAM
/N0/SB0/P2/B1/L3    enabled  -        pass   512M DRAM
/N0/SB0/P3/B0/L0    enabled  -        pass   512M DRAM
/N0/SB0/P3/B0/L2    enabled  -        pass   512M DRAM
/N0/SB0/P3/B1/L1    enabled  -        pass   512M DRAM
/N0/SB0/P3/B1/L3    enabled  -        pass   512M DRAM
/N0/SB2/P0          disabled -        chs    UltraSPARC-III+, 1050MHz,
8M ECache
/N0/SB2/P1          disabled -        chs    UltraSPARC-III+, 1050MHz,
8M ECache
/N0/SB2/P2          disabled -        chs    UltraSPARC-III+, 1050MHz,
8M ECache
/N0/SB2/P3          disabled -        chs    UltraSPARC-III+, 1050MHz,
8M ECache
/N0/SB2/P0/B0/L0    disabled -        chs    512M DRAM
/N0/SB2/P0/B0/L2    disabled -        chs

If the SB4 is disabled, please check the col named POST of SB4, if it is
chs, please help to check:

SC> showcomponent -v SB4
SC> showerrorbuffer

and then enter service mode:
SC> service
The use of service commands can be destructive and destabilize the system.
Use of service mode is authorized only by personnel trained in its use.

Enter Password:        gGmmlHslPK


SC[service]> showchs -b
....
SC[service]> setchs -r "enable brd" -s ok -c  sb4

and then please poweroff domain A by setkeyswitch off, after the domain A power off, please power it on and do max POST.
usb鍵盤上用STOP+N是沒用的,應該按照以下步驟來恢復NVRAM到缺省值:
1. After turning on the power to your system, wait until the front panel power indicator
LED begins to blink and you hear an audible beep.
2. Quickly press the front panel power switch twice (similar to the way you would
double-click a mouse).

1.創(chuàng)建NAFO 組
# pnmset -c nafo-group -o create adapter [adapter ...]
-c nafo-group 對指定的NAFO 組執(zhí)行配置子命令。必須將NAFO 組命
名為nafoN,其中N 是一個非負的整數(shù),用來標識該組。對每個節(jié)點而言,組名都是本地名稱。因而,同一NAFO 組名可在多個節(jié)點上使用。
-o create 創(chuàng)建新的NAFO 組。
adapter [ adapter ... ] 指定用作備份適配器的公共網(wǎng)絡適配器。

2.向NAFO 組添加適配器
# pnmset -c nafo-group -o add adapter
-c nafo-group 指定要添加新適配器的NAFO 組。
-o add adapter 指定要添加到指定的NAFO 組的公共網(wǎng)絡適配器。

3.如何刪除NAFO 組
要想能夠刪除NAFO 組,邏輯主機資源組或共享地址資源組不得使用該組。
1. 成為包含要刪除的NAFO 組的節(jié)點的超級用戶。
2. 確定是否有任何邏輯主機資源或共享地址資源正在使用NAFO 組。
# scrgadm -pv
您還可以使用scrgadm-pvv(帶有兩個v 標志)來確定那些正在使用將要刪除的NAFO 組的資源。
3. 切換使用該NAFO 組的邏輯主機資源組和共享地址資源。
# scswitch -z -g resource-group -h nodelist
-z -g resource-group 切換指定的資源組。
-h nodelist 指定要將資源組切換到的節(jié)點的名稱。
4. 刪除NAFO 組。
# pnmset -c nafo-group -o delete
-c nafo-group 指定要刪除的NAFO 組。
-o delete 刪除NAFO 組。
5. 檢驗該NAFO 組的狀態(tài)。
列表中不應出現(xiàn)已刪除的NAFO 組。
# pnmstat -l

示例— 切換NAFO 組的活動適配器
以下示例說明了將活動適配器從qfe0 切換到qfe1 的過程。
# pnmstat -l
group adapters status fo_time act_adp
nafo0 qfe0:qfe1 OK NEVER qfe0
# pnmset -c nafo0 -o switch qfe1
# mv /etc/hostname.qfe0 /etc/hostname.qfe1
# pnmstat -l
group adapters status fo_time act_adp
nafo0 qfe0:qfe1 OK 11 qfe
查找NAFO 組的活動適配器
# pnmptor nafo0
查找適配器的NAFO 組
# pnmrtop qfe5

4.如何更改公共網(wǎng)絡管理可調參數(shù)
/etc/cluster/pnmparams

inactive_time 當前活動適配器的包計數(shù)器在連續(xù)進行兩次探測之間的秒數(shù)。缺省值為5。
ping_timeout ALL_HOST_MULTICAST 和子網(wǎng)廣播ping 的超時值(以秒為單位)。缺省值為4。
repeat_test 在聲明活動適配器有故障并觸發(fā)故障轉移前執(zhí)行ping 序列的次數(shù)。缺省值為3。
slow_network 每次從執(zhí)行ping 序列之后到檢查包計數(shù)器以查看是否有任何更改之間所等待的秒數(shù)。缺省值為2。
warmup_time 從將故障轉移到備份適配器后到恢復故障監(jiān)視前所等待的秒數(shù)。此設置為慢速驅動程序或緩慢的端口初始化過程保留了額外的時間。缺省值為0。
光纖盤DD的恢復辦法。
dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 bs=8192k
     將你做好的DD盤換到原系統(tǒng)盤的位置。
ok boot cdrom –s
     mount /dev/dsk/c0t0d0s0 /mnt
     drvconfig –r /mnt –p /mnt/etc/path_to_inst
     cd /devices
     find . –print |cpio –pduVm /mnt/devices
     disks –r /mnt
     luxadm set_boot_dev /dev/dsk/c0t0d0s0
     init 0
     ok boot -r
ld.so.1文件損壞或丟失后系統(tǒng)怎樣恢復正常?
boot cdrom -s first,try to recover the system.
here is a document,may it can help.



實時連接器ld.so.1文件損壞或丟失后系統(tǒng)怎樣恢復正常?
前言:看到網(wǎng)上好多人遇到ld.so.1文件損壞或丟失,系統(tǒng)癱瘓詢問怎樣處理,為此我將這一故障現(xiàn)象進行歸納總結,供各位網(wǎng)友參考,希望從中得到幫助。

一、動態(tài)連接庫的概念
大家都知道,在WINDOWS系統(tǒng)中有很多的動態(tài)鏈接庫(以.DLL為后綴的文件,DLL即Dynamic Link Library)。這種動態(tài)鏈接庫,和靜態(tài)函數(shù)庫不同,它里面的函數(shù)并不是執(zhí)行程序本身的一部分,而是根據(jù)執(zhí)行程序需要按需裝入,同時其執(zhí)行代碼可在多個執(zhí)行程序間共享,節(jié)省了空間,提高了效率,具備很高的靈活性,得到越來越多程序員和用戶的青睞。
Solaris系統(tǒng)里面有些庫文件,當編譯的時候,如果把庫文件也編譯到文件中,那文件本身就可以執(zhí)行,但這樣的缺點是生成的文件十分大。所以很多情況下使用動態(tài)連接庫,就是編譯出的文件不包含庫,而只包含到庫的指針,這樣在運行的時候會到指定的地方調用這個庫,這樣就減少了文件的大小。Solaris包含的實時連接器ld.so.1,就是動態(tài)對象的運行階段鏈接程序。

從下面的的命令中,我們可以列出可執(zhí)行文件或者共享對象的動態(tài)從屬關系,這玩意沒了,你的什么ls,cd什么的命令就都費了,如果ld.so.1文件被破壞了,系統(tǒng)肯定無法正常啟動。

/usr/bin/ldd [filename]
/* List the dynamic dependencies of executable files */

# /usr/bin/ldd /usr/bin/cat
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
# ldd /usr/bin/ls
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
# ldd /usr/bin/cp
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1

二、ld.so.1文件損壞或丟失解決的辦法

1.如果意外的/usr/lib/ld.so.1損壞或丟失,系統(tǒng)沒有正常啟動的情況下:
執(zhí)行命令都會出現(xiàn)錯誤信息:
#reboot
Reboot :can not find /usr/lib/ld.so.1
#find
Find: /usr/lib/ld.so.1
#ls
Ls: can not find can not find

這時,千萬不要重啟動,立即用/usr/sbin/static/mv、/usr/sbin/static/cp命令恢復 :

#/sbin/static/cp /etc/lib/ld.so.1 /usr/lib/
經過實驗,系統(tǒng)恢復正常!這時,你試試如下命令,就能體會到為什么了。
---------------------------------------------------------------------------
# ls /usr/sbin/static
cp* ln* mv* rcp* tar*
SUN的工程師非常聰明,為了防備了這個情況, 做了以上幾個不使用動態(tài)連接庫的命令
#find / -name ld.so.1 -print
/usr/lib/sparcv9/ld.so.1
/usr/lib/ld.so.1
/etc/lib/ld.so.1
blade% ls -ld /usr/lib/sparcv9/ld.so.1
-rwxr-xr-x 1 root bin 191672 Jul 28 2001 /usr/lib/sparcv9/ld.so.1
blade% ls -ld /usr/lib/ld.so.1
-rwxr-xr-x 1 root bin 196852 Jul 28 2001 /usr/lib/ld.so.1
blade% ls -ld /etc/lib/ld.so.1
-rwxr-xr-x 1 root bin 196852 Jul 28 2001 /etc/lib/ld.so.1
---------------------------------------------------------------------------
從上面的,我們又可以看到,這個庫文件,不僅僅在/usr/lib有,在/etc/lib、/usr/lib/sparcv9/下也有,所以你就重新在本機上拷貝一份就行了。這些信息在這個連接庫不正常的情況下是看不到的。

2.如果意外的/usr/lib/ld.so.1損壞或丟失,系統(tǒng)啟動的情況下:
錯誤信息:
Uname:can not find /usr/lib/ld.so.1
Loadkeys: can not find /usr/lib/ld.so.1
Killed
Cfsfstype: can not find /usr/lib/ld.so.1
Expr: can not find /usr/lib/ld.so.1
Swap: can not find /usr/lib/ld.so.1
Killed
Fsck: can not find /usr/lib/ld.so.1
Killed

這時,用光盤啟動到單用戶下:
ok boot cdrom -s (放入啟動安裝光盤)
#mount /dev/dsk/c0t0d0s0 /mnt (這里指定原usr目錄對應的原始設備名)
# cp /mnt/etc/lib/ld.so.1 /mnt/lib/(就是將/usr/etc下的這個文件拷貝到/usr/lib下。)
系統(tǒng)重新啟動,一切正常!

3.如果/usr被改名了情況下,怎么辦?
假設/usr改名成了/faint,系統(tǒng)沒有啟動
馬上執(zhí)行
#/faint/sbin/static/mv /faint /usr

假設/usr改名成了/faint,系統(tǒng)重新啟動,這時肯定不能正常啟動,同樣我們啟動到單用戶下:
ok boot cdrom -s (放入啟動安裝光盤)
mount /dev/dsk/c0t0d0s0 /mnt (這里指定原usr目錄對應的原始設備名)
mv /mnt/faint /mnt/usr

建議把/usr/sbin/static下的東西拷一份到/sbin下或者其它比較可信的跟/在同一個文件系統(tǒng)下的目錄下。以備系統(tǒng)不測.

之后,我又進行了多次實驗,各個版本系統(tǒng)下的/usr/lib/ld.so.1文件互相兼容。所以也可以從其他機器拷貝過來。

論壇徽章:
0
4 [報告]
發(fā)表于 2006-12-28 17:17 |只看該作者
總結的不錯.收藏了.希望樓主可以幫更多的發(fā)出來.

論壇徽章:
2
雙魚座
日期:2014-02-23 12:10:03操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-12-17 06:20:00
5 [報告]
發(fā)表于 2006-12-28 21:37 |只看該作者
不錯,收藏啦!

論壇徽章:
0
6 [報告]
發(fā)表于 2006-12-28 21:45 |只看該作者
留下了

論壇徽章:
0
7 [報告]
發(fā)表于 2006-12-29 10:29 |只看該作者
路過`````撿走了`````

論壇徽章:
0
8 [報告]
發(fā)表于 2006-12-29 10:38 |只看該作者
收藏了再看,頂頂

論壇徽章:
0
9 [報告]
發(fā)表于 2006-12-29 14:44 |只看該作者
收藏,先?礃祟}是“SUN相關的問題的整理和匯總(1)”,關注2、3、……

論壇徽章:
0
10 [報告]
發(fā)表于 2006-12-29 15:02 |只看該作者
這個貼發(fā)的確實有水平呀  。 很經典 。也是收下了 。嘿嘿。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP