Chinaunix首页 | 论坛 | 博客
  • 博客访问: 566664
  • 博文数量: 113
  • 博客积分: 3322
  • 博客等级: 少校
  • 技术积分: 1565
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-04 11:38
文章分类

全部博文(113)

文章存档

2012年(21)

2010年(92)

分类: 系统运维

2012-11-08 01:31:21

VRTS-raid5卷不能启动    

# vxvol -g userdg2 stop v21
# vxprint -g userdg2 -ht
# vxvol -g userdg2 -f start v21
如果不行,
# vxplex -g userdg2 -o rm dis v21-02
# vxvol -g userdg2 start v21
# vxassist -g userdg2 addlog v21 userdg201

DETACHED REPLAY修复方法:
                enters this state during a log replay.
                        if the log replay dies with signal 10 or 11
                        run these commands.
                        vxplex -f -o rm dis
                        vxassist -g addlog
                        vxvol -g start

 

 

 

1M)是什么意思呢?

number 1~9 stands for different section of the manuals, 1 and 1M usually means commands,often you will use  such command to get what your need: "man 1 drvconfig" .

1: User Commands
1M: System Administration Commands
2: System Calls
3: Library Interfaces and Headers
3: Basic Library Functions
3: Networking Library Functions
3: Threads and Realtime Library Functions
3: Extended Library Functions
3: Curses Library Functions
4: File Formats
5: Standards, Environments, and Macros
6: Demos   [Download this Book]
7: Device and Network Interfaces
9: DDI and DKI Overview
9F: DDI and DKI Kernel Functions
9S: DDI and DKI Data Structures

 

 

 

 

关于提示符请教

.profile加入
ccd()
{
cd $1
PS1="`id |cut -d '(' -f2|cut -d ')' -f1' '`@`uname -n``pwd`>"
}
alias cd=ccd

 

 

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.

 

 

如何在主机中看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.)

 

 

 

 

如何查看系统中安装了哪些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"

 

 

solaris怎么样查看一个文件是哪个包安装出来的?

pkgchk -lp yourfilename

 

请教一个双控制器连接服务器的问题

要做冗余,当然要对2个端口做map
SOLARIS
中自己就带有multi path功能。修改/kernel/drv/scsi_vh*.conf,将mpxio_disable打开

 

如何实现文件的即时监控?

可能徐对文件做校验,并比较,

如用Solaris 10里有cksum,可比较文件变化前后的校验,如校验Solaris 10 DVD光盘media文件:

# cksum solarisdvd.iso                  
3842565141      3133603840      solarisdvd.iso

Solaris 10
里还有BARTBasic Auditing and Reporting Tool,校验目录,帮助快速可靠的检查已部署的系统,创建已配置好的系统上的文件列表manifest,在系统上发现文件一级的改变,所以在配置好系统后应尽快建立系统或关键目录的文件列表manifest,并按系统的变化经常更新,如校验/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 动态修改

Remove #

CODE:

#!/bin/sh

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

Add #

CODE:

#!/bin/sh

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

 

 

 

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

 

我在solarse下面uncompress 一个45g大小的文件,刚开始都是执行的,
但是大概到了半个小时后,uncompresscpu值就降低下来了,但是进程又不结束

1.    Check what happened for uncompress process by truss ( sleeping? )

2. Install patch 116245-01 for Solaris 9

SUN下用snoop抓包,看到如下内容,只有*** Header ,内部的DD在哪啊?
# snoop -v port 7777

# snoop -v -x 0 port 7777

 

 

T3阵列的datadg导入之后
vxprint -ht
显示
v  trunk001     gen          DISABLED ACTIVE   4194304  SELECT    -
pl trunk107-01  trunk107     DISABLED ACTIVE   4200448  CONCAT    -        RW
sd disk01-108   trunk107-01  disk01   487194624 4200448 0         c2t1d0   ENA
... ...
... ...

v  trunk107     gen          DISABLED ACTIVE   4194304  SELECT    -
pl trunk107-01  trunk107     DISABLED ACTIVE   4200448  CONCAT    -        RW
sd disk01-108   trunk107-01  disk01   487194624 4200448 0         c2t1d0   ENA
~~~~~~~~~~~~~~~~~~~~~~~~~~~
请问以上是代表什么意思

v  vol01        fsgen        DISABLED  ACTIVE   41943040 SELECT    -
pl vol01-01     vol01        ENABLED  ACTIVE   41947136 CONCAT    -        RW
sd disk01-01    vol01-01     disk01   0        41947136 0         c2t1d0   ENA

# vxrecover -g datadg -sb

 

 

 

 

