Solaris中查看硬件信息常用命令
1、如何查看cpu的状态?
# psrinfo -v
# mpstat 可以列出多cpu负载的状态
2、如何查看内存?
# prtconf | grep 'Memory' 可以查看内存的多少. # /usr/platform/sun4u/sbin/prtdiag
3、如何动态添加swap分区?
# $su - root ----- 成为超级用户
# mkfile 100m /home/swapfile ----- 创建100m的Swap文件 # /usr/sbin/swap -a /path/filename ----- 激活Swap文件 # /usr/sbin/swap -l ----- 验证swap文件
# /usr/sbin/swap -d /path/filename ----- 取消swap文件 # rm -rf /home/swapfile ----- 删除swap文件
4、如何查看当前网卡是以何种速率起来的?
# dmesg |grep Link
5、如何调整x-window的分辨率和刷新频率?
字符界面登陆,运行:#/kdmconfig
6、如何使用光、软驱?
一般情况下用:
# /etc/init.d/volmgt start # volcheck
以上方法不行,用:
# /etc/init.d/volmgt stop
# mount -F hsfs -o ro /dev/dsk/c0t6d0s0 /cdrom --挂接光驱 # mount -F pcfs /dev/diskette0 /floppy --挂接软驱 solaris定义系统磁盘文件系统说明:
ufs – UNIX文件系统。是Solaris缺省的文件系统。 hsfs – 高密度CD-ROM文件系统,是只读文件系统。 pcfs – PC文件系统,支持DOS格式化的软盘
7、SCSI设备的命名规则是什么?
带有总线控制器的硬盘的使用,下面列出了总线控制器的硬盘命名习惯: cWtXdYsZ
c Logical controller number t Physical bus target number d Drive number
s Slice (or partition) number (0 to 7) 例如:
/dev/rdsk/c0t0d0s0 该原始接口对应第一个控制器的第一个SCSI目标地址的第一个硬盘的第一片(根)
/dev/rdsk/c0t0d0s2 该原始接口对应第一个控制器的第一个SCSI目标地址上的第一个硬盘的第三片(表示
整上硬盘)
8、如何查看硬盘的使用情况?
# df -k 可以看到已安装的文件系统的空间大小及剩余空间大小。
# quota -v 查看用户的磁盘空间信息,如果你用quota限制了用户空间大小的话。 # du -sk * 查看目录的使用情况
# du -k | sort -n 可以迅速发现那个目录是最大的。
9、如何查看硬盘物理信息?
# format 这个命令也可以查看硬盘的类型和分区的详细情况 # iostat -E 看硬盘的大小和型号
# prtvtoc /dev/rdsk/c0t0d0s0 显示某个磁盘的分区状况
10、查看系统内核命令。
# isainfo 看内核的bit, # isainfo -kv 调整内核
# modinfo 显示可载入的模组
# prtconf 显示系统硬件配置(周边设备)
#sysdef 显示可载入的模组,硬件配置与一些可以调整的核心参考值 #ulimit -a
11、打印当前的OBP版本号
# prtconf –V
OBP 3.20.0 2000/10/24 10:47
# /usr/platform/sun4u/sbin/prtdiag –v | grep OBP
OBP 3.20.0 2000/10/24 10:47 POST 6.1.0 2000/10/24 10:49 ok. .version
Release 3.20 Version 0 created 2000/10/24 10:47 OBP 3.20.0 2000/10/24 10:47 POST 6.1.0 2000/10/24 10:49 OBDIAG 4.5.1 2000/10/24 10:48
12、查看及启动系统的32位或64位内核模式
64位模式
# isalist –v
sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc
# isainfo –v
64-bit sparcv9 applications 32-bit sparc applications # isainfo –b 64
启动64位内核模式
ok. boot kernel/sparcv9/unix
32位模式
# isalist –v
sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc # isainfo –v
32-bit sparc applications # isainfo –b 32
启动32位模式
ok. boot kernel/unix
13、测定当前的显示器刷新频率
# /usr/sbin/fbconfig –rev \\?
14、如何配置网卡ip?
# ifconfig -a --查看网卡,例如是hme0 # ifconfig hme0 unplumb --停止网卡 # ifconfig hme0 plumb --起用网卡
# ifconfig hme0 inet 192.168.2.3 netmask 255.255.255.0 up --添加ip、子网掩码 # vi /etc/defaultrouter 添加默认路由的ip # vi /etc/hostname.hme0 添加主机名 # vi /etc/nodename 添加主机名 # vi /etc/resolv.conf domain china.com 你的域名
nameserver 202.106.0.20 你使用的nds ip
# vi /etc/nsswitch.conf 更改 hosts:file dns
15、 PROM状态命令与参数
格式: OK> 指令 命令 说明
banner 显示当前机器配置状况,CPU,内存,hostid,EtherNet probe-scsi 显示内部SCSI通道所挂接设备
probe-scsi-all 显示所有SCSI通道及所挂接设备
probe-ide 显示所有IDE通道及所挂接设备(针对U10,U5) devalias 显示设备别名,如 cdrom,disk,disk0,disk1等 printenv 无参数,显示环境变量或
参数为环境变量名 如: printenv auto-boot?
setenv 设置环境变量,如: setenv auto-boot? false
set-default 恢复环境变量预定值 如:set-default auto-boot? set-defaults 恢复所有环境变量预定值 boot device option 启动主机 设备别名: cdrom 或 disk
设备名: /pci@1f,4000/scsi@3,1/disk@6,0:f option -r 设备配置 -s 单用户
eject cdrom|floppy 弹出cdrom或floppy reset 复位 test net
watch-net-all show-devs
16、查找网卡名称及接口个数
# grep network /etc/path_to_inst
17、如何一块网卡帮定三个ip,并且子网掩码不同?
举例说明,网卡名hme0: # vi /etc/hosts 127.0.0.1 localhost 192.168.2.1 dbs loghost 192.168.9.15 dd 192.168.9.65 aa # vi /etc/netmasks
192.168.2.0 255.255.255.0 192.168.9.0 255.255.255.192 192.168.9.64 255.255.255.252
#vi /etc/hostname.hme0 dbs
#vi /etc/hostname.hme0:1 dd
#vi /etc/hostname.hme0:2 aa
# ifconfig hme0 inet 192.168.2..1 netmask 255.255.255.0 up # ifconfig hme0:1inet 192.168.9.15 netmask 255.255.255.192 up # ifconfig hme0 inet 192.168.9.65 netmask 255.255.255.252 up # init 6 #ifconfig -a
18、如何在prom状态下查看光纤硬盘 ?
stop +a进入ok状态:
ok> select 光纤卡设备名(可用show-devs查看到) ok> show-children
19、主机双屏幕设置。
1.Confirm there are two Video Cards。
2.Confirm driver installed and patches installed if need。 3.vi /usr/dt/config/Xservers. comment the last line.
and uncomment the nearest line like this. 4.reboot.
20、查看硬盘参数及其物理地址:
#format
21、显示磁盘的分区情况:
#prtvtoc /dev/rdsk/c0t0d0s2
一、Solaris format命令
由于它的破坏性极大,使用时一定要小心!
两个用途,即格式化硬盘和重新对硬盘分区.
1)格式化硬盘
最好进入单用户模式 #format
系统会显示所有的硬盘并让我们选择要操作硬盘: Searching for disks...done
AVAILABLE DISK SELECTIONS: 0. c0t0d0
/pci@1f,4000/scsi@3/sd@0,0 1. c0t1d0
/pci@1f,4000/scsi@3/sd@1,0 2. c0t2d0
/pci@1f,4000/scsi@3/sd@2,0 3. c0t3d0 u03
/pci@1f,4000/scsi@3/sd@3,0 Specify disk (enter its number): 2 selecting c0t2d0 [disk formatted]
Warning: Current Disk has mounted partitions. FORMAT MENU: disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table current - describe the current disk format - format and analyze the disk repair - repair a defective sector label - write label to the disk
analyze - surface analysis
defect - defect list management backup - search for backup labels verify - read and display labels
save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name ! - execute , then return quit
format> partition PARTITION MENU: 0 - change `0\\' partition 1 - change `1\\' partition 2 - change `2\\' partition 3 - change `3\\' partition 4 - change `4\\' partition 5 - change `5\\' partition 6 - change `6\\' partition 7 - change `7\\' partition
select - select a predefined table
modify - modify a predefined partition table name - name the current table print - display the current table
label - write partition map and label to the disk ! - execute , then return quit
partition> modify partition>label partition>quit format>save
使用命令newfs来为每一个分区创建文件系统: newfs /dev/rdsk/c?t?d?s?
硬盘包含启动分区(根分区),我们需要手动安装启动模块 #reboot cdrom -s (从光盘启动,并进入单用户模式)
#mount /dev/dsk/c0t1d0s0 /mnt (将系统根分区挂接到mnt目录下) #cp /ufsboot /mnt
#installboot /lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0 (安装启动模块) #umount /mnt (卸下挂接) #reboot (重启动)
2) 重新分区
format命令也可以对硬盘进行重新分区。重新分区后,受影响分区上的所有文件将被清除
要对该分区表命名,SAVE退出format 命令。分区结束后,我们要用newfs命令为改变
的分区创建文件系统
二、Solaris ifconfig命令
用于查看和更改网络接口的地址和参数
$ifconfig -a
lo0: flags=849 mtu 8232
inet 127.0.0.1 netmask ff000000
hme0: flags=863 mtu 1500
inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255
ether 8:0:20:a7:4d:21
系统会显示网络接口的名称,接口的状态(up or down),接口的IP地址和掩码等信息
更改网络接口的IP地址:
#ifconfig hme0 down
#ifconfig hme0 211.101.149.233 netmask 255.255.255.0 up
首先,使用down命令参数把网络接口hme0的服务暂时停止,然后再用ifconfig命令给接口分配新的IP地址和掩码,并启动网络接口服务。也可以通过改变文件/etc/hosts中的IP地址的值并重新启动系统来更改机器的IP地址。
/etc/hosts/:
211.101.149.11 sampdt
定义主机名在/etc/hostname.hme0及IP地址。
更改了网卡/增加了网卡,系统不能自动启动该接口服务,这时需要手动创建网口服务:
#ifconfig hme0 plumb
即可以为接口le0创建网口服务
相应地,用ifconfig带unplumb参数可以停止服务并关闭网络
三、Solaris route命令
route命令主要用于手动配置静态路由表
例:增加一条通过网关到达令一子网的路由
#route add net remote_net_ip gateway_ip 1
其中add代表要增加路由,net表示路由到达的是一个网络而不是一台主机,1代表远端网络需通过网关才能到达(直接通过网络接口相连时,该参数用0)
命令格式:
#route add -net remote_net_ip gateway_ip -netmask netmask #route add -host host_ip local_interface_ip -interface
使用\\\"delete\\\",\\\"change\\\"命令参数可以对路由表中的路由信息进行删除和修改 使用\\\"netstat -rn\\\"命令查看当前的路由信息
对修改文件/etc/defaultrouter可以设置一些默认路由
四、Solaris fsck命令
对文件系统进行检查,并对损害的文件系统进行修复。
fsck的语法如下:
fsck (-F fstype) (-v) (-m) (-special…) fsck (-F fstype) (-v) (-y|Y|n|N) (-o fstype options) (special…)
其中:
-F fstype : 说明被检查的文件系统的类型 -v : 返回完成的命令行,但不运行 -y|Y: 对所有问题均回答Yes -n|N: 对所有问题均回答No
-m: 对文件系统进行检查,不修复文件系统,
如果文件系统经检查后是可安装的,则显示 ufs fsck : sanity check : /dev/rdsk/c0t0d0s0 okay. -o: 文件系统类型选项,选项由逗号分隔,
最常用的选项有两个: P: 整理(preen)模式
F: 强制检查模式,此选项忽略文件系统状态标志。
1) 移去一个没有相关文件的目录入口 答Yes或Y来删除该目录入口 2) 重连接一个已分配但不能访问的文件
对fsck的\\\"RECONNECT?\\\"回答Yes,即把该I节点连接到lost+found目录下,文件名即是I节点号
3) 连接数调整 回答Yes或Y来改正连接数 4) 自由块表不一致 回答Yes或Y来修正超级块
对于fsck询问的问题大多数情况下都可以用Yes来回答,所以在实际应用时,可以用\\\" -y\\\"选项来执行该命令对硬盘进行检查和修复。
五、几个磁盘文件管理的命令
(1)du命令显示某个目录下文件的占用磁盘空间的情况: du [-a] [-s] [-k] [directory] 参数:
-k 以千字节方式显示(默认是以块方式显示,一个块为 -s 只以简略的方式显示
-a 显示制定目录下所有文件和目录占用的磁盘块数量
(2)devfsadm 添加新硬盘的命令 root@oneo # format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 1. c1t1d0 Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 1. c1t1d0 2. c1t2d0 (3)newfs创建文件系统 # newfs /dev/rdsk/c0t2d0s2 newfs: construct a new file system /dev/rdsk/c0t2d0s0: (y/n)? y /dev/rdsk/c0t2d0s2: 41040 sectors in 57 cylinders of 9 tracks, 80 sectors 21.0MB in 4 cyl groups (16 c/g, 5.90MB/g, 2688 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 11632, 23232, 34832, (4)df命令查看已挂接的文件系统使用状况 参数k:表示以千字节格式显示 $ df -k Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t3d0s0 38111 19196 18877 51% / /dev/dsk/c0t3d0s6 565503 361529 203409 64% /usr /proc 0 0 0 0% /proc fd 0 0 0 0% /dev/fd /dev/dsk/c0t3d0s1 25159 4886 20248 20% /var /dev/dsk/c0t3d0s5 27439 20362 7050 75% /opt swap 45980 12 45968 1% /tmp root@oneo # df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1t0d0s0 9.3G 3.9G 5.3G 43% / /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/mnttab swap 649M 616K 648M 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object /dev/dsk/c1t0d0p0:boot 16M 1.5M 14M 10% /boot /usr/lib/libc/libc_hwcap1.so.1 9.3G 3.9G 5.3G 43% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd swap 648M 4K 648M 1% /tmp swap 648M 24K 648M 1% /var/run /dev/dsk/c1t1d0s2 3.9G 2.1G 1.8G 54% /u01 Solaris 10 HBA启用多路径有两种方法: 1、/usr/sbin/stmsboot -e # stmsboot -e WARNING: stmsboot operates on each supported multipath-capable controller detected in a host. In your system, these controllers are If you do NOT wish to operate on these controllers, please quit stmsboot and re-invoke with -D { fp | mpt } to specify which controllers you wish to modify your multipathing configuration for. Do you wish to continue? [y/n] (default: y) 2、修改配置文件/kernel/drv/fp.conf。 /kernel/drv/fp.conf默认配置如下: ********************************************************************** # # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms.# # Sun Fibre Channel Port driver configuration # #ident \"@(#)fp.conf 1.3 04/10/22 SMI\" # name=\"fp\" class=\"fibre-channel\" port=0; name=\"fp\" class=\"fibre-channel\" port=1; # # Automatic configuration of the fabric is turned on by default # and thus allows all devices discovered in the SAN zone to be # enumerated in the Solaris devinfo tree automatically. # # The manual_configuration_only property may be used to # disable the default behavior and force the manual configuration of # the devices in the SAN. Setting manual_configuration_only=1 # will disable the automatic configuration of devices. # NOTE: Use of this property is not recommended. If used, the # fabric devices accessed at boot time need to get manually configured # before the next reboot. Otherwise, fabric devices that are needed at # boot time may not get configured and may cause boot problems. # To manually configure fabric devices, refer to cfgadm_fp(1M). # manual_configuration_only=1; # # To generate the binding-set specific 'compatible' forms used to address # legacy issues the 'scsi-binding-set' property must be defined. (do not remove) # scsi-binding-set=\"fcp\"; # # List of ULP modules for loading during port driver attach time # load-ulp-list=\"1\ # # Force attach driver to support hotplug activity (do not remove the property) # ddi-forceattach=1; # # I/O multipathing feature (MPxIO) can be enabled or disabled using # mpxio-disable property. Setting mpxio-disable=\"no\" will activate # I/O multipathing; setting mpxio-disable=\"yes\" disables the feature. # # Global mpxio-disable property: # # To globally enable MPxIO on all fp ports set: # mpxio-disable=\"no\"; # # To globally disable MPxIO on all fp ports set: #mpxio-disable=\"yes\";# # Per port mpxio-disable property: # # You can also enable or disable MPxIO on a per port basis. # Per port settings override the global setting for the specified ports. # To disable MPxIO on port 0 whose parent is /pci@8,600000/SUNW,qlc@4 set: # name=\"fp\" parent=\"/pci@8,600000/SUNW,qlc@4\" port=0 mpxio-disable=\"yes\";# # NOTE: If you just want to enable or disable MPxIO on all fp ports, it is # better to use stmsboot(1M) as it also updates /etc/vfstab.# # # You can describe a list of target port WWNs and LUN numbers which will # not be configured. LUN numbers will be interpreted as decimal. White # spaces and ',' can be used in the list of LUN numbers. # # pwwn-lun-blacklist= # \"target-port-wwn,lun-list\" # # To prevent LUNs 1 and 2 from being configured for target # port 510000f010fd92a1 and target port 510000e012079df1, set: # # pwwn-lun-blacklist= # \"510000f010fd92a1,1,2\# \"510000e012079df1,1,2\"; *********************************************************************** 在 /kernel/drv/fp.conf文件增加以下内容: mpxio-disable=\"yes\"; #启用全局多路径支持; name=\"fp\" parent=\"/pci@9,600000/SUNW,qlc@2\" port=0 mpxio-disable=\"yes\"; #禁用本地硬盘多路径支持;/pci@9,600000/SUNW,qlc@2\"是通过format命令查看本地硬盘的信息; 根据fp.conf注释部分可以看出,厂家更倾向于使用第一种方式来修改! Solaris 8 或 9 OS 启用多路径:在运行 Solaris OS 8 或 9 的主机上启用多路径软件: 1. 使用文本编辑器打开 /kernel/drv/scsi_vhci.conf 文件。 2. 在文件中设置 mpxio-disable=”no”;。 3. 在文件中设置 load-balance=”round-robin”;。 4. 在文件中设置 auto-failback=”enable”;。 5. 保存更新后的文件。 6. 重新引导主机。 7. 使用 cfgadm 命令配置 HBA 路径。(配置路径的方式取决于您在 SAN 或直接连接环境中使用阵列的方式。) Solaris 下配置多路径 1、vi /kernel/drv/scsi_vhci.conf 文件 设置mpxio-disable=”no”(打开打开全局的MPXIO) 设置load-balance=”round-robin” 设置auto-failback=”enable” 2、保存文件 3、如果是scsi系统总线,无需更改其他文件,reboot 主机即可 4、如果主机内部存储控制器是fc总线,则: vi /kernel/drv/fp.conf name=\"fp\" parent=\"/pci@9,600000/SUNW,qlc@2\" port=0 mpxio-disable=\"yes\";(本地通道yes表示禁用) /pci@9,600000/SUNW,qlc@2这个路径根据实际情况修改。 另一种: root@web-db1 # reboot -- -r 运行cfgadm –al 可以看见系统已经注册了控制器,只需启用多路径mpxio即可。 root@web-db1 # cfgadm -al Ap_Id Type Receptacle Occupant Condition c0 scsi-bus connected configured unknown c0::dsk/c0t0d0 CD-ROM connected configured unknown c1 fc-private connected configured unknown c1::5000cca00432dcc9 disk connected configured unknown c1::5000cca00432dce1 disk connected configured unknown c2 fc-private connected configured unknown c2::200400a0b82aaf01 disk connected configured unknown c3 fc-private connected configured unknown c3::200500a0b82aaf01 disk connected configured unknown usb0/1 usb-mouse connected configured ok usb0/2 usb-device connected configured ok usb0/3 unknown empty unconfigured ok usb0/4 unknown empty unconfigured ok root@web-db1 # ls -l /dev/fc 总数 6 lrwxrwxrwx 1 root root 51 12 月 1日 12:55 fp0 日 12:55 fp1 日 12:55 fp2 -> ../../devices/pci@8,600000/SUNW,qlc@1/fp@0,0:devctl lrwxrwxrwx 1 root root 51 12月 1-> ../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0:devctl lrwxrwxrwx 1 root root 51 12月 1-> ../../devices/pci@9,600000/SUNW,qlc@2/fp@0,0:devctl 注:(fp0,fp1为HBA卡上的光纤通道,fp2为本地的光线通道 fp0,fp1开启多路径,fp2关闭多路径) root@web-db1#vi /kernel/drv/fp.conf 添加如下语句。 注释掉 #mpxio-disable=\"yes\"; parent=\"/pci@8,600000/SUNW,qlc@1\" name=\"fp\" parent=\"/pci@8,600000/SUNW,qlc@2\" name=\"fp\" // fp0,fp1开启多路径 port=0 port=0 mpxio-disable=\"no\"; mpxio-disable=\"no\"; parent=\"/pci@9,600000/SUNW,qlc@2\" port=0 mpxio-disable=\"yes\"; name=\"fp\" // fp2关闭多路径 注:(多路径软件用于管理指向共享群集存储设备的多个I/O 路径。对于Solaris 8 或Solaris 9 操作系统,安装并配置Sun StorEdge Traffic Manager 软对于Solaris 10 操作系统,启用Solaris 多路径功能,此功能作为Solaris 10 软件的一部分已被默认安装。 以上表明在HBA卡FC接口上启用mpxio,而不是全局启用。这样正常阵列设备识别的磁盘号就为长串字符,而本地磁盘识别的磁盘号为正常的cxtxsx,因为只是在FC口局部启用的多路径,而本地禁用多路径) root@web-db1# stmsboot –u WARNING: This operation will require a reboot. Do you want to continue ? [y/n] (default: y) y The changes will come into effect after rebooting the system. Reboot the system now ? [y/n] (default: y) y 在web-server2上执行相同的步骤 可以看见盘阵已经变成multipath-devices root@web-db1 # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 /pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w5000cca00432dcc9,0 1. c1t1d0 /pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w5000cca00432dce1,0 2. c4t600A0B80002A2B320000066F492B138Dd0 /scsi_vhci/ssd@g600a0b80002a2b320000066f492b138d 3. c4t600A0B80002AAF00000007BF492B135Cd0 /scsi_vhci/ssd@g600a0b80002aaf00000007bf492b135c 4. c4t600A0B80002AAF00000007C5492B13D6d0 /scsi_vhci/ssd@g600a0b80002aaf00000007c5492b13d6 Specify disk (enter its number): root@web-db2 # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 /pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w21000000878d59a1,0 1. c1t1d0 /pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w21000000878d0ef5,0 2. c4t600A0B80002A2B320000066F492B138Dd0 /scsi_vhci/ssd@g600a0b80002a2b320000066f492b138d 3. c4t600A0B80002AAF00000007BF492B135Cd0 /scsi_vhci/ssd@g600a0b80002aaf00000007bf492b135c 4. c4t600A0B80002AAF00000007C5492B13D6d0 /scsi_vhci/ssd@g600a0b80002aaf00000007c5492b13d6 solaris 10 启用HBA 多路径 Solaris 10 HBA启用多路径可以有两种方法:一种是使用/usr/sbin/stmsboot -e,还有一种是修改配置文件/kernel/drv/fp.conf。如果Solaris 10配置软RAID和Cluster环境我建议不要使 用 /usr/sbin/stmsboot -e命令来启用HBA多路径。下面我们来描述如何修改/kernel/drv/fp.conf配置文件启用HBA多路径。 /kernel/drv/fp.conf默认配置如下: ********************************************************************** # # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # Sun Fibre Channel Port driver configuration # #ident \"@(#)fp.conf 1.3 04/10/22 SMI\" # name=\"fp\" class=\"fibre-channel\" port=0; name=\"fp\" class=\"fibre-channel\" port=1; # # Automatic configuration of the fabric is turned on by default # and thus allows all devices discovered in the SAN zone to be # enumerated in the Solaris devinfo tree automatically. # # The manual_configuration_only property may be used to # disable the default behavior and force the manual configuration of # the devices in the SAN. Setting manual_configuration_only=1 # will disable the automatic configuration of devices. # NOTE: Use of this property is not recommended. If used, the # fabric devices accessed at boot time need to get manually configured # before the next reboot. Otherwise, fabric devices that are needed at # boot time may not get configured and may cause boot problems. # To manually configure fabric devices, refer to cfgadm_fp(1M). # manual_configuration_only=1; # # # To generate the binding-set specific 'compatible' forms used to address # legacy issues the 'scsi-binding-set' property must be defined. (do not remove) # scsi-binding-set=\"fcp\"; # # List of ULP modules for loading during port driver attach time # load-ulp-list=\"1\ # # Force attach driver to support hotplug activity (do not remove the property) # ddi-forceattach=1; # # I/O multipathing feature (MPxIO) can be enabled or disabled using # mpxio-disable property. Setting mpxio-disable=\"no\" will activate # I/O multipathing; setting mpxio-disable=\"yes\" disables the feature. # # Global mpxio-disable property: # # To globally enable MPxIO on all fp ports set: # mpxio-disable=\"no\"; # # To globally disable MPxIO on all fp ports set: #mpxio-disable=\"yes\"; # # Per port mpxio-disable property: # # You can also enable or disable MPxIO on a per port basis. # Per port settings override the global setting for the specified ports. # To disable MPxIO on port 0 whose parent is /pci@8,600000/SUNW,qlc@4 set: # name=\"fp\" parent=\"/pci@8,600000/SUNW,qlc@4\" port=0 mpxio-disable=\"yes\"; # # NOTE: If you just want to enable or disable MPxIO on all fp ports, it is # better to use stmsboot(1M) as it also updates /etc/vfstab. # # # You can describe a list of target port WWNs and LUN numbers which will # not be configured. LUN numbers will be interpreted as decimal. White # spaces and ',' can be used in the list of LUN numbers. # # pwwn-lun-blacklist= # \"target-port-wwn,lun-list\" # # To prevent LUNs 1 and 2 from being configured for target # port 510000f010fd92a1 and target port 510000e012079df1, set: # # pwwn-lun-blacklist= # \"510000f010fd92a1,1,2\# \"510000e012079df1,1,2\"; *********************************************************************** 我们所要做的操作就是启用全局多路径支持,然后在禁用内置硬盘多路径支持;在 /kernel/drv/fp.conf文件增加以下内容: mpxio-disable=\"yes\"; #启用全局多路径支持; name=\"fp\" parent=\"/pci@9,600000/SUNW,qlc@2\" port=0 mpxio-disable=\"yes\";#禁用本地硬盘多路径支持;/pci@9,600000/SUNW,qlc@2\"是通过format命令查看本地硬盘的信息 因篇幅问题不能全部显示,请点此查看更多更全内容