Sector Size on Virtual Machine

Background:

I noticed that on my virtual machines, the number of heads / cylinders on the disk are far larger than would technically be possible

A normal hard drive has 2 heads per platter, and up to 5 platters for a total of 10 heads.

This vm has 255!

root@ubuntu:~# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0002a643

Device Boot Start End Blocks Id System

/dev/sda1 * 2048 40105983 20051968 83 Linux

/dev/sda2 40108030 41940991 916481 5 Extended

/dev/sda5 40108032 41940991 916480 82 Linux swap / Solaris

Question:

41943040 sectors * 512 byte sectors = 21474836480 bytes (21GB)

41943040 sectors / 2610 cylinders = 16,070.130268199 sectors per cylinder (Strange that isn’t divisible evenly)

Apparently further research is needed.

  1. Why do virtual machines have 255 heads?
  2. Why do the number of sectors per cylinder no divide evenly?

If you have any ideas, leave them in the comments.

Arduino Powered Foosball Table

wpid-foosball005-2013-04-15-23-11.jpg  + wpid-foosball008-2013-04-15-23-11.jpg  = Screen Shot 2013-04-15 at 11.57.54 PM

Why Attach an Arduino to a Foosball Table?

– Because the foosball table is clear on the opposite side of the building.

– Because we can!

What are those parts?

– The gold disk is a piezo electric transducer, commonly known as an electric guitar pickup. It converts vibrations into electricity.

– The red circuit board is an Arduino with Ethernet. It uses the standard Arduino library to handle dhcp requests.

– The circuit board is soldered after the knock sensor tutorial on arduino.cc http://www.arduino.cc/en/Tutorial/KnockSensor

– They grey cables are Power Over Ethernet Injectors (POE). They are not required if your foosball table is in reach of a power outlet.

Where can I buy this stuff?

Arduino – http://arduino.cc/en/Main/ArduinoBoardEthernet

POE Cable – https://www.sparkfun.com/products/10759

Piezo Transducer – http://amzn.to/XDxBiT

1 Mega Ohm Resistor – Radio Shack

Circuit board – http://amzn.to/XDxHqM

Headers – https://www.sparkfun.com/products/116

Wire – Your local garbage can

How do I code it?

See the code on github.com/spudstud/Foosball . You will need an account on cosm.com to store your sensor readings. Replace the “Feed ID” with your feed Id, and the “Data-stream” with your data stream name.

You will need to generate a new Private API Key and replace the API key in the code with your own API key.

Cosm.com documents how to get code from an arduino to their servers here: https://cosm.com/support/examples and here: http://arduino.cc/en/Tutorial/PachubeClient

The webpage uses jquery and the cosm javascript library. You can find examples of how to use it in the “Sandbox” directory in github https://github.com/spudstud/Foosball/tree/master/sandbox

The Cosm javascript library is documented here: http://cosm.github.io/cosm-js/ Cosm developers are very active on stackoverflow.com

Once you have the webpage how you want it. You will need to create an ubuntu virtual machine and install apache to host the website. It does not need to be on the same network as your sensor.

I highly recommend setting up your ubuntu web server using vagrant.  http://docs.vagrantup.com/v2/getting-started/index.html

How did you make the webpage so pretty?

The majority of the webpage was coded by a friend who does web development professionally.

The github and “i” icons are actually fonts, not images. http://bit.ly/1190Sjj

The green button is made entirely with css3 and gradients.

The graph is made with cosm’s graph builder http://bit.ly/1181kRM

Only the flat piezo elements work, speakers pulled from computer cases absolutely do not work. http://bit.ly/XOkrSu

What If I want to make my own awesome foosball table, but I have questions?

Leave a comment below

Ask your question on stack overflow and tag “cosm”

Go to the Arduino Forums

Any problems you discovered on the way?

I was going to use a raspberry Pi, but they don’t have analog sensors. Lady Ada has a great article of how to work around this: http://bit.ly/VHTEmS

Arduino Ethernet has 5 analog pins, but pins 4 and 5 are used by the ethernet shield. Pins 0 and 1 are also shared and shouldn’t be used.

What if I want to see pictures and a video of the table?

Here you are!

wpid-foosball009-2013-04-15-23-11.jpg

wpid-foosball002-2013-04-15-23-11.jpg