使用priocntl命令可以:
显示或设置指定进程的调度参
显示系统调度程序的当前配置信息
执行带有指定调度参数的命令
每个进程都有不同的级,每级分配有各自不同的调度策略。
系统可能配置的级包括:
系统(SYS)
交互(IA)
实时(RT)
分式共享(TS)
对于分式共享级,用户提供的优先权范围为:-20~+20。一个
分时共享进程的优先权(用户模式优先权)是从父进程继承
而来。系统在分时调度表中查找用户模式优先权,加入任何
nice
值或这者priocntl优先权值(用户提供),保证创建的全
局优先权在0~59之间。
在默认配置中,一个可运行的实时进程在任何其它进程之前运行。实时进程使用不当会导致系统性能急剧下降。
1.
显示进程级的基本信息(进程级或系统调度参数):
输入priocntl -l并回车
2.
显示进程的全局优先级
使用ps -ecl命令显示进程的全局优先权。全局优先权在PRI栏列出
3
、指定进程的优先级:
输入priocntl -e -c class -m user -limit -p priority command - name回车
-e
执行命令
-c
指定级(默认选项是TS(分时共享)或RI(实时)
-m
用户限制选项,指定-p选项提升或降低优先权的最大量。
-p
允许指定用户提供的优先权,范围为-20~+20

4.
更改分时共享进程的调度参数
依照以下步骤更改分时共享进程的调度参数:
1
)成为超级用户。
2
)输入priocntl -s -m user -limit [-p priority] -i id type id -list回车。
-s
允许设置用户优先权范围的上限
-m
用户限制选项,指定-p选项提升或降低优先权的最大量。
-p
优先权命令名选项,允许指定优先权。
-I id -type
id -list选项使用id -typeid -list的组合标识进程, id -
type
指定id类型,如PIDUID
3
)输入ps -ecl|grep id -list回车。
4
)检查PRI栏的输出,验证已经成功地更改了进程状态。
% priocntl -s -c RT -t 500 -p 20 myprog
% ps -ecl|grep myprog

5.
更改进程
依照以下步骤更改进程级:
1
)成为超级用户。
2
)输入priocntl -s -c class -i id type id -list回车。
-s
允许设置用户优先权范围的上限并更改优先权
-c
指定想更改的进程级为TS(分时共享)级或RI(实时)级
-I id -type
id -list选项使用id -typeid -list的组合标识进程, id -type指定id
类型,如PIDUID
3
)输入ps -ecl|grep id -list回车。
4
)检查PRI栏的输出,验证已经成功地更改了进程状态。
注意:必须是超级用户或者在实时shell中操作,更改进程级为非实时级或者实时级。

6
、更改进程优先级
使用nice命令可以提高或降低一个命令或进程的优先权。
不带参数使用该命令则默认nice值增4个单位,使进程优先
权降低。
注意:必须是超级用户才能。
/usr/bin/nice command -name(
默认,进程的优先权降低4个单位)
/usr/bin/nice +10 command -name
(进程的优先权降低10个单位)
/usr/bin/nice -10 command -name
(进程的优先权增加10个单位)
/usr/bin/nice - -10 command -name
nice 值减少10个单位,提高一个命令的优先权)

 

 

所有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

 

 

 

 

[原创]
ufsdump and ufsrestore ,
刚开始用的时候都以为他就是用来备份的(TAPE),最近由于我们公司有几十台服务器要装,由于HDD又不一样大,所以觉得用DD太浪费了(72G变成了36G),于是就想到用UFSDUMP来试试。
具体方法为:
1
。首选将你需要的HDD放在SERVER中,启动后,看一下分区表,大体上相同就可以,不能比第一个HDD的分区大小小。
2
。用NEWFS命令将分区好的HDD都给初始化一下,newfs /dev/dsk/c0t1d0s0 .....
3
。这时准备用了,
    mount /dev/dsk/c0t0d0s0 /mnt
      ufsdump 0f - /dev/dsk/c0t0d0s0|(cd /mnt; ufsrestore rf -)
      
等到执行完了后,表示这个分区就同步了。
     umount /mnt
      
再用ufsdump 将其它的分区同步就可以了。
4
。重要的一步是,在做完这些后,新的HDD是不能启动的,因为启动分区中是没有内容的,所以就需要用到
   installboot
     
用法为: installboot /usr/platform/'uname -i'/lib/fs/ufs/bootblk  /dev/rdsk/c0t0d0s0
     
注意此处的/dev/rdsk/c0t0d0s0 RDSK 不能用DSK
5
。重起就可以了。
这样就会很方便,希望对大家有帮助。

 

 

 

 

下面是我测试过的,可用
1.
sunos中设置两块网卡pcn0(168.9.203.239)pcn1(192.168.9.11)
# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
pcn0: flags=1000843 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 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包转发
# 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


