Saturday, August 14, 2010

Affordable accessories for your HTPC

I've finally decided to open up my own online store and sell accessories for a HTPC. I bought a small inventory consisting of HDMI cables, Component cables, SATA cables, USB cables, CAT5 ethernet cables and MicroSD card readers. Nothing will cost more than $10. If I am successful at selling these accessories, I will increase the number of different products I sell.

If anyone is interested in purchasing any of these accessories, you can find them on this Blog to the right of this article or visit www.pcandmoney.com/htpc-store/

Thursday, August 5, 2010

Clone a hard drive with FOSS and dd

Recently, a old co-worker contacted me asking me to fix his computer. Upon examining the computer, I quickly discovered it had a bad hard drive. The hard drive would make various clicking sounds, which signaled to me there was a catastrophic problem. On top of that, BIOS would not detect the hard drive most of the time I tried to boot. It was clear that a new hard drive would have to be purchased. This is were another problem appeared.

I suggested to my old co-worker that I could install Linux on the new hard drive, because the old hard drive could not be detected by the BIOS most of the time, which was the reason for him asking me to fix his computer. That was a major problem because he and his family were using Windows Vista with multiple user accounts and they probably would not be comfortable with Linux. So now my only option was to try to clone the entire old hard drive with bad sectors to a new hard drive, easier said then done.

So now I have two major problems.

Problem 1. Getting the old hard drive with bad sectors to be detected by BIOS.

Problem 2. Make an exact duplicate of the old hard drive that uses Windows Vista.

My solutions to these problems.

Solution 1.
By changing the power cable and unmounting the hard drive from the hard drive cage, I was able to get the hard drive to be detected by the BIOS and fdisk.

Solution 2.
Although I have never cloned a hard drive before, I new it could be a simple task by using free and open source software and command line tools. I  loaded Arch Linux from an external hard drive, ran fdisk -l to discover the device name of the old hard drive and new hard drive, and then used dd to clone the old hard drive. dd is a unix command that copies and converts files. After about 3 hours and 30 minutes the cloning was finished. I uninstalled the old hard drive, so that Vista would not get the two confused. Vista worked on the new hard drive the same as it did with the old. After a reboot and chkdsk there are no problems with the newly cloned hard drive.

Warning!
The new hard drive must be equal to or larger than the old hard drive. If the new hard drive is larger than the old hard drive, the new hard drive will have to be partitioned to equal the size of the old hard drive or dd will use the entire hard drive space when cloning.

Example:
sda =250GB      sdb = 500GB
dd if=/dev/sda of=/dev/sdb, now the computer will see sdb as having only 250 GB of space.


For those interested to know what hard drive I used, it was Western Digital caviar blue WD5000AAKS 500GB for only $45.



Here is a review of steps and commands I used to clone a hard drive.

1. Load Linux from a live CD, USB drive or external hard drive.

2. Run fdisk -l from command line too determine the device name of each hard drive

3. Use dd to clone the hard drive. dd if=/dev/sda of=/dev/sdb
Where sda is the old hard drive and sdb is the new hard drive.
Using the command above will clone everything from sda to sdb
including the sda file size. sdb must be equal or larger than sda
for the cloning to be successful.