Sunday, February 27, 2011

Great Zero Challenge

Don't just throw your old hard disks out (especially if they're still inside a laptop, as this only makes it easier for casual analysis) without first wiping them clean. A long time ago, according to Internet folklore, somebody began the Great Zero Challenge: any professional firm to recover data from a disk written full of zeros would win $40. Not a princely sum, but it was never taken up. To protect your own disk, All You Need To Do(tm) is run this command to copy zeros from the /dev/zero device to your HDD that's going in the skip.

sudo ddrescue -n /dev/zero /dev/sdb zero_log.txt

Saturday, February 26, 2011

Supersize Me

The Mac mini is not a great beast; its 120GB hard drive is very easy to fill. Seeing as it's smaller than my iPod Classic and there's no more space on the computer, I needed to upgrade - I needed to supersize my Mac.

Ingredients:

  • 1x Mac mini
  • 1x instructional video
  • 1x 9.5mm x 2.5" SATA hard drive of suitable proportions (see mine)
  • 2x regular dinner knives (if you're not an art-school dropout with putty knife to hand)
  • 1x spare PC running ubuntu with 2x free SATA ports (you'll watch the video off this too!)


The bit in the middle of the video that's not covered:
Stop the video and shutdown
Take the incumbent drive and your new drive and plug them into the ubuntu box
Work out the device names of each drive and don't confuse their order in the next command
Run sudo ddrescue /dev/sdb /dev/sdc ./sdb_sdc_log.txt (substituting in the correct device names of your drives - you don't want to overwrite the good one with the blank one's zeroes) to copy the incumbent drive's image onto the new drive.
Shutdown when complete. You may want to disconnect the incumbent drive and put it somewhere safe. Boot again. Note that the new drive may have a different device name.
The new drive will be confused. Is it a tiny 120GB or a whopping 640GB? The GPT thinks it's small, which is incorrect. Trying to "print" the partition in parted will present you with the option of fixing this. Do it.
Run sudo parted /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Warning: Not all of the space available to /dev/sdb appears to be used, you can
fix the GPT to use all of the space (an extra 1015822080 blocks) or continue
with the current setting?
Fix/Ignore? Fix
Model: ATA SAMSUNG HM641JI (scsi)
Disk /dev/sdb: 640GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 20.5kB 210MB 210MB fat32 EFI system partition boot
2 210MB 120GB 120GB hfs+ Customer

Sweet. Now fire up the GUI that's found under System>Administration>Disk Utility
Create a new partition from the remaining space.
Shutdown.
Put the Mac mini back together following the steps in the video.
Boot your Mac mini
Resist the urge to open iTunes. Don't open it. Seriously. It will **** things up.
Use the system utilities to format the new partition in identical format to the existing 120GB partition. Name the old partition CODE and the new one DATA.
Move the contents of your Music folder to a new folder on DATA.
When it's complete, open a terminal window
Ensure your music is safely on DATA, and move to your user's home directory
sudo rmdir Music
sudo ln -s /Volumes/DATA/Music Music
You will now have a supersized hard drive, and a symbolic link that allows iTunes to access your music as if nothing has changed.
For the grand finale, open iTunes and play your favourite song.