5.
在客户端(16 设置网关为168.9.203.239
  
在客户端(192)设置网关为192.168.9.11
这样就可以通过sun机器访问不同网段了。

 

 

 

kill -9 $(ps -ef | grep username | awk '{print $3}')

 

 

对你的问题的比较赶兴趣.
可以把PING之间的路由表,PING之后的路由表给大家共享一下?

还有最好对照一下PING前后的Cache内容:
ndd -get /dev/ip ipv4_ire_status

如果没发现什么问题,就继续查交换机吧.

 

 

在两台主机加上如下文件  格式如下    加完后 两边都重起  在做METASET      前不久刚有人问过我 呵呵
vi /var/run/nodelist

1   host1 172.16.193.1
2   host2 172.16.193.2

 

 

 

 

powermt display dev=all可以显示native设备与pseudo设备之间的对应关系!

 

$ sqlplus /nolog

 

SQL*Plus: Release 8.1.7.0.0 - Production on Thu Dec 8 16:05:28 2005

 

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

 

SQL> connect /as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

 

Total System Global Area  283291324 bytes

Fixed Size                   102076 bytes

Variable Size             215015424 bytes

Database Buffers           67108864 bytes

Redo Buffers                1064960 bytes

Database mounted.

Database opened.

SQL> exit

 

 

 

这个问题我遇到过了,你肯定是在跑POST或者系统运行过程的时候强行使用setkeyswitch off或者poweroff all中断了.
SUN 800
那边给过我一个解决办法,但是那个passwd是不是所有机器都通用我就不知道了!!
可以试一下,不行的话打800!!


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.

 

 

TRAP 3E
Cause

The Ultra system fails to boot with TRAP 3E. The system sometimes also displays bad magic number errors.

This error is caused by a bad super block on the boot disk. Which, in turn, could have been caused by a SCSI configuration problem.
Action

To fix:

   1.

      Check the SCSI bus for illegal configuration, bad cables, and duplicate SCSI addresses.
   2.

      Boot from CD-ROM as single user.

      OK boot cdrom -sw

   3.

      Attempt to fsck(1M) boot disk. This could fail with a super block error.

      # fsck /dev/rdsk/device

   4.

      Find the locations of alternate super blocks. BE SURE TO USE AN UPPERCASE -N. For example:

      # newfs -N /dev/rdsk/c0t0d0s0
      /dev/rdsk/c0t0d0s0:     2048960 sectors in 1348 cylinders of 19 tracks,
      80 sectors 1000.5MB in 85 cyl groups (16 c/g, 11.88MB/g, 5696 i/g)
      super-block backups (for fsck -F ufs -o b=#) at:
      32, 24432, 48832, 73232, 97632, 122032, 146432, 170832, 195232, 219632,
      244032, 268432, 292832, 317232, 341632, 366032, 390432, 414832, 439232,
      463632, 488032, 512432, 536832, 561232, 585632, 610032, 634432, 658832,
      683232, 707632, 732032, 756432, 778272, 802672, 827072, 851472, 875872,
      900272, 924672, 949072, 973472, 997872, 1022272, 1290672, ...

   5.

      Using an alternate super block, run fsck(1M) on the disk. You might have to try more than one alternate super block to make this to work. Pick a couple from the beginning, the middle, and the end.

      # fsck -o b= /dev/rdsk/c0t0d0s0

   6.

      The boot block is probably bad too. Restore it while you are booted from the CD-ROM.

      # /usr/sbin/installboot /usr/platform/architecture/lib/fs/ufs/bootblk
      /dev/rdsk/c0t0d0s0

   7.

      Reboot the operating environment.

      # reboot

 

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).

 

 

 

# luxadm probe
# luxadm display Logical Path
# luxadm -e dump_map node_wwn

 

 

 

这么复杂啊,IPMP管理的公共网络,怎么说视心跳问题呢?心跳是由cluster去管理的,再安装的时候就会选择配置的啊!

给你一个我配的IPMP,可以参考一下:
1) ok setenv local-mac-address?  true
2)
使用vi编辑器修改hosts文件,在/etc/hosts文件中,增加双机中另一节点的机器名和IP地址,以方便双机之间的访问。
scha1hosts文件中增加行:
#vi /etc/hosts
   127.0.0.1       localhost
   156.36.16.37   scha1   loghost          
   156.36.16.38   ce0test                
   156.36.16.39   ce2data                
   156.36.16.40   ce2test                
   156.36.16.41   scha2                  
   156.36.16.45   ha-ora-lh              
scha2hosts文件中增加行:
   #vi /etc/hosts
    127.0.0.1       localhost
    156.36.16.41   scha2   loghost          
    156.36.16.42   ce0test                
    156.36.16.43   ce2data                
    156.36.16.44   ce2test                
    156.36.16.37   scha1                  
    156.36.16.45   ha-ora-lh  
3).
配置主备双机的IP多路径
对外公布的IP地址为:156.36.16.45
双机中每台主机有4块网卡ce0ce1ce2ce3,规定ce0ce2作数据网卡,互为主备用。两个网卡的逻辑组名要求一致,这里组名是abc  
   
