Archive for the ‘Unix Notes’ Category

SARMON, NMON for Solaris

Esse blog mudou para http://blog.kairo.eti.br

This blog has moved to http://blog.kairo.eti.br

Searching about NMON I find the SARMON. This is a great solution for reports of capacity on Solaris.

If you know the NMON (website) for AIX e Linux and need for Solaris you can use the SARMON (website)

For reports you can use the original tool

The installation is very ease

1. Get the .zip file

2. Save on /var/tmp

3. Unzip the .zip

# unzip sarmon_v1.01.bin_sparc.zip

4. Make backup of original files

# cp /usr/bin/sar /usr/bin/sar.orig
# cp /usr/bin/timex /usr/bin/timex.orig
# cp /usr/lib/sa/sadc /usr/lib/sa/sadc.orig

5. Move the sarmon to /usr/local

# mv /var/tmp/sarmon_v1.01.bin_sparc /usr/local/sarmon

6. Copy files

# cp /usr/local/sarmon/sar /usr/bin/sar
# cp /usr/local/sarmon/timex /usr/bin/timex
# cp /usr/local/sarmon/sadc /usr/lib/sa/sadc

7. Edit the crontab and put the entry for collect

0 0 * * * /usr/local/sarmon/sa1 300 288 &

This start collect every day at 00:00

The files generated are in /var/adm/sa/ (day-by-day)

Anúncios

Esse blog mudou para http://blog.kairo.eti.br

This blog has moved to http://blog.kairo.eti.br

How to identify ssd devices on Solaris (MX000 Servers only)

1. Open one SSH on XSCF

Last login: Tue Mar 23 12:22:37 2010 from XXX.YYY.ZZZ.KKKK
XSCF>

2. Open on SSH session on your Solaris Server

Last login: Tue Mar 23 11:35:06 2010 from XXX.YYY.ZZZ.KKKK
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
You have new mail.
[root@MYSERVER ]#

3. Verify your top disks I/O with iostat

Sample:
[root@MYSERVER ]# iostat -xM | grep ssd
ssd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
ssd43 0.0 0.0 0.0 0.0 0.0 0.0 0.9 0 0
ssd50 0.0 0.0 0.0 0.0 0.0 0.0 0.2 0 0
ssd61 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
ssd62 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
ssd148 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
ssd159 0.3 0.6 0.0 0.0 0.0 0.0 2.0 0 0
ssd160 0.1 0.3 0.0 0.0 0.0 0.0 2.4 0 0
ssd201 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
ssd202 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
ssd203 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
ssd296 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0 0
ssd333 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0 0

4. Verify the SSD Devices on XSCF of respective domain of server.

Sample:

# showdevices -a -v 01
01 01-2 ssd201 /dev/dsk/c4t500009740809C55Cd42s2Device being used by VxVM
01 01-2 ssd202 /dev/dsk/c4t500009740809C55Cd41s2Device being used by VxVM

Veritas Volume Manager (VxVM) – DG (Disk Group) Rename

1. Umount all filesystems used

# umount /myfilesystem1
# umount /myfilesystem2

2. Stop all volumes of Disk Group (DG)

# vxdg -g DG_APPS stopall

3. Deport the Disk Group (DG)

# vxdg deport DG_APPS

4. Import Disk Group with new name

# vxdg -n DG_DB import DG_APPs

SUN T2000 firmware update

Pré-requesite: You need a SUN Solaris installed on the hardware.

1. Go to sunsolve.sun.com and make login

2. Access: SunSystem Handbook > Select Category: Servers > (Servers) Select a Product: Sun Fire T2000

Direct link: http://sunsolve.sun.com/handbook_private/validateUser.do?target=Systems/SunFireT2000/SunFireT2000

3. Download the latest Flash PROM Patch (Version used on this note at 11/03/2010: 6.7.8)

4. Create dir /tmp/images

mkdir -p /tmp/images

5. Save the file 139434-05.zip on /tmp/images

6. Unzip the 139434-05.zip file

