Wednesday, January 23, 2013

Solaris: copy new disk label


Duplicate the label's content from the boot disk to the mirror disk f

root# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c1t0d0s2

root# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2

Wednesday, January 9, 2013

Solaris: move or add new sds device to server


    Look at source server /etc/lvm/md.tab file for metadevice config setting and edit accordingly to new server md.tab. then run #metainit d1000 where d1000 is the metadevice


    old server

    d457 1 1 /dev/dsk/c3t60060E8015320C000001320C00006092d0s0

    new server ( with new metadevice name )

    d1000 1 1 /dev/dsk/c3t60060E8015320C000001320C00006092d0s0

    Reference

    md.tab File Options

      The following md.tab file options are supported:
      metadevice-name
      When the metainit command is run with a metadevice-name as its only argument, it searches the /etc/lvm/md.tab file to find that name and its corresponding entry. The order in which entries appear in the md.tab file is unimportant. For example, consider the following md.tab entry:

      d0 2 1 c1t0d0s0 1 c2t1d0s0
      When you run the command metainit d0, it configures metadevice d0 based on the configuration information found in themd.tab file.
      -a
      Activates all metadevices defined in the md.tab file.
      metainit does not maintain the state of the volumes that would have been created when metainit is run with both the -aand -n flags. If a device d0 is created in the first line of the md.tab file, and a later line in md.tab assumes the existence ofd0, the later line fails when metainit -an runs (even if it would succeed with metainit -a).

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...