Tuesday, September 25, 2012

List LUNs attached to HBA / Disk controllers in Solaris 10

As a system administrator you may come across situations where in your SAN admin presents you some storage (LUNS) and you can’t find where the hell has it gone. The following are some of the ways to list the LUNS presented on a controller or all the controllers on the server.

1. Using fcinfo

In Solaris 10, you can use the “fcinfo” utility which is a 2 step process to identify the Luns presented to the server.

1. Find the HBA port WWN number on the server:
# fcinfo hba-port
This command will show the HBA Port WWN (world wide Node ) among other information like the Node WWN, Device name, manufacturer, firmware, driver details etc.
root@myserver:/root # fcinfo hba-port
HBA Port WWN: 21000022ff0553e9
OS Device Name: /dev/cfg/c5
Manufacturer: QLogic Corp.
Model: 371-4324-02
Firmware Version: 05.03.02
FCode/BIOS Version: BIOS: 2.02; fcode: 2.03; EFI: 2.01;
Serial Number: 0402R00-1102885753
Driver Name: qlc
Driver Version: 3.00p
Type: L-port
State: online
Supported Speeds: 2Gb 4Gb 8Gb
Current Speed: 4Gb
Node WWN: 20000022ff0553e9
Here 21000022ff0553e9 is the WWN number for the HBA port.

2. List SCSI targets for the remote port attached to the HBA port attached to the above.
# fcinfo -sl -p HBA-Port-WWN
root@myserver:/root # fcinfo remote-port -sl -p 21000022ff0553e9
Remote Port WWN: 202400a0b8744072
Active FC4 Types:
SCSI Target: yes
Node WWN: 200400a0b8744072
Link Error Statistics:
Link Failure Count: 1
Loss of Sync Count: 2
Loss of Signal Count: 72
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 0
Invalid CRC Count: 0
LUN: 0
Vendor: SUN
Product: LCSM100_F
OS Device Name: /dev/rdsk/c5t202400A0B8744072d0s2
LUN: 2 Vendor: SUN
Product: LCSM100_F
OS Device Name: /dev/rdsk/c5t202400A0B8744072d2s2
LUN: 31 Vendor: SUN
Product: Universal Xport
OS Device Name: /dev/rdsk/c5t202400A0B8744072d31s2
Here, LUN0 and LUN2 are the actual disks and LUN31 is the Command device for the Storage controller
2. Using cfgadm

You can also find the above information using the “cfgadm” utility. One of the following commands should reveal the LUNS attached to the controller. Although the later works only on Solaris 10.
# cfgadm -al -o show_FCP_dev c5
 
or
 
# cfgadm -al -o show_SCSI_LUNS c5
where c5 is the controller. If you do not mentioned the controller, it then displays for every single disk controller on the server.
root@myserver:/root # cfgadm -al -o show_FCP_dev c5
Ap_Id Type Receptacle Occupant Condition
c5 fc-private connected configured unknown
c5::202400a0b8744072,0 disk connected configured unknown
c5::202400a0b8744072,2 disk connected configured unknown
c5::202400a0b8744072,31 disk connected configured unknown
root@myserver:/root # cfgadm -al -o show_SCSI_LUN c5
Ap_Id Type Receptacle Occupant Condition
c5 fc-private connected configured unknown
c5::202400a0b8744072,0 disk connected configured unknown
c5::202400a0b8744072,2 disk connected configured unknown
c5::202400a0b8744072,31 disk connected configured unknown
 
                      thanks for Reading.. 

Friday, September 21, 2012

DISK QUOTA PERMISSIONS IN SOLARIS 10

verify before prceeding.

SUN#df -k or df -h
sun#format

follow the below screen shots.



next create a filesystem on partition.
#newfs /dev/rdsk/c0t0d0s(enter the slice no you have selected)


1.create a user account with home directory and assign password to the user.
sun#useradd -d /export/home/<home dir> -m sun<username>
sun#passwd <username>
password:
confirm password :

2.mount the partition on user home directory.
sun#mount /dev/dsk/c0t0d0s<no> /export/home/<user home dir>

quota permissions:
sun#cd /export/home
sun#touch quotas
sun#quotaon -v /export/home
sun#edquota <username>
new window will appear
fs /export/home   blocks(soft=4,hard=8)
                inodes (soft=4,hard=8)
then save the file.

To copy the quota permissions from one user to another user.
sun#edquota -p <old user> <new user>

To verify-
sun#repquota -v /export/home

To turnoff quota
sun#quotaoff -v /export/home.

                                                Thank you for Reading.

  

Popular Posts

Followers

Disclaimer

All Data and Information Provided on This BLOG is only for Education purposes only.If you done any thing else these in real time the blog is not Responsible.Try all those on your own risk.
IF you find any thing else here as per in violation of copyright law .mail me on srinathceh@gmail.com as soon as possible action will be taken.