wpid-foosball003-2013-04-15-23-11.jpg

wpid-foosball004-2013-04-15-23-11.jpg

wpid-foosball006-2013-04-15-23-11.jpg

wpid-foosball007-2013-04-15-23-11.jpg

available unavailable

Youtube

http://youtu.be/hi32JtDzm6I

 

Lack Rack

The Lack Rack

wpid-photo-2013-03-23-20-35.jpg

This is a proof of concept server rack consisting entirely of IKEA coffee tables. 5 Racks in total make for 45 U. The best part is that each coffee table only costs $9 USD

wpid-logo-2013-03-23-20-35.gif

wpid-lack-side-table__57543_pe163125_s4-2013-03-23-20-35.jpg

Which to Buy

If you decide to make your own, pay attention to which size lack rack you get. IKEA strangely offers 2 slightly different sizes

22 inch

and

21 5/8 inch.

The 21-5/8” racks are the exact dimensions of server equipment.

http://www.ikea.com/us/en/catalog/products/40104270/

wpid-imag0296-2013-03-23-20-35.jpg

wpid-photo-4-2013-03-23-20-35.jpg

To keep the tables from sliding off of each other, 3/16 inch holes were drilled in the bottom of each leg and 4 holes were drilled in the top corners. Metal pegs (courtesy of the IKEA) keep everything in alignment

wpid-photo-6-2013-03-23-20-35.jpg

wpid-photo-7-2013-03-23-20-35.jpg

Cost

21-58” IKEA LAC table = 9.99 x 5

16 metal pegs = free from IKEA parts department

Total = $49.95

wpid-photo-3-2013-03-23-20-35.jpg

Final Notes:

This obviously isn’t as sturdy as a real rack. 3 tables is probably the maximum anyone would trust with real equipment. (Assuming the servers aren’t heavy).

Checkout the IKEA Lack coffee table for full length servers

http://www.ikea.com/us/en/catalog/products/00095036/

Reset Cisco 1200 AP

1. Assign computer static ip in same subnet as 10.0.0.x with /8 subnet mask (255.0.0.0.0)

        wpid-systempreferences-2011-10-21-11-3714.png

2. Connect Crossover Cable to Ethernet Port on AP

        wpid-img_0216-2011-10-21-11-3714.jpg

3. Connect Power to AP – Allow 30 seconds to boot up You will have either 1 or 3 green lights

wpid-img_0218-2011-10-21-11-3714.jpg

4 You are now going to continuously hold the ‘Mode’ button down for 30 seconds while performing these other tasks:

        - 10 seconds with power

        - 10 seconds without power

        - 10 seconds with power

        - As you connect and disconnect the power with one hand, Make sure to always keep the ‘Mode’ button pressed down with your other hand

5. Wait until the lights change or about 10 to 15 seconds, then let go of ‘Mod

6. Navigate to 10.0.0.1

wpid-googlechrome-2011-10-21-11-3714.png

Username = Cisco

Password = Cisco

wpid-googlechrome1-2011-10-21-11-377.png

If these steps didn’t work

  1. Power cycle the device, then give it up to 1 minute to start up and try webpage again
  2. Verify you are using a cross-over cable and that the cable is good
  3. Make sure all other network interfaces are turned off on your laptop / desktop, especially wireless. Ensure your computer is not connected to the internet.
  4. Restart your browser if you have changed the state of any network interface cards on your computer. Some browsers tie all traffic to active interface on startup.
  5. Perform reset sequence again waiting 20 seconds between each step.

SSC Spread Spectrum Clocking – Hard Drives

A little known feature on many new hard drives called SSC has caused a lot of people to wonder if they should turn it on.

wpid-screenshot2011-07-07at10-46-14am-2011-08-4-11-252.png

The answer is NO unless you are working as an electrical engineer and are using an oscilloscope nearby, or if you are working on the large hadron collider and can’t have any interference. (If you are working on the large hadron collider please contact me because you are my new best friend).

wpid-sprdspclk-2011-08-4-11-252.gif

A default hard drive emits electrical radiation similar to the green line

A hard drive with SSC enabled would look more like the red line.

I can’t verify this, however supposedly enabling SSC slows down the spin up times of the hard drive thus making it a fraction slower in tests.

Open Source Hardware?

