• Veritas Volume Manager Upgrade Solaris 8

    Symantec_Storage_Foundation_Basic_5_Linux
    I’ve been told by some that this process is overkill, and have been told by others that this process is the cleanest way to go. Please procede at your own risk.

    QuickNotes: vxlicrep -e will allow you view your veritas license along with lot of additional information.

    Backup any file systems that are part of rootdg

    This particular system is running Veritas 3.5 which requires a rootdg. This system has 3 file systems that are part of this dg. They are seen below. Comment any rootdg entries out of the /etc/vfstab.

    /dev/vx/dsk/rootdg/home
    1048576 35232 950055 4% <mountpoint>

    /dev/vx/dsk/rootdg/disk
    1048576 467462 544827 47% <mountpoint>

    /dev/vx/dsk/rootdg/disk
    1048576 55289 932147 6% <mountpoint>

    These systems are located on this disk slice.

    7
    unassigned wm 5566 – 14086 41.35GB (8521/0/0)
    86709696

    First step is to back these 3 file systems up locally whereever there is room or over NFS mount.

    Export & Unmount

    Unmount any veritas filesystems and export and disk groups.

    Break Mirrors

    At this point I need to break the submirrors off that are on the second system disk. In this case c1t1d0.

    Use the format below

    metadetach mirror submirror

    for example:

    metattach d1 d21

    Keep Veritas from Starting up on Reboot.

    Touch /etc/vx/reconfig.d/state.d/install-db to prevent Veritas from starting up with the box.

    Reboot in Single User mode, Verify that you are booting of off the primary disk. Init 0, boot -s

    Remove the current Veritas packages in the order listed below. (You may encounter addition packages not listed here. If this occurs add these packages to the removal order after VRTSvcsvr and before VRTSvxfs)

      1. VRTSvmdoc
      2. VRTSfsdoc
      3. VRTSvmman
      4. VRTSvrdoc
      5. VRTSvrw
      6. VRTSweb
      7. VRTSobgui
      8. VRTSvmpro
      9. VRTSfspro
      10. VRTSob
      11. VRTSspc
      12. VRTSvcsvr
      13. VRTSordoc (Should
        be Database Edition Only)
      14. VRTSorgui (Should
        be Database Edition Only)
      15. VRTSdbed (Should
        be Database Edition Only)
      16. VRTSvxmsa
      17. VRTSvxfs
      18. VRTSvxvm
      19. VRTSvxlic

    Install San Foundation kit

    (Sol8), make sure that you reconfigure reboot in single user mode

    Step 8: devfsadm -Cv, change to runlevel 2 before next step.

    Step 9: Install new veritas and patch with maint pack 2, then reboot again.

    Step 10: Upgrade disk groups and file systems.

    Upgrading Disk Groups:

    To determine what DG version you are running, you can use the following command

    vxdg -q list <my-dg> | grep version.

    Import your disk groups, and run the following command on each DG, the -T is optional.

    vxdg [ -T version ] upgrade diskgroup.

    Upgrading File Systems:

    To determine what FS version you are running, you can use the command below.

    fstyp -v /dev/vx/dsk/dev/device

    Mount your filesystems and then run the following command

     vxupgrade -n 6 /mountpoint

    Use the format command to create new slices (on disk0) for the 3 file systems listed in step one. Basically split the 41.35gb contained in Slice 7 across Slice 5-7.

    5 unassigned wm 0
    0 (0/0/0) 0

    6 unassigned wm 0
    0 (0/0/0) 0

    7 unassigned wm 5566 – 14086
    41.35GB (8521/0/0) 86709696

    Mount the new slices and copy data from the original mount points to the new mounts.

    Load the partition table from disk one onto disk two.

    Reattach Mirrors.

  • Solaris: How to Resize a Swap Partition….on a disk without any free slices

    First lets detach the swap partition (submirror) on the secondary disk. Where d1 is the metadevice and d21 is the submirror

    #metadetach d1 d21
    d1: submirror d21 is detached
    
    metaclear d21
    d21: Concat/Stripe is cleared
    

    Now lets format Secondary Disk (c1t1d1 in this example)

    Below is the partition table of the disk that I am working with. Slice one will be resized using unallocated disk space. Add 1 to the last cylinder of slice 7 to determine your starting cylinder. In this case my new starting cylinder is 2691.

    Total disk cylinders available: 14087 + 2 (reserved cylinders)
    Part Tag Flag Cylinders Size Blocks
    0 root wm 0 - 824 4.00GB (825/0/0) 8395200
    1 swap wu 825 - 1031 1.00GB (207/0/0) 2106432
    2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312
    3 unassigned wm 1032 - 1038 34.78MB (7/0/0) 71232
    4 var wm 1039 - 1657 3.00GB (619/0/0) 6298944
    5 home wm 1658 - 2070 2.00GB (413/0/0) 4202688
    6 stand wm 2071 - 2277 1.00GB (207/0/0) 2106432
    7 stand wm 2278 - 2690 2.00GB (413/0/0) 4202688
    

    Now resize the partition
    In this case I am going to use the rest of the disk, which according to the information for partition two, ends @ cylinder 14087. Subtract 2691 from 14087, to determine how many cylinders your slice is going to be.

    Enter partition id tag[swap]:
    Enter partition permission flags[wu]:
    Enter new starting cyl[825]: 2691
    Enter partition size[2106432b, 207c, 1028.53mb, 1.00gb]: 11396c
    

    Now save this new partition scheme

    Enter table name (remember quotes): my_table
    

    Then label your disk. As you can see below, my swap partition is now huge.

    Part Tag Flag Cylinders Size Blocks
    0 root wm 0 - 824 4.00GB (825/0/0) 8395200
    1 swap wu 2691 - 14086 55.30GB (11396/0/0) 115965696
    2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312
    3 unassigned wm 1032 - 1038 34.78MB (7/0/0) 71232
    4 var wm 1039 - 1657 3.00GB (619/0/0) 6298944
    5 home wm 1658 - 2070 2.00GB (413/0/0) 4202688
    6 stand wm 2071 - 2277 1.00GB (207/0/0) 2106432
    7 stand wm 2278 - 2690 2.00GB (413/0/0) 4202688
    Now lets Swap the Swap
    
    
    First, reinitialize swap submirror.
    metainit d21
    d21: Concat/Stripe is setup
    

    Add swap to new submirror

    \swap -a /dev/md/dsk/d21
    

    View swap

    swap -l
    swapfile dev swaplo blocks free
    /dev/md/dsk/d1 85,1 16 2106416 2106416
    /dev/md/dsk/d21 85,21 16 115965680 115965680
    

    Remove the metadevice from swap

    swap -d /dev/md/dsk/d1
    

    Verify that previous step worked

    swap -l
    swapfile dev swaplo blocks free
    /dev/md/dsk/d21 85,21 16 115965680 115965680
    

    Clear Metadevice/Mirror

    metaclear d1
    Mirror is cleared
    Clear Metadevice/submirror
    metaclear d11
    d11: Concat/Stripe is cleared
    

    Format Primary Disk (c1t1d0 in this example)

    Select a predefined table

    partition> select
    0. original
    1. my_table
    Specify table (enter its number)[0]: 1
    View the partition table, and make sure it looks right.
    
    Total disk cylinders available: 14087 + 2 (reserved cylinders)
    
    Part Tag Flag Cylinders Size Blocks
    0 root wm 0 - 824 4.00GB (825/0/0) 8395200
    1 swap wu 2691 - 14086 55.30GB (11396/0/0) 115965696
    2 backup wm 0 - 14086 68.35GB (14087/0/0) 143349312
    3 unassigned wm 1032 - 1038 34.78MB (7/0/0) 71232
    4 var wm 1039 - 1657 3.00GB (619/0/0) 6298944
    5 home wm 1658 - 2070 2.00GB (413/0/0) 4202688
    6 stand wm 2071 - 2277 1.00GB (207/0/0) 2106432
    7 stand wm 2278 - 2690 2.00GB (413/0/0) 4202688
    
    Label disk
    partition> label
    Ready to label disk, continue? y
    

    Put things back the way they were.

    Reinitialize the swap submirror on the primary disk

    metainit d11
    d11: Concat/Stripe is setup
    

    Reinitialize Metadevice Mirror

    metainit d1
    d1: Mirror is setup
    
    Add the metadevice to swap
    swap -a /dev/md/dsk/d1
    

    … and verify that it took

    swap -l
    swapfile dev swaplo blocks free
    /dev/md/dsk/d21 85,21 16 115965680 115965680
    /dev/md/dsk/d1 85,1 16 115965680 115965680
    

    Remove the submirror that you added to swap in the step above

    swap -d /dev/md/dsk/d21
    

    Reattach Submirror d21 to Mirror d1

    metattach d1 d21
    d1: submirror d21 is attached
    

    Redefine dump device

    dumpadm -d swap
    Dump content: kernel pages
    Dump device: /dev/md/dsk/d1 (swap)
    Savecore directory: /var/crash/blahblah
    Savecore enabled: yes
    

    Related articles

    SwapFaq’s
    Repartitioning a Linux Cloud Server
    HomeLab: Cisco Switch Boot Alternate IOS Image
    Solaris 9 Scan for New SAN Luns & and Vertias Volume Manager Quick Start
  • AIX Logical Volume and Disk Management Commands

    Quick Commands:

    lslv <logical volume> [-l,
    m]

          
          Lists information about the
    logical volumes.  The -l option lists the disks in the logical
    volume.

    lspv <physical volume>
    [-l, M, p]

          
          Lists the disks on the server,
    including the physical volume will give details about that disk.
    The -l option will list the details of how the filesystems are
    distributed on the disk.

    lsvg <volume group> [-l]
    Lists the volume groups on the
    server, including the volume group name will give details about that
    vg.
    The -l option will list the logical volumes in the volume group.

    lsvpcfg
          
          Lists each vpath and the hdisks
    that make up the vpath

    exportvg <volume
    group>

          
          removes a volume group from a
    machine

    extendvg <volume group>
    <physical volume>

    Adds a new physical volume to an
    existing volume group

    importvg -y <volume group>
    <physical volume>

    add a
    volume group to another machine

    reducevg <volume group>
    <physical volume>

    Removes a physical volume from
    a
    volume group

    lsdev -C -c disk
    lists available disks (and the hdisk#) on the server

    lscfg -vl hdisk

    Shows advanced information on a disk

    rmdev -dl hdisk#

     remove a disk

    Sample Procedures:

    Check to see if  all of the
    logical volumes in a volume group are
    mirrored

    • lsvg -l <vg_name>

    Procedure to find disks/vpaths that
    are unallocated

    • lspv|grep None
      • This will show pvs and whether they are asssociated with a
        volume group
      • Note:  For vpaths, the hdisks will show as none, but they
        may be allocated to a vpath – you must grep each hdisk with the lsvpcfg

    Procedure to make a new lun available
    to AIX

    • Allocate the new lun on the SAN
    • Run "cfgmgr"
    • Verify the new vpatch/hdisk by running "lsvpcfg"
      • There should be a new vpath and it should be available with no
        volume group – if not, rerun cfgmgr
  • Solaris Soft and Hard Limits

    Handle_2

    Hard limits are a kernel-configurable item, and users can’t exceed them. Soft limits are the user defaults, and users can change that using the ulimit program or the limit/unlimit builtins.

    Basically, soft limits can be changed to anything up to the hard limit. Think of soft limits as the warning barrier. When a user reaches the soft limit they will get an warning message but are still allowed to use more space up to the hard limit.

    Also, you can configure the system to set expiration times for users who have exceeded their soft limit. You can set both soft and hard limits. The system will not allow a user to exceed his or her hard limit. However, a system administrator may  set a soft limit (sometimes referred to as a quota), which the user can temporarily exceed. The soft limit must be less than the hard limit.

    Use ulimit -a to check soft limits, and ulimit -Ha to check hard limits. These values will display as open files.

    You can set these values by placing the following entries in /etc/system.

    This will require a reboot

    [code language=”css”]
    set
    rlim_fd_max=8192
    set rlim_fd_cur=256
    [/code]

    Note that rlim_fd_max is the hard limit, and rlim_fd_cur is the current limit (or soft limit)

  • More Sun ok> Prompt Commands

    Topicsun
    Courtesy of a Sun v120.

    Use the following to determine the mac addresses of each interface
    ok>devalias

    The command above returns the following
    rootdisk                 /pci@1f,0/pci@1/scsi@8/disk@0,0
    lom                      /pci@1f,0/pci@1,1/ebus@c/SUNW,lomh@14,200000
    dload                    /pci@1f,0/pci@1,1/network@c,1:,
    net2                     /pci@1f,0/pci@1,1/network@5,1
    net                      /pci@1f,0/pci@1,1/network@c,1
    {truncate}

    Then you can cd to the path for either net or net2 and run the following command
    ok> .properties

    This command returns the following for mac address
    local-mac-address        00 03 ba 96 38 c0

    In this case I was working to troubleshoot a jumpstart install, so I needed to see what mac address was being presented externally.

    ok>printenv

    printenv reveals that local mac address is set to true which means that each network interface presents it own mac. Being that I was plugged into nic 0 on this box i am also able to boot like so.

    ok boot /pci@1f,0/pci@1,1/network@c,1:dhcp – install

    Being specific in this way, I am taking any way chance that I have the mac address incorrect, or am plugged into the correct ethernet port.

    I can verify which port has my link by doing the following from the ok prompt

    ok watch-net
    Internal loopback test — succeeded.
    Link is  — up
    Looking for Ethernet Packets.
    ‘.’ is a Good Packet.  ‘X’ is a Bad Packet.
    Type any key to stop.
    …………

    If I try this on net2 is see that this link is down

    ok watch-net2
    Internal loopback test — succeeded.
    Link is  — down

  • Linux HBA Stuff

    I used this command sequence on RHEL 4 with Emulex HBAs.

    First need to see if the cards were detected. A quick grep shows that the are

    dmesg | grep -i fib
    Emulex LightPulse Fibre Channel SCSI driver 8.0.16.34
    scsi0 : HP FC2242SR 4Gb PCI-e DC  Fibre Channel Adapter on PCI bus 13 device 00 irq 185 port 0
    scsi1 : HP FC2242SR 4Gb PCI-e DC  Fibre Channel Adapter on PCI bus 13 device 01 irq 193 port 1
    scsi2 : HP FC2242SR 4Gb PCI-e DC  Fibre Channel Adapter on PCI bus 17 device 00 irq 193 port 0
    scsi3 : HP FC2242SR 4Gb PCI-e DC  Fibre Channel Adapter on PCI bus 17 device 01 irq 169 port 1

    lsmod
    this shows that the module is loaded
    scsi_mod              145041  6 lpfc,scsi_transport_fc,libata,cciss,usb_storage,sd_mod

    Here are the WWNs of the cards.

    cd /sys/class/scsi_host
    cat */port_name
    0x10000000c951148e
    0x10000000c951148f
    0x10000000c9537434
    0x10000000c9537435

    For Qlogic cards your path is different. Use /sys/class/fc_host for the path

    cd /sys/class/fc_host
    cat host3/port_name
    cat host4/port_name

  • Create a Linux LVM Volume

    TuxThe title may be redundant but the information should still be helpful.

    First Steps

    First thing that you need to do is to determine what your existing /dev/sd devices you have.

     ls /dev/sd*
    /dev/sda  /dev/sda1

    In the step above we can see that we currently have two sd devices.

    Then run the following script called forcelip.ksh, below is the contents of this script so that you can create it on your box.

    #!/bin/ksh

    # Force a LIP on all FC ports and scan for new devices.  Use with caution!
    if [ -z "$*" ]
    then
            HBALIST=`cd /sys/class/fc_host;ls`
    else
            HBALIST="$*"
    fi
    cd /sys/class/fc_host
    for HBA in $HBALIST
    do
            echo "Sending LIP to $HBA..."
            echo "1" > $HBA/issue_lip
    done
    sleep 10
    cd /sys/class/scsi_host
    for HBA in $HBALIST
    do
            echo "Scanning for SCSI devices on $HBA..."
            echo "- - -" > $HBA/scan
    done

    [root@host1 tmp]# ./forcelip.ksh
    Sending LIP to host0…
    Sending LIP to host1…
    Scanning for SCSI devices on host0…
    Scanning for SCSI devices on host1…

    Then do the following

    # ls /dev/sd*
    /dev/sda  /dev/sda1  /dev/sdb

    Now you see the new disk as /dev/sdb.
    You may now proceede.

    How to use LVM in Linux

    Format the disk by using fdisk and label the partition Linux LVM (hex code 8e)

    fdisk /dev/cciss/c0d1

    or

    fdisk /dev/sdb (as in the case above)

    Run partprobe & vgscan to scan all disks for volume groups and rebuild caches

    partprobe
    vgscan

    Initialize the disk or partition(s) for use with LVM

    pvcreate /dev/cciss/c0d1p1

    Create a volume group and include the new partition(s)

    vgcreate mydg_dg /dev/cciss/c0d1p1

    Create the logical volume(s) in the existing volume group (size 10 GB, name v1)

    lvcreate -L 10G -n v1 mydg_dg

    Or if you want to use the whole available space

    lvcreate -l 100%FREE -n v1 mydg_dg

    Build the Linux filesystem on the newly created logical volume(s) (file system type ext3)

    mkfs -t ext3 /dev/mydg_dg/v1

    Create the mount point directory

    mkdir -p /my/mount/v1

    Mount the filesystem

    mount /dev/mydg_dg/v1 /my/mount/v1

    Add the volume(s) information in /etc/fstab

    Useful commands

    To display attributes of volume groups:

    vgdisplay

    To display attributes of physical volumes

    pvdisplay

    To display attributes of logical volumes

    lvdisplay
    pvscan
    ioscan -fnC disk

    How to rename a Volume Group

    Deactivate and active Logical Volumes in the VG that you want to rename
    lvchange -an /dev/my_dg/v1


    Then rename the VG
    vgrename my_dg your_dg

    Reactivate the new Logical Volume
    lvchange -ay /dev/your_dg/v1