Tuesday, September 19, 2017

Living the PI Life - Raspberry Pi startup
First time experience with Raspberry Pi.
For those who may not have heard about The Raspberry Pi - It is a tiny computer on a board that about 1/3 the size of my Iphone 6 +.

These run a variety of operating systems mostly based on Linux varieties.

Here is my experience with the Kit I got from massdrop.com  It looks like most buyers have had problems. I will let you know what I have done to work around them.
The kit included

  • Raspberry PI 3 Model B
  • 8 GB SD card
  • Plastic Pi case
  • Power adapter 
  • 7 inch LED touch screen with controller (HDMI, VGA, Composite)
  • HDMI cable
Not included was
  • 5-12 V power supply for the LCD screen.
  • Useful documentation like pinout for Display wiring
Starting the Raspberry Pi
The Kit box appears to have been provided by Sainsmart.com which is lacking documentation.

My first experience getting the base Pi working I ran into a problem.
The 8Gb SD card did not seem to be formatted even though it seemed to have been opened.
I followed instructions at RaspberryPi.org to  format the provided SD card.
Even after several tries I was unable to produce a working Pi and card. In each case I got only a black screen. I lost a chunk of a day here
For this initial test I was using only the provided power adapter and the HDMI cable connected .

Troubleshooting
After several google searches the best troubleshooting information led me to search for a new SD card to use. I went to Walmart and saw SD cards in the $10 - $16 price range that seemed suitable.
I picked up a SanDisk 16GB (Max Size listed for Pi)
Following the instructions for Noobs install worked perfectly first time.
This got me going and I plugged in my USB keyboard and Mouse.
I did experience a few unexpected resets So I switched the power supply to a Blackberry phone charger I had available.  This make it stable.

LCD screen
I may write more detail on the LCD touchscreen later.
For quick reference: I had to find a surplus AC adapter for this. It used a 5Volt DC 2.5Amp adapter used for a D-Link USB hub. You might find one at in a clearance bin at a electronics or computer store or online.
There was a useful video for this on Sainsmart.com linked to YouTube. My photo below may help.
For the display adapter board I found this documentation It's very limited but may help you get started.
I was able to use this display for Rasberry Pi and also the NES classic SNES classic as a spare display when the TV is busy.

In Summary
This kit was failing in these respects
- Poor quality or defective SD card
- Poor quality power supply
- No power supply provided for the LCD display screen.
The Raspberry Pi itself seems good and the display itself works. I look forward to exploring more.
Here's my photos :


Kit Box

Box open

Contents

Pi in case with HDMI and power connected (sitting on my laptop)

On TV - setting up Raspian from NOOBS