ce0链路出现问题时,ce1自动生成一个ce1:1的逻辑网卡,其IP地址为ce0IP地址,ce0恢复正常后,ce1:1 自动撤消,ce0仍然使用原来的IP地址。同理,当ce1链路出现问题时,ce0:1接替ce1工作,保证了网络使用的可靠性。(注意,该处的所有的IP地址要求处于同一网段,

在主机scha1上使用vi编辑器编辑/etc/hostname.ce0/etc/hostname.ce1两个文件,具体操作如下:
#vi /etc/hostname.ce0  
  scha1 group abc up \
  addif ce0test -failover deprecated up
  #vi /etc/hostname.ce2  
  ce2data group abc up \
  addif ce2test -failover deprecated up
在主机scha2上使用vi编辑器编辑/etc/hostname.ce0/etc/hostname.ce1两个文件,具体操作如下:
#vi /etc/hostname.ce0  
  scha2 group abc up \
  addif ce0test -failover deprecated up
  #vi /etc/hostname.ce2  
  ce2data group abc up \
  addif ce2test -failover deprecated up
4)
在双机上使用vi编辑器修改/kernel/drv/scsi_vhci.conf文件,具体操作步骤如下:
#vi /kernel/drv/scsi_vhci.conf  
将以下行:
mpxio-disable="yes"
修改为:
mpxio-disable="no"
5.
修改/etc/system,添加ce网卡bug修正参数:
set ce:ce_reclaim_pending=1
set ce:ce_taskq_disable=1

 

 

IPMPSolaris 8
(01/01)
开始就已经成为Solaris的标准配置了,所以大家都可以用,对于这些新的feature,大家不要客气啊,不用白不用啊!
下面就用配置文件的方式来配置IPMP,假设如下:
multipathing test IP 10.170.1.81
测试地址1
multipathing test IP 10.170.1.82
测试地址1
Logical IP 10.170.1.80
逻辑地址,这是我们访问的地址
Group Name mswitch
这个名字,随便取的
Network Card ce0,ce1

1
、首先更改hosts文件
#vi /etc/hosts
10.170.1.80 host1 loghost

10.170.1.81 host1-1
10.170.1.82 host1-2

2
、然后创建文件hostname.ce0 , hostname.ce1
#vi /etc/hostname.ce0
host1 group mswitch up
addif host1-1 -failover deprecated up

#vi /etc/hostname.ce1
host1-2 group mswitch -failover deprecated up

3
、重新启动计算机,就可以了
#reboot

4
after reboot , you can use ifconfig -a to view the configure
information.
#ifconfig -a
做做测试,看看会不会failover!

 

 

创建NAFO
# pnmset -c nafo-group -o create adapter [adapter ...]
-c nafo-group
对指定的NAFO 组执行配置子命令。必须将NAFO 组命
名为nafoN,其中N 是一个非负的整数,用来标识该组。对每个节点而言,组名都是本地名称。因而,同一NAFO 组名可在多个节点上使用。
-o create
创建新的NAFO 组。
adapter [ adapter ... ]
指定用作备份适配器的公共网络适配器。

2.
NAFO 组添加适配器
# pnmset -c nafo-group -o add adapter
-c nafo-group
指定要添加新适配器的NAFO 组。
-o add adapter
指定要添加到指定的NAFO 组的公共网络适配器。

3.
如何删除NAFO
要想能够删除NAFO 组,逻辑主机资源组或共享地址资源组不得使用该组。
1.
成为包含要删除的NAFO 组的节点的超级用户。
2.
确定是否有任何逻辑主机资源或共享地址资源正在使用NAFO 组。
# scrgadm -pv
您还可以使用scrgadm-pvv(带有两个v 标志)来确定那些正在使用将要删除的NAFO 组的资源。
3.
切换使用该NAFO 组的逻辑主机资源组和共享地址资源。
# scswitch -z -g resource-group -h nodelist
-z -g resource-group
切换指定的资源组。
-h nodelist
指定要将资源组切换到的节点的名称。
4.
删除NAFO 组。
# pnmset -c nafo-group -o delete
-c nafo-group
指定要删除的NAFO 组。
-o delete
删除NAFO 组。
5.
检验该NAFO 组的状态。
列表中不应出现已删除的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.
如何更改公共网络管理可调参数
/etc/cluster/pnmparams

inactive_time
当前活动适配器的包计数器在连续进行两次探测之间的秒数。缺省值为5
ping_timeout ALL_HOST_MULTICAST
和子网广播ping 的超时值(以秒为单位)。缺省值为4
repeat_test
在声明活动适配器有故障并触发故障转移前执行ping 序列的次数。缺省值为3
slow_network
每次从执行ping 序列之后到检查包计数器以查看是否有任何更改之间所等待的秒数。缺省值为2
warmup_time
从将故障转移到备份适配器后到恢复故障监视前所等待的秒数。此设置为慢速驱动程序或缓慢的端口初始化过程保留了额外的时间。缺省值为0

文件方式:
IP
配置方式
hosts
文件
#
# Internet host table
#
127.0.0.1       localhost
10.0.2.1        WEB1-test1
10.0.2.2        WEB1-test2
10.0.2.3        WEB1-data1      WEB1-data1.mbox.monternet.com   WEB1    loghost
10.0.2.4        WEB1-data2      WEB1-data2.mbox.monternet.com

