Tuesday, 31 January 2012

Moving from a Hard disk to a SSD (Solid State Drive)

First things first, Do you need an SSD ? If you're reading this post I assume you've got one and the decision has already been made.  If you don't have one the decision making criteria is a little different but equally simple.  It's like the difference between a Ferrari and a Mondeo.  If you like speed and are willing to pay for it then great, buy an SSD, otherwise for the same money you could buy 5+ Mondeo's.

Here is the the process I went through to migrate to a SSD on Windows 7

1.) Remove page file and hibernation file, remove as many documents and files as possible on to external storage and uninstall any programs you no longer need.  Empty Recycle Bin.
2.) Disable system restore (again to save space)
2.) Defragment drive until no fragments remain (http://ultradefrag.sourceforge.net/en/index.html)
3.) Shrink Drive (as much as possible) in Windows 7 (My HDD was 500GB and the SSD was 120GB) until it will fit on the drive
4.) Using Clonezilla backup drive to external storage (you can skip to step 6 if you do a disk-disk copy with an external caddy).  http://clonezilla.org/
5.) Install SSD
6.) Restore backup to SSD via network/USB/esata using clonezilla (Esata is the quickest, then USB, then network)
7.) Re-instate pagefile and hibernation (and system restore if you feel the need).
8.) Disable Defragmentation
9.) Disable file indexing
10.) Enjoy

The above is fairly self explanatory with tutorials on the internet, but some useful tidbits are as follows:

Elevated command prompt
to run an elevated command prompt click on the start button, and in the search box type 'cmd'  you then need to right click on the search result and select 'run as administrator'

Disable hibernation
in an elevated command prompt type 'powercfg /h off' without the quotation marks.  use 'powercfg /h on' to turn this back on again.

Short stroking the drive
There is a train of thought that leaving unpartitioned space at the end of the SSD will prolong it's life.  An SSD potentially has a shorter life span than a hard drive and this may be increased by 'short stroking' the drive.  This means that the wear levelling algorithm used to ensure that the flash chips are used equally has a larger amount of space to do the levelling over.  My opinion is that for the sake of 20gb of my 120gb drive I may as well do it.

Testing Performance: (winsat disk or dd)
Once you have done this process you can use the command 'winsat disk' to test the performance of your drive.  Alternatively if you have a Linux installation (a wise move) you can run bonnie++, hdparm -T or use DD to give you a basic result.

reuse disk in external caddy
I can recommend the following item (£5.10 at time of post) as a caddy for the 2.5" drive that you have removed for re-use.  I tried the cheaper ones and the build quality is dismal.
2-5-inch SATA USB e-SATA HDD Laptop Enclosure Caddy

Useful Links:

performance results of 'winsat disk' for my Corsair Force3 SSD as follows:

Disk  Sequential 64.0 Read                        366.98 MB/s          7.9
Disk  Random 16.0 Read                           154.20 MB/s          7.5
Responsiveness: Average IO Rate              0.44 ms/IO          7.9
Responsiveness: Grouped IOs                    6.68 units          7.7
Responsiveness: Long IOs                         1.02 units          7.9
Responsiveness: Overall                             6.79 units          7.9
Responsiveness: PenaltyFactor                   0.0
Disk  Sequential 64.0 Write                  497.45 MB/s          7.9
Average Read Time with Sequential Writes     0.209 ms          7.9
Latency: 95th Percentile                     0.616 ms          7.9
Latency: Maximum                             39.874 ms          7.9
Average Read Time with Random Writes         0.133 ms          7.9

One large con of doing this change is that currently few, if any, SSD's implement power saving so do not expect your notebook/laptop battery to last ass long as it did before..

Monday, 30 January 2012

Linux Swap File vs Swap Partition

from http://en.wikipedia.org/wiki/Paging#Linux

Interesting piece on swap files from Andrew Morton himself.

.. "From a software point of view with the 2.6 Linux kernel, swap files are just as fast[14][15] as swap partitions. The kernel keeps a map of where the swap file exists, and accesses the disk directly, bypassing caching and filesystem overhead.[15]"

Q.) Does creating the swapfile on a journaled filesystem (e.g. ext3 or reiser) incur a significant performance hit?

A.) None at all. The kernel generates a map of swap offset -> disk blocks at swapon time and from then on uses that map to perform swap I/O directly against the underlying disk queue, bypassing all caching, metadata and filesystem code."

The implication is as follows: "With a 2.4.x kernel swap files were slower than swap partitions, but with the 2.6 kernel a swap file is just as fast as a swap partition."

Of course this depends on the following:

1.) That the swapfile is in contiguous space and therefore not fragmented
2.) That you have any need or desire to use a pagefile. Swap partitions work perfectly well.
3.) You're running a 2.6+ Kernel.

Tuesday, 10 January 2012

Microsoft DISM is rubbish

I've used this a few times and at first glance it seems like the mutts mahoonies. Microsoft have cracked it, awesome. It's built in to the O/S, it's powerful whats not to like. Quite a lot actually. Here are a list of my dislikes.

1.) It takes ages to unmount an image, even with discard. Surely this should take no time, there isn't anything to write to the image ?

2.) Shutting down a machine with a wim attached leaves stray stuff around that it's really difficult to delete. Even the cleanup-wim option seems confused.

3.) It somehow manages to screw up ntfs-3g in Linux. Nice. It's gotta be bad to mess up Linux.

Oh well.