Saturday, June 8, 2013

On Western Digital hard drives, PUIS and Rocket Raid controllers

Disclaimer:  This procedure worked for me.  Use at your own risk.  It uses software not written by me and downloaded randomly off the internet.  If you break something, it isn't my fault.

So a while back I bought 4x1T WD green hard drives (WD10EACS) and a rocket raid 1740 to use with them.  I eventually ended up using them as JBOD (turns out it didnt support hardware raid 5) for a few years with no problems.  This was until I upgraded my server with a motherboard that supported enough sata drives and no longer needed the raid controller.



Turns out, if you ever set staggered spin-up on these drives as I did, it sets some internal flag on the drive to use a thing called PUIS or Power Up In Standby.  This means the drives don't actually start spinning until they receive a request for some data.  Problem is, these particular drives don't support it (or something) and some sort of hack is in place in the rocket raid controller to get around this.  Long story short, none of my drives now work on anything but the RR controller.



This problems is vaguely documented around the web, this
http://forum.hddguru.com/how-reset-puis-drives-after-highpoint-raid-t20208.html
being the most prominent.  It details using various tools and things to get them working again.  After about a day of trial and error, I finally fixed my drives.  To save anyone else the days worth of effort, I've documented my solution here:

Firstly you need to go and find a tool called HDAT2 from http://www.hdat2.com/  download it and create a boot disk for it.
Then a tool called MHDD is needed but you need to inject the bootable ISO with some script files from the above hddguru address.  Problem is, this is quite difficult and requires a floppy drive, or a virtual floppy drive which turns out is quite difficult to use on a 64 bit machine.  Virtualbox and 32bit windows XP to the rescue. After a fair bit of futzing around I finally ended up with a final ISO file that can be burned and booted - the hddguru post doesn't say exactly where one of the bin files needs to go so I had to guess around a bit before getting it right.  Get the bootable ISO from here: https://dl.dropboxusercontent.com/u/3869172/bootable3.iso
If you want to make your own, then just remember that PUIS goies in the scripts dir and off.bin goes into the dir above that.

So boot up with HDAT2  (it will likely take a while to get past the bios and detecting your non spun up hard drives) and you should end up with a command prompt.  Type
HDAT /w
the /w is the important part, this will spin up the drives for you and start the hdat application.  We don't actually need HDAT for anything other than spinning up the drives.  All going well HDAT should now see your drives:



Swap your bootable CD with one MHDD one you downloaded (bootable3.iso).  Reset your computer.  This is important. If you shut down or power off your computer the hdd's will stop spinning and you'll have to start again.  You need to reset.  It should actually be quite quick to get past the BIOS now because the drives will be instantly detected.  Wait for MHDD to start and you should end up with something like this:



Now it is just a matter of selecting which drive is causing you problems (in my case both, well 3 actually but one isn't displaying for some reason - perhaps I was being a bit optimistic trying to do all 3 at once).  Once you select the drive by typing its number and pressing enter, type
.puis
After you accept the disclaimer that pops up, it should all be working again.  DRIVES FIXED!

Now a bonus image of the rig I used to get this all working:



Bonus searching keywords stolen from Hddguru:
Drives not identified in BIOS
WD drives don't spin up after removal from Highpoint RAID 23xx 2300 2310
WD PUIS problem
WD PM2 problem
Reset WD PUIS
How to reset WD PUIS
How to fix staggered spin up problem with drives after highpoint Raid
Invisible drives after highpoint raid
Highpoint RAID makes drives unusable

Friday, May 17, 2013

The Centurion

Have you ever played the brutal drinking game called the Centurion?  It goes like this - have one shot of beer every minute for 100 minutes.  It may not sound like much, but if you think about it, a 30ml shot 100 times is 3 litres of beer in a little under two hours.

Anyway, I've played this a few times and the biggest problem is keeping track of time and who has drank what.  Usually you need a timekeeper who isn't playing to ensure that all drinks are taken and that we drink at the appropriate time.  Well, for an upcoming bucks weekend (mine), I decided to remedy this.

I build it into an old tool case I had lying around.  There are 8 double seven segment displays to keep track of players scores, all driven by 595 chips attached to transistor arrays.  I decided not to use a 7-seg driver chip because it would have been more of a pain to solder.  The 595 and ULN2803 transistor array can pretty much be mounted side-by-side.  Since I didn't etch my own board, this means less point-to-point soldering.

The whole project is driven by an Atmega8 chip and coded via my Linux server.  The main board uses a 195 to read the state of all of the push buttons.  I count overflow interrupts to know when 1 second is up, and have a pause button hidden under a missile switch - you wouldn't want to accidentally pause this game.  I also built in a programmer pin-header to program the atmega chip in situ.

A large double 7segment display is used for the main timer - it actually required 7.something volts to run properly, so that was a pain.  The original plan was to have another of these on the right to count drinks elapsed, but I ran out of time.

I picked up some automotive LED strips as well as a home alarm screamer to notify the players when it's time to drink.  A potentiometer regulates the volume of the screamer, as well as some gaffer tape - it was particularly loud to begin with.  Fun fact - screamers sound weird when you change the amount of current going into them.

The whole deal is powered by a 12v SLA rechargeable battery which sits inside the case.

Misc photos of the whole process with bonus video at the end:

The main-board

Back of the main-board

The timer display

Back of the timer display

One of the scoreboards under construction

One of the scoreboards under construction

Completed scoreboard

Back of a completed scoreboard

Components ready to be mounted

Underside of the base.

Inside of the case - almost complete!

I added some dry-erase stickers so we don't lose track of who is who.

Closed for travel.