root@WEB1 # ls host*
hostname.eri0  hostname.hme0  hosts

hostname.eri0
文件
WEB1-data1 netmask + broadcast + group web1 failover up \
addif WEB1-test1 netmask + broadcast + deprecated -failover up

hostname.hme0
文件
WEB1-data2 netmask + broadcast + group web1 failover up \
addif WEB1-test2 netmask + broadcast + deprecated -failover up

IP
配置方式
hostname.qfe1
文件
db1data netmask + broadcast  + group dbt1  failover up \
addif db1test1 netmask + broadcast + deprecated -failover up
hostname.qfe2
文件
db1test2 netmask + broadcast + group dbt1  deprecated  -failover standby up

命令行方式:
IP
配置方式
# ifconfig qfe1 plumb 192.2.0.6  netmask + broadcast + group dbt2 failover up \
addif 192.2.0.4 netmask + broadcast + deprecated -failover up

# ifconfig qfe2 plumb 192.2.0.7  netmask + broadcast + group dbt2 failover up \
addif 192.2.0.5 netmask + broadcast + deprecated -failover up

其中 192.2.0.4 192.2.0.5 为测试IP 192.2.0.6 192.2.0.7 为浮动IP

IP
配置方式
# ifconfig qfe1 plumb 192.2.0.6  netmask + broadcast + group dbt2 failover up \
addif 192.2.0.4 netmask + broadcast + deprecated -failover up

# ifconfig qfe2 plumb 192.2.0.5 netmask + broadcast +  group dbt2 deprecated -failover standby up

其中 192.2.0.4 192.2.0.5 为测试IP 192.2.0.6 为浮动IP

 

DETACHED REPLAY修复方法:
                enters this state during a log replay.
                        if the log replay dies with signal 10 or 11
                        run these commands.
                        vxplex -f -o rm dis
                        vxassist -g addlog
                        vxvol -g start

1boot -s
2
fcsk root file system
3
rm /dev/null
     rm /dev/null
4
re-create /dev/null link
     ln -s /devices/pseudo/mm@0:null /dev/null
5
reboot system

metaset建立的磁盘怎么删除

#metaset -s dg-schost -d -h sol1 sol2

metaset: sysb: setname "dg-schost": no such set

#metaset  -s -P   
还是不行
metaset: sol1: setname "dg-schost-3": no such set

我注意到sysbsol1两个主机名

如果是你更改过主机名了,按顺序执行下面几条命令看看能不能行:
metaimport -r
metaimport -r -v
metaimport -n -s
metaimport -s

# metaset -s -f -C take
# mount

 

Maintaining File Systems

1. On slice 3, conduct a file system check. Notice that we used the directory name and not the raw device. How is this possible. You can use a directory name or block device if it is cross-referenced to a raw device in /etc/vfstab.



#umount /export/home

#fsck /export/home

2. Remember that block 32 is the Superblock. We want to delete the Superblock and run a file system check. Do you get an error?



#dd if=/dev/zero of=/dev/dsk/c0t0d0s3 count=32 bs=512

#fsck /dev/rdsk/c0t0d0s3

3. Since you were advised to use an alternate Superblock you must specify an alternate Superblock. You can use the newfs ?N command to display all Superblocks in a file system.



#newfs ?N /dev/rdsk/c0t0d0s3

#fsck ?o b=32 /dev/rdsk/c0t0d0s3

4. Run the file system check one more time to ensure that the Superblock was repaired.



#fsck /export/home

5. Now we want to create a new directory called inode.



#mkdir inode

6. Mount the file system on slice 6.



#mount /dev/dsk/c0t0d0s6 /inode

#mount

7. Copy the contents of the /usr/lib/locale/iso_8859_1 directory into the inode directory.



#cp ?r /usr/lib/locale/iso_8859_1 /inode

#cd inode

#ls

8. Use the ff command to create a list of inodes and their file names in a file called inode file in the /tmp directory. Once complete determine the inode of the /inode/iso_8859_1 directory. Ensure you write down the inode.



#ff /dev/dsk/c0t0d0s6 > /tmp/inodefile

#ls ?ldi /inode/iso_8859_1

Inode number:


9. Change to the root directory and umount the inode directory.



#umount /inode

10. Use the clri command to clear the inode associated with the iso_8859_1 directory in the inode directory.



#clri /dev/rdsk/c0t0d0s6 [inode_#]

11. Run the fsck command and not how many inodes that fsck wants to remove. Answer yes to all prompts.



#fsck /dev/rdsk/c0t0d0s6

Number of inodes that fsck removed:

12. Mount the inode file system and attempt to access the file system. You should not be able to access or find the directory. The directory was removed, but where was it placed?



#mount /dev/dsk/c0t0d0s6 /inode

#cd /inode

#ls ?l

