December 31, 2011

OSX Hard Drive Recovery

Yesterday afternoon my data drive for OSX had it’s partition table destroyed by OWC’s Mercury Elite Pro hard drive enclosure. They did not mention that even if you decline the OSX initialize disk dialogue, you will still have your partition table over written. You see when you put your drive into this enclosure that hardware need to reformat your drive. You cannot just pop a drive in and enjoy. Thanks to the help of Testdisk, pDisk, and a wonderful tutorial from PerroHunter.com my hard drive was back up and running with about a half hour work of effort. I will outline the steps below, but if you are going to do this definitely check out PerroHunter.com‘s tutorial.

  1. Read through all of the directions below before starting the process. Plus I highly recommend checking out the more detailed tutorial from PerroHunter.com.
  2. Download Testdisk (Free software via Open Source GPL license)
  3. Connect the drive. I used a SATA to usb adapter.
  4. In OSX the dialogue that appears about initializing the drive, choose Ignore.
  5. Open Terminal and navigate to the location of where you downloaded Testdisk to.
  6. Run Testdisk as root. bash#sudo ./testdisk
  7. Choose [Create]. It creates a new log file.
  8. Select the disk you would like to operate on (up/down arrows). For me this was /dev/rdisk1. Press Enter to Proceed
  9. Select the disk partition table type. If you are on OSX, this should be “Mac”. Press Enter to Proceed.
  10. Choose Analyze to find partitions on the drive. Press Enter to continue.
    • An error will likely appear on the next screen saying “Bad MAC partition, invalid block0 signature read_part_mac: bad DPME signature. Do not worry about this.
  11. Press enter to perform a Quick Search.
    1. The following screen is going to tell you the relevant information on where the partition starts and stops. This will allow you to use pDisk to recreate the partition table. Testdisk cannot recreate the partition table as of the writing of this article. It will only allow you to find the information you need to fix the partition table.
    2. Here is an exanmple of the data the Quick Analysis should give you:
      Disk /dev/rdisk1 - 320 GB / 298 GiB - CHS 625142448 1 1
           Partition               Start        End    Size in sectors
      >P HFS                       409640  624880263  624470624
  12. Choose Quite to exit out of Testdisk.
  13. In a new Terminal window enter the command bash#sudo pdisk /dev/rdisk1
    • Replace ”/dev/rdisk1″ with the disk you choose on step 7.
    • You will likely be asked for you password once you hit enter.
  14. You should receive a warning about “No valid block  1 on ‘/dev/rdisk1/’ (or whatever disk you are performing this on)”, do not worry about this.
  15. Press “i” and Enter to confirm block size and some other information. As each line of information appears hit enter until you arrive back at “Command (? for help):”
  16. Hit “c” and Enter to start defining the new partition table. Note that the partition table will not be written until the end.
  17. Using the information from step 11, I am going to define the “First block” as “409640″ per the “Start” heading from the output of Testdisk. Hit Enter to continue.
    • Remember the value 409640 is specific to my device, use the values you receive from Testdisk for your device.
  18. For the “Length in blocks” I will use “624470624″ as defined in the “Size in sectors”  from Testdisk. Hit Enter to continue.
    • Remember the value 624470624 is specific to my device, use the values you receive from Testdisk for your device.
  19. Now enter a name for the partition. This is not reflected as the name of the drive in OSX. Because of this I chose the simple name “one”. Press Enter to continue.
  20. You should now be back at “Command (? for help):”.
  21. Press “w” and hit Enter to write the new partition table to the drive.  pDisk will ask you to confirm the operation before I writes the partition table.
  22. If all goes as planned, your drive will show up shortly either on your Desktop or in Disk Utility. A reboot may be necessary.

Congratulations, you have just repaired a hard rive without paying someone a ton of money or buying expensive tools. If you have any questions feel free to comment below.

~Nathan Hein

November 6, 2011

Arduino Engine Fan Controller

Yesterday I put a good part of my day into taking the next steps of having my Arduino power the cooling fan for my truck. This will likely be the same Arduino that will be the remote start too assuming it can handle multiple operations.  In the video below I demo the functional logic of the circuit with features an automatic temperature based control and a manual push button for those occasional 100* F Summer days. The next step is to wire this circuitry into the existing fan relays and remove the previous circuitry I built. I have nicknamed this project and the Remote GSM Car Starter the S10Duino.

 

~Nathan Hein

November 5, 2011

What a Pitch

Today I stumbled upon the following hilarious pitch for solar energy. I cannot believe how strong the emotional appeal is in this pitch. The pitch drives at many emotional appeals such as the desire for revenge, defeating a giant, to be loved by your family, and to save money.

Just to be clear, I am NOT endorsing this product. In fact I believe it is likely a waste of time and money based off research. This video is just a huge marketing gimmick that I found entertaining.

http://www.homemadeenergy.org/

~Nathan Hein

August 14, 2011

Remote Car Starter

Remoter Starter Diagrams

Remoter Starter Diagrams

Today Matt and I worked on our remote car starter project. We are building a remote car starter using Arduino, an electronic prototyping platform. This is a completely original project, we are not starting with any set of plans or instructions. It is all custom built. The remote starter is going to address the challenge of most reasonably priced remote car starters…that being how to I start the car when I upwards of a 1/4 mile plus away? Or more importantly while I am comfortably sitting at my desk at work or in the lab. We are building our remote starter using a cell phone as the communication device between us and the vehicle. Our short term goal is to be able to start/stop the car by telephone. Long term the platform will be able to handle more complex operations such as texting, responding to queries for information, and preprogrammed operations like running for a set duration.

Today we focused on documenting the necessary logic to safely start the vehicle and gathering information on how we are going to interface with the car. Seeing as these are cars made by GM they do not exactly have an api we can interface with. No the “interface” we will be using is good old analogy signals via copper wire controlled by a digital logic via the Arduino. So once we documented the control logic we worked on identifying our copper interace elements. Thankfully most car’s electrical diagrams can be found online.

Our next steps are to start building our car “API”…in layman’s terms we are going to start soldering wires in that we can wire up to relays that will connect to a DB-9 connecter to interface with Arduino.

~Nathan Hein
Older Posts »