Hackers, modders and makers have always loved the idea of open source software such as linux, because it is the antidote to being owned by ‘The Man’. No one likes the idea of being limited or told how their software should run.

The Open Hardware Summit is the organization behind a radical new idea of ‘open hardware’. What open hardware means is that companies / hobbiests can choose to release the schematics and information of a product to the world free of charge. Anyone is then free to use the designs for their own use, or even in a product that they sell. I will be finishing up the schematics for my word clock and releasing both designs under the Open Hardware license in the next couple of months.

The common paradigm has been to protect your intellectual property to prevent outsiders from making cheeper duplicates of your product. Rather then hide away from those who would like to take your plans, embrace them with open arms.

If you design hardware and want to share it with the world, you can put the Open Source Logo on your designs. The neat part is that until April 15th 2011 anyone can vote what they want the new official logo to be.

Take a look at the candidates and cast your vote here.

wpid-open-hardware-logo-vote-2011-03-31-17-29.jpg

Image credit HackADay.com

Hard Drive Upgrade

My macbook pro came with a tiny 320 gig hard drive. That simply won’t do. Introduce my brand new out of the bag 750 western digital black hard drive. Why western digital black? They are the fastest baddest drives around, that’s why.

wpid-dsc_6702-2011-02-17-19-071.jpg

I opened the bag and started inspecting it. I noticed something funny on the bottom of the circuit board. Corrosion!

wpid-dsc_6709-2011-02-17-19-071.jpg

Notice the blue tint.

wpid-dsc_6710-2011-02-17-19-071.jpg

This had me worried. Arduino recently had a similar quality control problem. I did not want my brand new super fast drive to have issues.

wpid-dsc_6708-2011-02-17-19-071.jpg

I plugged the 750 into an external enclosure, and tried to copy the data. Thats when the errors really started.

wpid-safari-2011-02-17-19-071.png

My cd rom drive was removed so I could cram in a solid state drive

wpid-dsc_6726-2011-02-17-19-071.jpg

I got a strange error that I have never seen before.

wpid-usernotificationcenter-2011-02-17-19-071.png

I simply formatted the drive, and didn’t worry about it.

I opened my favorite copying software “Carbon Copy Cloner” . Again, I got another error. This isn’t looking good

wpid-carboncopycloner-2011-02-17-19-071.png

By this point I was afraid that the drive might have been bad. I gave it a scan with disk warrior. More errors.

wpid-alsoftdiskwarriorreport-2011-02-17-19-071.png

Another strange error.

wpid-drivegenius3-2011-02-17-19-071.png

Great! I am defiantly thinking this drive is bad. I really don’t want to have to wait for a replacement.

wpid-genericexternalmedia-2011-02-17-19-071.png
I heard about a program called Drive Genius. Their software is fantastic. Unfortunately It wasn’t happy either.

wpid-1____drivegenius3-2011-02-17-19-071.png

Ok time for one last effort. Format it again. What’s this? The drive is now a 2.2 tb drive!!??? Great. I am finally getting past the denial and accepting that this drive could be bad.

wpid-diskutility-2011-02-17-19-071.png

Ok time for one last effort before I send the drive back. I borrow my roomate’s agonizingly slow sata to usb adaptor.

wpid-enclosure-2011-02-17-19-071.jpg

SUCCESS!!!!! It worked without a single issue.
The entire drive copied error free.
        I copied some files back and forth, ran a disk integrity check and made sure that it wasn’t a fluke. The USB to Sata adaptor I was using must have had issues. Strange that I could use any other hard drive without incident. Even stranger was that the errors I was getting were at random times throughout the transfer process.

Here is my theory as to why.

The enclosure that I was using was made before the advanced format drives came out. (if you are unfamiliar with Advanced Format, check out this link here). Basically many new drives are using 4000 byte sectors opposed the the traditional 512 byte sectors we have been using since the floppy era.
My old usb to sata drive appeared to work perfectly for a short while before giving random errors.

The apparent corrosion had nothing to do with the errors I was receiving.

Hopefully this helps someone else running into similar problems.

One last step I did was change my icons to a picture of the actual drives.

wpid-littlesnapper-2011-02-17-19-071.png

Update: My drive has been running great for several months now. I would defiantly recommend this drive to a friend as long as they have a high quality sata to usb adaptor to transfer data.