Wednesday, 13 August 2014

Upgrade SSD without re-installing Windows

Recently I bought a new SSD. Faced with the hassle of reinstalling Windows and all the apps associated I thought there must be a better way. Happily there is and its already documented.

Use Linux and clone the disk across.

Short answer: Attach both disks to machine, doesn't matter how, USB or SATA or both is fine.
  • Boot Linux (Ubuntu 14.04 look for "Try Ubuntu without Installing") 
  • Open terminal and identify disks using "sudo fdisk -l" (warning, make sure this is right or you'll destroy your original disk) - for me, /dev/sda was original, /dev/sdd was new. 
  • Once you *know* you have the right details (double check, this parts dangerous) then clone the disks using "dd if=/dev/oldDrive of=/dev/newDrive". 
Using dd to clone the whole disk (otherwise known as block device) will take the whole partition table and master boot record across to the new disk.

When done, remove the original disk and install the new disk properly, turn on the machine and you're almost done.

Final step: re-size the partition to use the whole space in the new disk

Tuesday, 29 July 2014

pt-query-digest on Windows (Percona Toolkit)

At my current job I am forced to use Windows 7 and do not have access to a Linux virtual machine (I would prefer to use VirtualBox running Ubuntu on my local machine for access to Linux tools).

Instead, to get access to Linux style tools, I have to rely on Cygwin. Cygwin is a great project offering many tools for use within the Windows environment. Percona Toolkit requires Perl, a common scripting language on Linux.

Thankfully, Cygwin provides a Perl interpreter which works well with the Percona Toolkit. You may need some additional packages installed, but this isn't too much hassle using the Cygwin setup program.