Category: Solaris 10

  • Solaris Volume Manager

    RaidSolaris Volume Manager (formerly known as Online: DiskSuite, and later Solstice DiskSuite is a software package for creating, modifying and controlling RAID disks in Solaris. The process below outlines steps that you need to take to setup basic root disk mirroring.

    Adding a new Disk? Create your Partition Table for your Mirror:

    Using the format command, select your initial disk. Then select par, then
    name to save off you partition table to disk.

    Then switch to the other disk and label the other disk with the saved
    partition table.

    Md.tab — add mirror information:

    The file /etc/md.tab is basically a map file where you define your metadevices and the physical devices that they represent. In the example below the metadevice d0 has two submirrors, d10 and d20.

    For Example:
    d0      -m              d10
    d10             1 1     /dev/dsk/c0t0d0s0
    d20             1 1     /dev/dsk/c0t1d0s0
    #swap mirror
    d1      -m              d11
    d11             1 1     /dev/dsk/c0t0d0s1
    d21             1 1     /dev/dsk/c0t1d0s1
    #var mirror
    d4      -m              d14
    d14             1 1     /dev/dsk/c0t0d0s4
    d24             1 1     /dev/dsk/c0t1d0s4

    Add Meta Databases:

    bash-3.00# metadb -c 3 -f -a /dev/dsk/c5t0d0s3
    bash-3.00# metadb -c 3 -f -a /dev/dsk/c5t4d0s3

    Make sure that you create them on the correct slice. The normal standard that I follow, has me creating them on slice 3.
    In the example above you are creating 3 metadbs on the mirror disk. Not sure if you need the -f option on the second db, but it does not seem to cause any issues.

    Initialize
    your Mirrors:

    In the example below you are initializing your one way mirror. These are the entries from the md.tab. Here I am initializing each side of the mirror. Note that you do not need to specify "d10 1 1 c5t0d0s0" if you have added this information to the md.tab Use the '-f' switch when the filesystem on that slice is currently mounted.

    EXAMPLE for Slice 0:

    bash-3.00# metainit -f d10 1 1 c5t0d0s0
    d10: Concat/Stripe is setup
    bash-3.00# metainit d20 1 1 c5t4d0s0
    d10: Concat/Stripe is setup

    .

    Attach your First
    Submirror:

    The example below shows how attach your one way mirror to your metadevice. Once this step is complete. You will want to reboot, and attach the other side of the mirror. You can then edit the /etc/fstab with the new metadevices.

    EXAMPLE:

    metainit d0 -m d10

     

    
    

    Metaroot to Create root mirror in fstab:

    The metaroot command is used to modify the /etc/fstab

    metaroot d0

    Then modify any other entries.

    Attach Secondary Mirror:

    metattach d20

    Other Helpful Commands:

    How to Delete Metadbs:

    If you need to start over, you can use the command below to remove metadatabases.

    metadb -d -f /dev/dsk/diskname

    Inpect your Metadbs:

    # metadb -i
            flags           first blk       block count
         a        u         16              8192            /dev/dsk/c0t0d0s7
         a        u         16              8192            /dev/dsk/c0t1d0s7
         a        u         16              8192            /dev/dsk/c0t2d0s7

    How to Detach Mirrors:

    metadetach mirror submirror

    metadetach d0 d20

    after completing the step above you should clear the concat/stripe

    metaclear d20

    Metastat:

    Metastat gives you the status of your mirrors

    # metastat
    d7: RAID
        State: Initializing
        Initialization in progress: 12.2% done <== not done yet
        Interlace: 32 blocks
        Size: 208618176 blocks (99 GB)
    Original device:
        Size: 208627648 blocks (99 GB)
            Device     Start Block  Dbase        State Reloc  Hot Spare
            c0t0d0s7      10506       Yes Initializing   Yes
            c0t1d0s7      10506       Yes Initializing   Yes
            c0t2d0s7      10506       Yes Initializing   Yes
    
    

     

    
    			
  • Solaris HBA Notes

    Below is a cheat sheet that I put together of commands that are helpful for managing HBAs on Solaris.

    Helpful Commands

    • luxadm probe
    • luxadm -e port
    • devfsadm

    More Helpful Commands

    • To show Sun/Qlogic HBA’s:

    luxadm qlgc

    • To show all vendor HBA’s — see sample output below:

    luxadm fcode_download -p

    Found Path to 0 FC100/S Cards

    Complete

    Found Path to 5 FC100/P, ISP2200, ISP23xx Devices

    Opening Device: /devices/pci@9,600000/SUNW,qlc@2/fp@0,0:devctl

    Detected FCode Version:       ISP2200 FC-AL Host Adapter Driver: 1.14 01/11/20

    Opening Device: /devices/pci@8,700000/SUNW,qlc@5,1/fp@0,0:devctl

    Detected FCode Version:       ISP2312 Host Adapter Driver: 1.14.09 03/08/04

    Opening Device: /devices/pci@8,700000/SUNW,qlc@3,1/fp@0,0:devctl

    Detected FCode Version:       ISP2312 Host Adapter Driver: 1.14.09 03/08/04

    Opening Device: /devices/pci@8,700000/SUNW,qlc@3/fp@0,0:devctl

    Detected FCode Version:       ISP2312 Host Adapter Driver: 1.14.09 03/08/04

    Opening Device: /devices/pci@8,700000/SUNW,qlc@5/fp@0,0:devctl

    Detected FCode Version:       ISP2312 Host Adapter Driver: 1.14.09 03/08/04

    Complete

    • Another Method of doing the same thing as above:

    prtpicl -v > filename

    • To show link status of card:

    luxadm -e port

    • See WWNS:

    To see the WWN’s (using address given to you from previous commands), it is
    the last one that specifies it is a HBA, so the port WWN here is 210000e08b100d16

    # luxadm -e dump_map /devices/pci@1f,0/pci@1/SUNW,qlc@1/fp@0,0:devctl

    Pos Port_ID Hard_Addr Port WWN Node WWN Type

    0 10600 0 224100015d210900 220000015d210900 0x1f (Unknown Type)

    1 10700 0 210000e08b103417 200000e08b103417 0x1f (Unknown Type)

    2 10800 0 210000e08b100d16 200000e08b100d16 0x1f (Unknown Type,Host Bus Adapter

    Configuring storage online

    • List unconfigured disks

    cfgadm -al

    Ap_Id Type Receptacle Occupant Condition

    c0 scsi-bus connected configured unknown

    c0::dsk/c0t0d0 disk connected configured unknown

    c0::dsk/c0t2d0 CD-ROM connected configured unknown

    c1 fc-fabric connected unconfigured unknown

    c1::210000e08b103417 unknown connected unconfigured unknown

    c1::224100015d210900 unknown connected unconfigured unknown

    c2 fc-fabric connected unconfigured unknown

    c2::210100e08b303417 unknown connected unconfigured unknown

    c2::223100015d210900 unknown connected unconfigured unknown

    So we can see that c1 and c2 are both unconfigured disks, so we now run the command below to configure them.

    # cfgadm -f -c configure c1 c2

    You can now run devfsadm.

    Example cfgadm -al

    c1                             fc-private

    c1::21000020379cb9bb           disk         connected    configured   unknown

    c4                             fc-fabric    connected    unconfigured unknown

    c5                             fc           connected    unconfigured unknown

    C1 is a 280r internal controller
    C4 is a HBA attached to a switch with no targets
    C5 is a HBA that has nothing connected

    More Good Stuff

    1) The command cfgadm -al

    2) look for the fc-fabric

    c2                             fc-fabric    connected

    c3                             fc-fabric    connected

    3) and then cfgadm -cconfigure c2 c3

    4) Now you see the LUN

    A Magical File – Check it Out

    /kernel/drv/sd.conf

    Checking IO on Fibre Cards

    iostat -xcn 5

    San Foundation Kit

    You get this from Sun, install it after you install the drivers
    There is no SAN foundation kit for Solaris 10. Installing the SAN foundation
    kit will do bad things. It’s only for Solaris 8 and Solaris 9.

    Get the WWN

     Method 1:

     

    $ luxadm probe
    $ luxadm -e port

    $ luxadm -e dump_map <xyz> where xyz= your connected port.

    Method 2:

    bash-2.03# cat /var/adm/messages | grep -i WWN

    Sep 20 18:23:28 alautpnc003 qlc: [ID 657001 kern.info] Qlogic qlc(0) WWPN=210000e08b934ead : WWNN=200000e08b934ead

    Sep 20 18:23:39 alautpnc003 qlc: [ID 657001 kern.info] Qlogic qlc(1) WWPN=210100e08bb34ead : WWNN=200100e08bb34ead

    Method 3:

    #modinfo | grep SunFC

    46 10274e94 20010 172 1 fcp (SunFC FCP v20050926-1.86)

    47 10269923 8204 – 1 fctl (SunFC Transport v20050926-1.36)

    51 1028b850 15e28 171 1 fp (SunFC Port v20050926-1.53)

    53 10300f09 c5024 175 1 qlc (SunFC Qlogic FCA v20051013-2.08)

    Method 4:

    cfgadm -o show_FCP_dev -al

    Method 5:

    prtconf -pv | grep -i wwn | grep -i port