Saturday, June 18, 2011

Troubleshooting which can be done if luns are not visible in Solaris.

1)cfgadm -al
2)devfsadm -Cvv
 if in disk not connected or showing below error..
c6::50060e81230582a5           unavailable  connected    unconfigured failed

3)cfgadm -c configure c6

luxadm probe

4)then remove zoning and cfgadm -al # But this will remove all the luns, even those which are visible.
5)then add zoing
6)then configure
7)cfgadm -al


Checking the HBA details on a solaris server.
# luxadm -e port

Basic Solaris Volume Manager commands

Contributed by - Yasbir Singh (My dear friend)

/dev/rdsk/cxtxdx
===========================
metadevice
===============

concatenation
--------------
# metainit d10 3 1 c0t0d0s0 1 c0t1d0s0 1 c0t2d0s0

Striping
---------
# metainit d10 1 3 c0t0d0s0 c0t1d0s0 c0t2d0s0

Mirror
========
# metainit d11 1 1 c0t0d0s0
# metainit d12 1 1 c0t1d0s0
# metainit d10 -m d11
# metattach d10 d12

Raid5
--------
# metainit d100 -r c0t0d0s0 c0t1d0s0 c0t2d0s0

=====IN Cluster=========

METASET
========
# metaset -s <metaset_name> -a -h <hosts1> <hosts2>
# metaset -s <metaset_name> -a /dev/rdsk/did/d2 /dev/rdsk/did/d3 /dev/rdsk/did/d4
# metainit -s <metaset_name> d100 1 2 /dev/dsk/rdid/d2s0 /dev/rdsk/did/d3s0
# metainit -s <metaset_name> d101 -p d100 25g
# metainit -s <metaset_name> d102 -p d100 75g
# metainit -s <metaset_name> d103 -p d100 125g
# newfs /dev/rdsk/<metaset_name>/d101
# newfs /dev/rdsk/<metaset_name>/d102
# newfs /dev/rdsk/<metaset_name>/d103
# metainit -s <metaset_name> d110 1 1 /dev/rdsk/did/d4s0

Using PRTVTOC to copy disk geometry in solaris.

Let us assume that we have allocated 4 luns to a Solaris server and want to make them the same layout. We can do the same by using below commands to copy the disk geometry.

# First manually create the disk geometry for the first disk using foramt command.

bash-3.00# prtvtoc /dev/rdsk/c4t60060E8005BD26000000BD2600002A12d0s2 > /tmp/disk

#Above command will create a file of disk geometry in the path mentioned which is "disk" file.

# Then we can use the below commands to replicate the same disk geometry on the other disks.

bash-3.00# fmthard -s /tmp/disk /dev/rdsk/c4t60060E8005BD26000000BD2600002A13d0s2

fmthard:  New volume table of contents now in place.

bash-3.00# fmthard -s /tmp/disk /dev/rdsk/c4t60060E8005BD26000000BD2600002A14d0s2

fmthard:  New volume table of contents now in place.

bash-3.00# fmthard -s /tmp/disk /dev/rdsk/c4t60060E8005BD26000000BD2600002A15d0s2

Thanks
Gorav