Sunday, November 30, 2014

Linux - Extracting a single file from an RPM package

Create a temporary directory

# mkdir /tmp/1
# cd /tmp/1
# rpm2cpio /media/Packages/setup-2.8.14-20.el6_4.1.noarch.rpm | cpio -ivd

Copy the needed file out

Friday, November 7, 2014

Exadata X2-2 / Oracle Sun X4170 M2 - Faulty hard disk on MegaRAID SAS 2108

If you happen to be administrating an Oracle Sun X4170 M2, and should you happen to have the urge to verify that your disks are in proper working order, like I do, you'd do:

# PATH=$PATH:/opt/MegaRAID/MegaCli; export PATH
# MegaCli64 -pdlist -a0 | grep -iE "slot|firmware"
Slot Number: 0
Firmware state: Online, Spun Up
Device Firmware Level: A2B0
Slot Number: 1
Firmware state: Online, Spun Up
Device Firmware Level: A2B0
Slot Number: 2
Firmware state: Failed
Device Firmware Level: A2A8
Slot Number: 3
Firmware state: Online, Spun Up
Device Firmware Level: A2B0

To view more details of the disk [252:2], you'd usually won't be bothered to read all (like I do)

# MegaCli64 -PDInfo -PhysDrv [252:2] -aALL

Enclosure Device ID: 252
Slot Number: 2
Drive's position: DiskGroup: 0, Span: 0, Arm: 2
Enclosure position: N/A
Device Id: 12
WWN: 5000CCA00AB44FEF
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 279.396 GB [0x22ecb25c Sectors]
Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]
Coerced Size: 278.464 GB [0x22cee000 Sectors]
Sector Size:  0
Logical Sector Size:  0
Physical Sector Size:  0
Firmware state: Failed
Commissioned Spare : No
Emergency Spare : Yes
Device Firmware Level: A2A8
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000cca00ab44fed
SAS Address(1): 0x0
Connected Port Number: 3(path0)
Inquiry Data: HITACHI H103030SCSUN300GA2A81029G653XE
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Hard Disk Device
Drive:  Not Certified
Drive Temperature :19C (66.20 F)
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No

Exit Code: 0x00

To view more info of the RAID-5 logical drive

# MegaCli64 -LDInfo -L0 -a0

Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :DBSYS
RAID Level          : Primary-5, Secondary-0, RAID Level Qualifier-3
Size                : 835.394 GB
Sector Size         : 512
Is VD emulated      : No
Parity Size         : 278.464 GB
State               : Degraded
Strip Size          : 1.0 MB
Number Of Drives    : 4
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disabled
Encryption Type     : None
Is VD Cached: No

Exit Code: 0x00

Exadata X2-2 / Oracle Sun X4170 M2 - Locator LED on ILOM 3.0

This is especially useful should you need to arrange for a disk replacement for an Oracle Sun X86 servers in a remote site. Especially when any particular component of the server needs to be replace and this should also ease the assigned Field Engineer to physically locate the server.

# ipmitool sunoem cli "show /SYS/LOCATE"
Connected. Use ^D to exit.
-> show /SYS/LOCATE

 /SYS/LOCATE
    Targets:

    Properties:
        type = Indicator
        ipmi_name = LOCATE
        value = Off

    Commands:
        cd
        set
        show

-> Session closed
Disconnected

To light up the locator LED:

# ipmitool sunoem cli "set /SYS/LOCATE value=fast_blink"
Connected. Use ^D to exit.
-> set /SYS/LOCATE value=fast_blink
Set 'value' to 'fast_blink'

To verify that the locator LED has been light up

# ipmitool sunoem cli "show /SYS/LOCATE"
Connected. Use ^D to exit.
-> show /SYS/LOCATE

 /SYS/LOCATE
    Targets:

    Properties:
        type = Indicator
        ipmi_name = LOCATE
        value = Fast Blink

    Commands:
        cd
        set
        show

-> Session closed
Disconnected

To turn off the locator LED:

# ipmitool sunoem cli "set /SYS/LOCATE value=off"
Connected. Use ^D to exit.
-> set /SYS/LOCATE value=off
Set 'value' to 'off'

-> Session closed
Disconnected