# unzip 139434-05.zip
Archive:  139434-05.zip
creating: 139434-05/
inflating: 139434-05/sysfw670_README_docs.css
inflating: 139434-05/Sun_System_Firmware-6_7_6-SPARC_Enterprise_T2000.bin
inflating: 139434-05/Sun_System_Firmware-6_7_6-Sun_Fire_T2000.bin
inflating: 139434-05/sysfwdownload.README
inflating: 139434-05/Sun_System_Firmware-6_7-download_SLA_and_Entitlement.txt
inflating: 139434-05/sysfw670_README_docs.html
inflating: 139434-05/sysfwdownload
inflating: 139434-05/Install.info
inflating: 139434-05/README.139434-05
inflating: 139434-05/copyright
inflating: 139434-05/LEGAL_LICENSE.TXT

6. Use the sysfwdownload to download the firmware to the System Controller

# ./sysfwdownload Sun_System_Firmware-6_7_6-Sun_Fire_T2000.bin
.......... (9%).......... (18%).......... (27%).......... (37%).......... (46%).......... (55%).......... (64%).......... (74%).......... (83%).......... (92%)......... (100%)

Download completed successfully.

7. Shutdown the Solaris OS

# shutdown -i0

8. Go to sc (use the #.)

9. Verify the actual version

sc> showhost
Sun-Fire-T2000 System Firmware 6.6.4  2008/07/01 01:59
Host flash versions:
OBP 4.28.9 2008/06/30 21:26
Hypervisor 1.6.4 2008/06/06 04:57
POST 4.28.6 2008/05/23 12:30
sc> showsc -v version
Advanced Lights Out Manager CMT v1.6.4
SC Firmware version: CMT 1.6.4
SC Bootmon version: CMT 1.6.4
VBSC 1.6.4.a
VBSC firmware built Jun  6 2008, 05:01:03
SC Bootmon Build Release: 01
SC bootmon checksum: 4D3BA6C7
SC Bootmon built Jun  6 2008, 05:11:28
SC Build Release: 01
SC firmware checksum: 91C164C1
SC firmware built Jun  6 2008, 16:52:21
SC firmware flashupdate SAT AUG 30 01:53:14 2008
SC System Memory Size: 32 MB
SC NVRAM Version = 14
SC hardware type: 4
FPGA Version: 4.1.10.7

10. Make the flash update
sc> flashupdate -s 127.0.0.1
SC Alert: System poweron is disabled.
......................................................................................................................................................................................
Update complete. Reset device to use new software.

SC Alert: SC firmware was reloaded

11. Reboot the sc

sc> resetsc
Are you sure you want to reset the SC [y/n]?  s
Are you sure you want to reset the SC [y/n]?  y
User Requested SC Shutdown

12. Now, check the actual version

sc> showsc
Sun-Fire-T2000 System Firmware 6.7.6  2009/10/29 16:06
Host flash versions:
OBP 4.30.4 2009/08/19 07:24
Hypervisor 1.7.3.a 2009/10/29 15:50
POST 4.30.4 2009/08/19 07:47
sc> showsc -v version
Advanced Lights Out Manager CMT v1.7.6
SC Firmware version: CMT 1.7.6
SC Bootmon version: CMT 1.7.6
VBSC 1.7.3.a
VBSC firmware built Oct 29 2009, 15:55:58
SC Bootmon Build Release: 01
SC bootmon checksum: B262D0C1
SC Bootmon built Oct 29 2009, 16:05:00
SC Build Release: 01
SC firmware checksum: 8BCE9F20
SC firmware built Oct 29 2009, 16:05:12
SC firmware flashupdate FRI FEB 26 20:18:50 2010
SC System Memory Size: 32 MB
SC NVRAM Version = 14
SC hardware type: 4
FPGA Version: 4.1.10.7

1. The scenario

On my box I’ve two disks from two differents Storage Disk.

Using multipath I’ve this disks
/dev/dm-15 from Storage Disk A (in use)
/dev/dm-28 from Storage Disk B (not in use yet.)

I’ve the Volume Group with name vg_gfs00 on /dev/dm-15
I’ve the Logical Volume with name lv00 on the Volume Group VG_GFS

Looking my outputs pvs, vgs and lvs

PVS output
# pvs
PV         VG          Fmt  Attr PSize   PFree
/dev/dm-15 vg_gfs00    lvm2 a-   278,98G 39,95G
/dev/sda3  rootvg      lvm2 a-   131,47G 86,19G

VGS output
# vgs
VG          #PV #LV #SN Attr   VSize   VFree
rootvg        1  11   0 wz--n- 131,47G 86,19G
vg_gfs00all   8   7   0 wz--n- 278,98G 39,95G

LVS output
# lvs
LV          VG          Attr   LSize
homelv      rootvg      -wi-ao 512,00M
optlv       rootvg      -wi-ao   1,00G
rootlv      rootvg      -wi-ao   1,00G
tmplv       rootvg      -wi-ao   2,00G
usrlv       rootvg      -wi-ao   4,00G
varloglv    rootvg      -wi-ao   8,00G
varlv       rootvg      -wi-ao   4,00G
lv00        vg_gfs00    -wi-ao 239,03G

2. Objective

Implement a mirror on filesystems for high availbility if my Storage Disk A or B crashs.

3. Implementing

a. Make a PV on new disk (/dev/dm-28)

# pvcreate /dev/dm-28

b. Add new volume on the vg_gfs00

# vgextend vg_gfs00 /dev/dm-28

c. Make a mirror on Logical Volume

# lvconvert -m1 vg_gfs00/lv00 /dev/dm-28
vg_gfs00/lv00: Converted: 17,1%
vg_gfs00/lv00: Converted: 34,1%
vg_gfs00/lv00: Converted: 51,0%
vg_gfs00/lv00: Converted: 68,4%
vg_gfs00/lv00: Converted: 85,5%
vg_gfs00/lv00: Converted: 100,0%

Note: If your LV are in more PVs you can specify all PVs
Sample:

# lvs -a -o +devices | grep lv00
lv00          vg_gfs00 -wi-ao  10,00G     /dev/dm-15(0)
lv00          vg_gfs00 -wi-ao  10,00G     /dev/dm-16(123490)

In this case dm-15 and dm-16 are on my Storage Disk A, I need two disks on the Storage Disk B, sample dm-28 and dm-29.
For convert I use this
# lvconvert -m1 vg_gfs00/lv00 /dev/dm-28 /dev/dm-29

d. Checking Mirror with lvs -a -o +devices

# lvs -a -o +devices | grep vl00
lv00            vg_gfs00 mwi-ao  10,00G       lv00_mlog 100,00         lv00_mimage_0(0),lv00_mimage_1(0)
[lv00_mimage_0] vg_gfs00 iwi-ao  10,00G                                /dev/dm-15(10242)
[lv00_mimage_1] vg_gfs00 iwi-ao  10,00G                                /dev/dm-28(14086)

Looking details:

lv00 is a lv00_mlog and have a 100% of sync to lv00_mimage_0 and lv00_image1.
The lv00_mimage_0 is stored on /dev/dm-15
The lv00_mimage_1 is stored on /dev/dm-28

Looking with a simple lvs

# lvs
LV          VG          Attr   LSize  Origin Snap%  Move Log              Copy%  Convert
homelv      rootvg      -wi-ao 512,00M
optlv       rootvg      -wi-ao   1,00G
rootlv      rootvg      -wi-ao   1,00G
tmplv       rootvg      -wi-ao   2,00G
usrlv       rootvg      -wi-ao   4,00G
varloglv    rootvg      -wi-ao   8,00G
varlv       rootvg      -wi-ao   4,00G
lv00        vg_gfs00    -wi-ao 239,03G              lv00_mlog 100,00

If the lv00_mlog is not 100% you have a problem with one of disks.

4. Documentation:

* http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Cluster_Logical_Volume_Manager/
– 2.3.3. Mirrored Logical Volumes
– 4.4.1.3. Creating Mirrored Volumes
– 6.3. Recovering from LVM Mirror Failure

1 – Creating the Volume Group

# pvs
PV         VG     Fmt  Attr PSize  PFree
/dev/sda3  rootvg lvm2 a-   62.75G 38.97G
/dev/dm-10        lvm2 --   70.00G 70.00G
/dev/dm-13        lvm2 --   70.00G 70.00G
/dev/dm-14        lvm2 --   70.00G 70.00G
/dev/dm-9         lvm2 --   70.00G 70.00G

# vgcreate vg_cluster00 /dev/dm-10 /dev/dm-13  /dev/dm-14 /dev/dm-9
Volume group "vg_cluster00" successfully created

# pvs
PV         VG          Fmt  Attr PSize  PFree
/dev/dm-10 vg_cluster00 lvm2 a-   70.00G 70.00G
/dev/dm-13 vg_cluster00 lvm2 a-   70.00G 70.00G
/dev/dm-14 vg_cluster00 lvm2 a-   70.00G 70.00G
/dev/dm-9  vg_cluster00 lvm2 a-   70.00G 70.00G
/dev/sda3  rootvg      lvm2 a-   62.75G 38.97G

# vgs
VG          #PV #LV #SN Attr   VSize   VFree
rootvg        1   9   0 wz--n-  62.75G  38.97G
vg_cluster00   4   0   0 wz--n- 279.98G 279.98G

2 – Creating the Logical Volumes

# vcreate -L180G vg_cluster00 -n lvuserapp

3 – Making the Cluster

Particulary I like system-config-cluster

This is my simple /etc/cluster/cluster.conf

<?xml version="1.0"?>
<cluster alias="CLUSTER00" config_version="23" name="CLUSTER00">
<fence_daemon post_fail_delay="0" post_join_delay="3"/>
<clusternodes>
<clusternode name="node001" nodeid="1" votes="1">
<fence>
<method name="1"/>
</fence>
</clusternode>
<clusternode name="node003" nodeid="3" votes="1">
<fence>
<method name="1"/>
</fence>
</clusternode>
<clusternode name="node004" nodeid="4" votes="1">
<fence>
<method name="1"/>
</fence>
</clusternode>
<clusternode name="node002" nodeid="2" votes="1">
<fence>
<method name="1"/>
</fence>
</clusternode>
</clusternodes>
<fencedevices/>
</cluster>

4 – making gfs2 filesystems

# mkfs -t gfs2 -p lock_dlm -t CLUSTER00:lvuserapp -j 8 /dev/vg_cluster00/lvuserapp

5 – mounting GFS2 filesystems

Put on the /etc/fstab file

/dev/vg_cluster00/lvuserapp      /home/userapp           gfs2    defaults       0 0

6 – Start the cluster services

Note: For complete startup start the service on all nodes.

service cman start
service rgmanager start

7 – Check the nodes

# cman_tool nodes
Node  Sts   Inc   Joined               Name
1   M    196   2009-04-09 11:57:16  node001
2   M    216   2009-04-09 11:57:32  node002
3   M    212   2009-04-09 11:58:02  node003
4   M    214   2009-04-09 11:58:32  node004

8 – mounting the filesystems

Mount filesystems on all nodes

# mount /home/userapp

9 – testing the read/write files on nodes

# touch /home/userapp/teste.txt

Check on all servers if this file exist.

Sources:

Looking my adapters I found fcs0 in diagnose state

# lsdev -Cc adapter
ent0    Available 21-08    IBM 10/100 Mbps Ethernet PCI Adapter (23100020)
ent1    Available 1A-08    10/100 Mbps Ethernet PCI Adapter II (1410ff01)
ent2    Available 14-08    Gigabit Ethernet-SX PCI Adapter (14100401)
ent3    Available 37-08    10/100 Mbps Ethernet PCI Adapter II (1410ff01)
ent4    Available 27-08    Gigabit Ethernet-SX PCI Adapter (14100401)
ent5    Available 3A-08    Gigabit Ethernet-SX PCI Adapter (14100401)
fcs0    Diagnose  2A-08    FC Adapter
fda0    Available 01-D1    Standard I/O Diskette Adapter
mg20    Available 2D-08    GXT130P Graphics Adapter
ppa0    Available 01-R1    CHRP IEEE1284 (ECP) Parallel Port Adapter
sa0     Available 01-S1    Standard I/O Serial Port
sa1     Available 01-S2    Standard I/O Serial Port
sa2     Available 01-S3    Standard I/O Serial Port
sa3     Available 01-S4    Standard I/O Serial Port
scsi0   Available 11-08    Wide/Ultra-2 SCSI I/O Controller
scsi1   Available 11-09    Wide/Ultra-2 SCSI I/O Controller
scsi2   Available 17-08    Wide/Fast-20 SCSI I/O Controller
sioka0  Available 01-K1-00 Keyboard Adapter
siokma0 Available 01-K1    Keyboard/Mouse Adapter
sioma0  Available 01-K1-01 Mouse Adapter

# lsdev -C | grep fsc0
fcs0    Diagnose  2A-08    FC Adapter

Run the ucfgdiag to change this state

# /etc/methods/ucfgdiag -l fcs0

Looking devices

# lsdev -Cc adapter
ent0    Available 21-08    IBM 10/100 Mbps Ethernet PCI Adapter (23100020)
ent1    Available 1A-08    10/100 Mbps Ethernet PCI Adapter II (1410ff01)
ent2    Available 14-08    Gigabit Ethernet-SX PCI Adapter (14100401)
ent3    Available 37-08    10/100 Mbps Ethernet PCI Adapter II (1410ff01)
ent4    Available 27-08    Gigabit Ethernet-SX PCI Adapter (14100401)
ent5    Available 3A-08    Gigabit Ethernet-SX PCI Adapter (14100401)
fcs0    Defined   2A-08    FC Adapter
fda0    Available 01-D1    Standard I/O Diskette Adapter
mg20    Available 2D-08    GXT130P Graphics Adapter
ppa0    Available 01-R1    CHRP IEEE1284 (ECP) Parallel Port Adapter
sa0     Available 01-S1    Standard I/O Serial Port
sa1     Available 01-S2    Standard I/O Serial Port
sa2     Available 01-S3    Standard I/O Serial Port
sa3     Available 01-S4    Standard I/O Serial Port
scsi0   Available 11-08    Wide/Ultra-2 SCSI I/O Controller
scsi1   Available 11-09    Wide/Ultra-2 SCSI I/O Controller
scsi2   Available 17-08    Wide/Fast-20 SCSI I/O Controller
sioka0  Available 01-K1-00 Keyboard Adapter
siokma0 Available 01-K1    Keyboard/Mouse Adapter
sioma0  Available 01-K1-01 Mouse Adapter

# lsdev -C | grep fsc0
fcs0    Defined   2A-08    FC Adapter

Now, I can remove device and your childs for new discover.

ATENTION: This command remove all child and device

# rmdev -dl fcs0 -R
fcnet0 deleted
fscsi0 deleted
fcs0 deleted

For new discover run cfgmgr

# cfgmgr -v

Installing IBM lin_tape on Linux (Red Hat Enterprise Linux)

Steps for install lin_tape and lin_taped

1. Download the lin_tape source and lin_taped from ftp://ftp.software.ibm.com/storage/devdrvr/Linux/lin_tape_source-lin_taped/

lin_tape-X.YY.Z-W.src.rpm.bin
lin_taped-X.YY.Z-rhel[V].arch.rpm.bin

Samples for version 1.20.0-1

lin_tape-1.20.0-1.src.rpm.bin
lin_taped-1.20.0-rhel4.x86_64.rpm.bin

2. Rebuild lin_tape rpm source

# rpmbuild --rebuild lin_tape-X.YY.Z-W.src.rpm.bin

Continuar Lendo »

First you need rpm2cpio

Use

# mkdir /tmp/package
# cp package.rpm /tmp/package
# cd /tmp/package
# rpm2cpio package.rpm | cpio -idv

Posted by Wordmobi