13. Look in the lost and found directory in the inode directory. What did you find? Use the /tmp/inodefile to compare the file in lost+found with the /tmp/inode file.



#cd /inode

#cd lost+found

#ls ?l

#cat /tmp/inodefile






14. Replace the files in lost+found into the /inode directory. First you must create the directory and then move the files.



#cd /inode

#mkdir iso_8859_1

#cd /inode/lost+found

#mv ?[#inode]? iso_8859_1.so.2

#mv ?[#inode]? LC_CTYPE

#mv ?[#inode]? sparcv9

#mv iso_8859_1.so.2 LC_CTYPE sparcv9 /inode/ iso_8859_1

15. Once complete, change to the root directory and umount the file system. Once complete, delete the inode directory and it?s content前天,因为我在solaris中打补丁,导致了sendmail无法发邮件到外网,我以为是dns出问题了,原来只有一个主dns,所以重新配置了一下。
Bind
# /usr/sbin/in.named -v
in.named BIND 8.2.2-P5 Mon Apr 12 05:38:46 PDT 2004
Generic Patch-5.8-April 2004
dns配置文件如下
Named.conf
# more named.conf
options {
directory "/var/named";
};

zone "0.0.127.in-addr.arpa" in {
type master;
file "db.local";
};

zone "." in {
type hint;
file "db.cache";
};

zone "mnu.edu.cn" in {
type master;
file "db.mnu.edu.cn";
};

zone "152.41.210.in-addr.arpa" in {
type master;
file "db.152.41.210";
};

zone "94.139.61.in-addr.arpa" in {
type master;
file "db.94.139.61";
};

Zone文件配置(db.mnu.edu.cn)只写一个,其它的类似
# more db.mnu.edu.cn
; Created Wed Apr 7 20:15:00 CST 2004 by services/ns-admin
; from
;
@ IN SOA pridns.mnu.edu.cn. root.mnu.edu.cn. (
3992954999 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ) ; min ttl

mnu.edu.cn. IN NS pridns ;primary
mnu.edu.cn. IN MX 10 second
mnu.edu.cn. IN NS second ;secondary 1

mnu.edu.cn. IN A 210.41.152.10
mnu.edu.cn. IN A 210.41.152.5
www IN A 61.139.94.206
jwc IN A 61.139.94.205
lib IN A 61.139.94.204
second IN A 210.41.152.5
pridns IN A 210.41.152.10
mail IN CNAME second

dns配置
Named.conf

# more named.conf
options {
directory "/var/named";
};

zone "0.0.127.in-addr.arpa" in {
type master;
file "db.local";
};

zone "." in {
type hint;
file "db.cache";
};

zone "mnu.edu.cn" in {
type slave;
file "mnu.edu.cn.backup";
masters {
210.41.152.10;
};
};

zone "152.41.210.in-addr.arpa" in {
type slave;
file "152.41.210.backup";
masters {
210.41.152.10;
};
};

zone "94.139.61.in-addr.arpa" in {
type slave;
file "94.139.61.backup";
masters {
210.41.152.10;
};
};

配置时要注意以下几点
首选要保证主dns在启动时没有错误发生。可看/var/adm/messages文件的记录信息。
1.辅dns配置时,需要从主dns传送的zonetype类型为slave,注意下面zone "94.139.61.in-addr.arpa" in {
type slave;
file "94.139.61.backup";
masters {
210.41.152.10;
};
};

表示辅dns 94.139.61.in-addr.arpa zone是从主dns传送过来,文件名为94.139.61.backupydns的地址是210.41.152.10。这里是masters不是master不然辅dns启动会报错如下:.

Jul 23 11:27:37 second named[178]: [ID 295310 daemon.error] no 'masters' stateme
nt for non-master zone '152.41.210.in-addr.arpa'

我就在这里出问题了,找了很久没有找到错误。
2.不需要从主dns传送的,type类型为masterZone文件需要自己手工建立。
3.主dnszone文件内一定要有辅dnsns记录及A记录,这点非常重要,我有找这个问题是花了不少时间的。
dns会报错:
Jul 23 11:32:28 pridns named[174]: [ID 295310 daemon.warning] master zone "mnu.e
du.cn" (IN) rejected due to errors (serial 2992953982)
dns会报错如下:
Jul 23 11:27:37 second named-xfer[481]: [ID 364785 daemon.notice] [210.41.152.10
] not authoritative for mnu.edu.cn, SOA query got rcode 0, aa 0, ancount 1, auco
unt 0

4.在主反向zone文件内一定要有@ IN NS pridns.mnu.edu.cn
不然主dnszone文件会传送不到辅dns中去,且会在主dns日志文件内出现在如下信息,.

Jul 20 10:33:52 pridns named[181]: [ID 295310 daemon.warning] Zone "94.139.61.in
-addr.arpa" (file db.94.139.61): no NS RRs found at zone top
Jul 20 10:33:52 pridns named[181]: [ID 295310 daemon.warning] master zone "94.13
9.61.in-addr.arpa" (IN) rejected due to errors (serial 2081340100)