Supplied SD card (left and replacement SD card (right)
Replacement power adapters (Left) Blackberry charger for Pi. (Right) D-Link 5V adapter used to power the screen.


Screen Wiring - Note the orientation of red Wires


Pi with screen wrapped in corrugated plastic for a quick package (and Apple Pie to celebrate)

Friday, June 23, 2017


MegaRaid  Problems - Can't recreate a Logical disk containing a single physical disk after failure.


While working on a disk replacement on an older Oracle (SUN) X4170 M2 we ran into trouble.
In this config there was a raid controller configured with 4 physical hard disks used as 4 logical disks.
No redundancy was configured here. Redundancy was configure using Solaris 10 ZFS layer in zpools.

Here is where it got ugly. When a disk died the MegaRaid logical disk disappeared (No redundancy so that;s expected.)

After disk replacement you need to recreate the logical disk (again expected). MegaRaid however refused to recreate the logical disk. Try as we might it only spit out a generic exit code and Failure message:

# ./MegaCli -CfgLdAdd -r0  [252:1] -a0
                                   
Adapter 0: Configure Adapter Failed
Exit Code: 0x54

Solution is below however a little background on this config.

Normal MegaRaid config:

Logical disks:


 # ./MegaCli -LDInfo -Lall -aALL |egrep 'Virtual|size|State'
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
State               : Optimal
Virtual Drive: 1 (Target Id: 1)
State               : Optimal
Virtual Drive: 2 (Target Id: 2)
State               : Optimal
Virtual Drive: 3 (Target Id: 3)
State               : Optimal

Physical disks:


# ./MegaCli -PDList -aALL |egrep 'Slot|state|Inq'                
Slot Number: 0
Firmware state: Online, Spun Up
Inquiry Data: SEAGATE ST930005SSUN300G06061201Q1ABC        
Slot Number: 1
Firmware state: Online, Spun Up
Inquiry Data: SEAGATE ST930003SSUN300G0E71101471DEF        
Slot Number: 2
Firmware state: Online, Spun Up
Inquiry Data: SEAGATE ST930005SSUN300G06061201Q1LGHI        
Slot Number: 3
Firmware state: Online, Spun Up
Inquiry Data: SEAGATE ST930005SSUN300G06061201Q1LJKL  


So in this case we saw

Logical disks

 # ./MegaCli -LDInfo -Lall -aALL |egrep 'Virtual|State'
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
State               : Optimal
Virtual Drive: 1 (Target Id: 1)
State               : Optimal

Virtual Drive: 3 (Target Id: 3)
State               : Optimal

# ./MegaCli -LDInfo -L2 -aALL
                                     
Adapter 0 -- Virtual Drive Information:
Adapter 0: Virtual Drive 2 Does not Exist.

Replaced disk was now available in Physical disk list

# ./MegaCli -PDList -aALL |egrep 'Slot|state|Inq|Enc'
Enclosure Device ID: 252
Slot Number: 0
Enclosure position: N/A
Firmware state: Online, Spun Up
Inquiry Data: SEAGATE ST930005SSUN300G06061201Q1ABC          
Enclosure Device ID: 252
Slot Number: 1
Enclosure position: N/A
Firmware state: Unconfigured(good), Spun Up
Inquiry Data: SEAGATE ST930003SSUN300G0E71101471ZDEF          
Enclosure Device ID: 252
Slot Number: 2
Enclosure position: N/A
Firmware state: Online, Spun Up
Inquiry Data: SEAGATE ST930005SSUN300G06061201Q1LGHI         
Enclosure Device ID: 252
Slot Number: 3
Enclosure position: N/A
Firmware state: Online, Spun Up
Inquiry Data: SEAGATE ST930005SSUN300G06061201Q1LJKL   


So we should be able to add the new disk back into a logical disk array but it fails:

# ./MegaCli -CfgLdAdd -r0  [252:1] -a0
                                   
Adapter 0: Configure Adapter Failed
Exit Code: 0x54

So after trying a few things with the field engineer replacing the disk. reinserting different slots etc. came my new favorite quote:

                " Friends don't let friends MegaRaid"


But here is the solution:


Any Logical disk with caching enabled retains data that was being written at fail time. So Logical disk 2 cache data was retained. 
Logical disk (LD2) and in fact any new LD could not be recreated when cache was being preserved.


Confirm :


# ./MegaCli -GetPreservedCacheList -a0
                                   
Adapter #0
Virtual Drive(Target ID 02): Missing.
Exit Code: 0x00

Dump cache


# ./MegaCli -DiscardPreservedCache -L2 -a0                                

Adapter #0
Virtual Drive(Target ID 02): Preserved Cache Data Cleared.

Exit Code: 0x00

Try again to recreate LD



# ./MegaCli -CfgLdAdd -r0[252:1] -a0
                                     
Adapter 0: Created VD 2
Adapter 0: Configured the Adapter!!
Exit Code: 0x00

SUCCESS.
Now you can move on to any software configured mirroring etc.

In this case we were able to do a zpool replace command.


A little more background on LSI logic RAID controllers  Using Megaraid, Megacli, Storcli

For comparison sake we have seen similar config issues on Both IBM and Cisco UCS servers. In the case of non redundant (raid0 )logical disks this preserved cache issue can also arise. In the case of Cisco UCS we have seen a more meaningful error appear leading to the solution much quicker:

No doubt the vendor or OS package has a more updated of Megaraid i.e. Megacli64 or storcli.

# ./MegaCli64 -CfgLdAdd -r0[8:13] -a0
                                     

Adapter 0: Configure Adapter Failed

FW error description: 
 The current operation is not allowed because the controller has data in cache for offline 
 or missing virtual disks.  

Exit Code: 0x54

The solution is using the same option -DiscardPreservedCache