dns中日志文件内出现在如下信息,

Jul 23 14:51:23 second named-xfer[340]: [ID 364785 daemon.notice] [210.41.152.10
] not authoritative for 94.139.61.in-addr.arpa, SOA query got rcode 0, aa 0, anc
ount 1, aucount 0
Jul 23 15:01:23 second named-xfer[371]: [ID 364785 daemon.notice] [210.41.152.10
] not authoritative for 94.139.61.in-addr.arpa, SOA query got rcode 0, aa 0, anc
ount 1, aucount 0

如果要求辅dns立即和主dns同步,在辅dns上删除需要传送的文件,重新启动in.named即可Xinetdsolaris8安装配置过程
一相关信息:
1 说明:
xinetd取代了inetdtcp_wrappers,并且提供了访问控制、加强的日志和资源管理功能,已经成了Internet标准超级守护进程。但是现在还没有在solaris上的完整安装配置手册,我希望写一个关于在solaris上的傻瓜安装配置手册。
2 基本信息
服务器基本信息:Sun-Fire-280R
操作系统:SunOS 5.8 Generic_117350-02
3 Xinetd软件信息
软件版本:2.3.10
下载地址:

软件包说明:该软件包已经添加了--with-libwrap--with-loadavg--with-inet6编译模块选项。
4 系统默认使用xinetd的服务可以分为如下几类:
  标准internet服务:telnet ftp
  信息服务:finger netstat systat
  邮件服务:imap imaps pop2 pop3 pops
  RPC服务:rquotad rstatd rusersd sprayd walld
  BSD服务:comsat exec login ntalk shell talk
  内部服务:chargen daytime echo servers services time
  安全服务:irc
  其他服务:name tftp uucp
5 更多支持信息:

二、安装配置xinetd
1、安装过程
1)#gzip –d xinetd-2.3.10-sol8-sparc-local.gz
2)#pkgadd –d xinetd-2.3.10-sol8-sparc-local
没有报错的话,安装完毕。
2xinetd软件安装后的基本信息
1)文档位置:/usr/local/doc/xinetd
里面有安装说明和配置文件文档。
2)命令位置:/usr/local/sbin/
Xinetdxconv.plitox
3、配置过程:
说明:配置主要涉及俩个文件:/etc/init.d/inetsvc(需要修改)和/etc/xinetd.conf(需要生成)
1)生成/etc/xinetd.conf文件:
a) 说明:/etc/xinetd.conf这个文件是由/etc/inetd.conf文件转换生成的!主要是xinetd替代inetd以后的配置文件
b) 生成命令:
# /usr/local/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf
c) 注意:
/etc/inetd.conf里面可以事先去掉不必要的端口,如fingerlogin等,在/etc/xinetd.conf可以得到比较简洁的配置文。(我在转换前在/etc/inetd.conf文件里只保留了telnetftp)需要别的服务如ssh等可以自己添加。
2)修改/etc/init.d/inetsvc文件:
主要有俩个地方需要修改:
a) 修改一:(建议注释掉旧的配置,添加新的配置)
修改前:/usr/bin/pkill -x -u 0 'in.named|inetd'
修改后:/usr/bin/pkill -x -u 0 'in.named|xinetd'
b) 修改二:
修改前/usr/sbin/inetd -s &
修改后:/usr/local/sbin/xinetd -s &
3)测试:
停止原来的服务:# /etc/init.d/inetsvc stop
启动新的服务:# /etc/init.d/inetsvc start
检查进程:#ps –ef|grep inetd
杀掉得到的进程号:#kill -9 ***
查看xinetd的进程:#ps –ef|grep xinetd
显示如下xinetd配置正常:
root 158 1 0 15:41:50 ? 0:00 /usr/local/sbin/xinetd –s
备注:
Xinetd启动过程有问题,一般是/etc/xinetd.conf配置文件的原因。
三、用xinetd限制ssh登陆配置过程:
1、测试方法:
1)编辑/etc/xinetd.conf
添加如下:
service ssh
{
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/sshd
port = 22
server_args = -i
only_from = 192.0.0.109
}
2、测试过程:
重新启动机器,查看xinetd加载是否正常。
从内网192.0.0.109 ssh登陆服务器可以登陆为正常。
别的IP ssh登陆服务器不可以登陆为正常。
3、注意:
SSH安装以后,不用在/etc/rc2.d下面添加S99sshd,因为xinetd已经可以启动ssh进程了。否则达不到限制ip的作用。
四、备注:
安装完成以后服务器状态:
nmap -P0 127.0.0.1
22/tcp open ssh
只留了ssh端口,而且可以限制ssh登陆的IP地址为:内网的192.0.0.109一种 non-standard SSH service 木马。会产生大量垃圾文件,
改动系统属性。

srload 就是其中之一, 这可不是 solaris 中的程序。

运行

# pfiles * > /tmp/procs

然后检查 木马程序都占用那些端口号。修改/etc/vfstab,把需要限制的文件系统的mount options改为rq

到文件系统的顶,执行命令touch quotaschmod 600 quotas

quotaon -v -a

设定用户可使用的空间(edquota 用户名)



限制用户硬盘使用空间

UNIX作为一种多用户系统,它允许多个用户共同使用系统的资源,包括系统的内存,CPU和硬盘。在默认情况下,系统并不会限制每个用户可以使用硬盘空间的大小,所以如果用户恶意使用硬盘,或用户由于疏忽,将硬盘空间全部占用,将导致其他用户无法使用硬盘,从而使系统性能下降,甚至有崩溃的危险。

其实,UNIX提供的quota系列命令可以帮助我们解决这个问题,这些命令包括:
quota 显示用户的硬盘限额和使用情况。
edquota 为每个用户设定硬盘限额。
quotaon 启动文件系统硬盘限额服务
quotaoff 关闭文件系统硬盘限额服务
repquota 显示当前硬盘限额状态
配置这项服务的方法很简单。但在使用硬盘限额服务之前,我们要明白硬限制和软限制这两个概念。所谓硬限制是指对资源节点和数据块的绝对限制,在任何情况下都不允许用户超过这个限制;而软限制是指用户可以在一定时间范围内(默认时为一周,在/usr/include/sys/fs/ufs_quota.h文件中设置)超过软限制的额度,在硬限制的范围内继续申请资源,同时系统会在用户登录时给出警告信息和仍可继续申请资源剩余时间。如果达到时间期限,用户的硬盘使用仍超过软限制的额度,则系统将不允许用户再申请硬盘资源。

明白了这两个概念,我们就可以配置硬盘限额服务了,首先我们必须在要限制的文件系统的根目录下建立一名字为quotas的文件,该文件的所有者应是root,且其它用户不可以对它进行写操作。方法是:
# cd /home (进入文件系统根目录,注意并不是系统根目录,本例为/home目录)
# touch quotas(创建一名字为quotas的空文件)
# chmod 644 quotas (更改文件属性,使只有root可以对它进行写操作)

然后,我们编辑/etc/vfstab文件,找到要进行硬盘限额服务的文件系统,并将
mount option字段的值设为rq,然后并存盘退出。

完成这两步后,我们使用edquota命令为每个用户设置硬盘限额,在root权限下输入以下命令:
#edquota username
这时系统会自动生成一个临时文件,并且有如下内容:
fs /users blocks (soft = 0, hard = 0) inodes (soft = 0, hard = 0)
其中fs字段表明使用硬盘限额的文件系统,本例为/usersblockinodes表明用户可以使用的硬盘千字节数和I节点数,即用户可使用的硬盘空间和可建立的文件数,softhard分别对于前面提及的软限制和硬限制。

编辑这个文件,把软,硬限制设置到合适的数值,然后存盘退出。这时我们可以看到quotas文件的大小已经被改变,说明用户的限额已经储存。重复这条命令,给每一个用户都配置硬盘限额。另外,如果我们分配给用户的硬盘限额都相同,我们可以使用 “-p” 参数而不用为每个用户都编辑一个文件,它的使用方法是:
#edquota -p reference-usernameusername

编辑完文件后,我们就可以用quotaon来启动服务了,在root权限下输入
#quotaon /users
就可以启动限额服务。如果我们要查看各个用户的当前使用情况,可以使用
repquota 命令,在root权限下输入:
#repquota /users
系统会显示:
。。。

从中我们可以很容易看到用户的硬盘和文件的使用情况以及超过软限制后仍可申请资源的时间等等。

当然我们可以用quotaoff取消硬盘限额服务。另外,系统还提供quotacheck 命令对限额的一致性进行检查。Solaris中的酷命令

作者 Peter Baer Galvin

Solaris 中的命令非常之多,以致很难从中分离出那些很酷的命令。例如,有些命令报告程序进行每个系统调用时所要花费的时间,有些命令动态地显示系统活动信息,而且这些命令大部分都同时包含在了 Solaris 8 Solaris 9 中。这里,我将重点介绍其中一些命令,您或许会发现它们特别有用。

系统管理员是工具的使用者。通过实践经验,我们掌握了更多工具,并且增强了诊断问题以及实施解决方案的能力。本次专栏中包含的命令是通过经验、朋友、熟人以及出席 9 月举行的 SunNetwork 2002 大会收集到的。Solaris 内核的开发人员 Brian Cantrill Mike Shapiro 所讲的"The /procodile Hunter"让人很有启发并令人感到惊恐,因为 Cantrill 编写代码来说明一个观点的速度比 Shapiro 能够讲解该观点的速度还要快!

阅读(2740) | 评论(0) | 转发(0) |
0

上一篇:SUN汇总(1)

下一篇:SUN汇总(4)

给主人留下些什么吧!~~