The value of Partimage

A while ago I started messing around with Partimage.

Partimage is a simple to use piece of backup software which takes a snapshot of a partition and saves it as a file.

The hard disk on the machine I use has a straightforward set of partitions -

Partition 1 contains the Windows Restore files that came installed on the machine.

Partition 2 contains the boot sector.

Partition 3 contains Windows 7.

Partition 4 is an extended partition and contains the Linux install with Swap, Root and Home in their separate partitions.

Naturally to benefit from Partimage you will need an external drive, either networked or USB drive.  I would also highly recommend Ultimate Boot CD (which contains Partimage) for the event that a partition becomes corrupted and the machine becomes unbootable.

When I started experimenting with Partimage, I created backups of the first three in the list above with a view to combining 2 and 3 as one partition and doing a standard Windows install. I abandoned that as there were too many specific drivers required for the machine and it was a lot simpler to leave things as they were.  I rarely use Windows anyway.

A few weeks ago I had a problem with this machine – "No Operating System found".   I tried all the usual tricks but nothing worked.  Then I remembered my experimental backup, so I ran Ultimate Boot CD and reinstated the boot partition from my USB drive.  The restore itself took a matter of seconds and the machine was fixed.

This morning, the same problem occurred – "No Operating System found".  I knew what to do this time and was up and running in a minute or two.

It just goes to show the value of backups.

They are the difference between a working PC and an expensive brick!

How to install Mint beside Windows 7

So you want to install Linux Mint on a PC that already runs Windows?

This is quite a simple task and the only proviso is that you have sufficient spare capacity on your hard disk.  Linux requires about 8Gb for the operating system and you will need some space for all your files, so I would suggest a minimum of 20Gb.

Before we start, back up all your data.  It's very unlikely that anything will go wrong, but just in case…..

First of all you'll need to download Linux Mint (32-bit or 64-bit depending on your processor. Not sure? Use 32-bit).

The difference between MATE and Cinnamon is essentially one of taste – they are different desktops with roughly the same software behind them.

Once downloaded, burn a DVD using the .ISO file.

In Windows, right-click on Computer -

Pic1
(Click any image to enlarge)

Select Mange and click on Disk Management.

Pic2

Here you can see the layout of my hard disk (Disc 0).  It has two partitions: a System Reserved area and the C: drive.  The latter is the one we want to mount Linux in and the top line shows it has 41.19Gb of spare space.  We need to resize that partition to make room for Linux as the latter needs its own file system.

Right click on the area labeled (C:) and select Shrink Volume.

Pic3

After a bit of thought it will pop up a window telling you how much free space you have and giving an area to enter the amount of space to shrink in Mb.  I entered 20000.  Click on Shrink.

Pic4

After a short while it will display the new disk layout.  We now have three partitions – System Reserved, C: and 19.53Gb of Unallocated space.  (I know I entered twenty but it will adjust that to the nearest suitable size).  That Unallocated space is where we are going to install Linux.

Pic5

Place your Linux Mint DVD in your drive and restart (assuming your BIOS is set to boot off a DVD before the hard disk!)

Linux will load and you should see the following -

Pic6

At this stage Mint is running off the DVD.  We want to install it, so double click on the Install icon.  It will ask which language to use.  Select and click Continue.  It will then confirm that you are plugged in (if you're using a laptop), that you are connected to the Internet and that there is enough space available (it reckons 8.1Gb is enough!).  Click continue.

You will now be asked for your preferred Installation Type.  It has detected that there is another operating system and the first option is to install alongside.  This is the quick and dirty method.  The second option is to delete your Windows and use the entire disk.  Do NOT select that!  The bottom option (Something Else) is my preferred one as it gives greater control over how the disk is used.

Pic8

Here we see the disk layout again, with the System Reserved at the top -Windows 7 Loader, followed by the Windows partition, and then the area marked free space at the bottom (Linux reads this now as 20973Mb which is fine).

Pic9

Select the free space and click on the little + button.  We are about to add a Swap partition (all Linux distros require a Swap partition to use as disk memory)

[N.B. See Notes at the bottom of this post regarding partitions and sizes]

I have set the swap size to 2000Mb for the purpose of this exercise. Normally a Swap partition should be equal to around twice the PC's memory, but if the PC has over 2Gb memory then the Swap size isn't so critical).  I have selected "Swap area" in the drop-down list beside "Use as:".

Once that's done, the Swap partition will appear in the window, and naturally the free space has shrunk a bit.  Select the free space again and once more click +.

This time we'll set up the Root area where Linux itself resides.  All operating system files will go in here and it needs around 8 to 10Gb.  I have set this example at 8000Mb.  "Use as:" can default to "Ext4 journaling file system" and the Mount point (very important) is set to /.  Click OK.

Pic11

Our free space is now down to 10973Mb.  Select the free space, and once more click on +.  As we want to use all this space, let the size default.  The only thing to set is "Mount point".  This should be set to "/home".  Click OK.

Your screen should now look like this:

Pic12

Note the second and third columns – it is important that they are correct.  If you have made an error, simply select the errant line and click change.

That's the hard bit done.

Click on "Install Now".

Pic13

You will be brought through a series of screens to select your location, and keyboard (I always find that Mint detects those correctly).  You will be asked for your name, username and the password of your choice and then you can sit back and relax as Mint installs itself.

When it has finished, it will either automatically eject the DVD or as you to remove it.  Reboot and you will see the following screen

Pic14

Arrow down or up to select Windows or Linux and that is it.

 

NOTES ON PARTITIONS AND SIZES

Generally I like to install Linux in three partitions – Swap, Root (/) and Home (/home).  It is quite possible to manage with two where everything is installed in the Root partition but this has one major disadvantage.  Root is where Linux resides, while Home is where all your documents, preferences and settings are held and placing them all on one partition can make reloads problematic.

In the unlikely event that you have to reinstall Linux, simply go through the above procedure, but when it comes to the partition, select / , select "change" and make sure "format partition IS selected.  Then select /home  and make sure "format partition IS NOT selected.  This will give you a fresh install of the operating system but all your documents, settings and preferences will remain intact.  You will have to re-install any extra software but those preferences and settings will remain intact too.

The machine I am using at the moment has 4Gb of memory which is plenty for Linux.  I have therefore set my Swap size fairly low at 3Gb.  I might add, the partition is rarely used!

I have allocated 10Gb for the Root partition to allow for some slack.  Even with all my software loaded, that is currently running at 5.55Gb so there is loads of slack room.

My /home partition is currently set at around 150Gb which is ample for my needs. 

A little tip….  I use a few programs such as audio and video editors that create massive temporary files.  Normally these files will be created in the Root partition, and if the partition is relatively small (as mine is) the programme can easily complain.  The simple fix is to go into the Preferences of these programmes and set the temp filder to a folder in the Home partition.

 

Google Earth and ia32-libs

I recently installed Linux Mint 16 [Petra] RC [64 bit Cinnamon edition] and came across a problem.  This may have been due to the release not being complete, but a search showed that this is quite a common problem.

[Note: since I wrote this piece the final version of Cinnamon was released and it was fixed]

When I tried to install Google Earth I was informed that a dependency – ia32.libs wasn't met, and the installation failed.

Naturally I tried installing the missing library, but apparently it has been depreciated.

Time for a workaround.

I first ensured that libc6:i386 lsb-core were both installed.

Next I downloaded the latest package from Google - google-earth-stable_current_amd64.deb into my Download folder.  I created a sub-folder "GoogleEarth" and using Archive Manager I extracted the contents of the DEB file into GoogleEarth.

I then opened the file GoogleEarth/DEBIAN/control in a text editor and removed the following line

Depends: lsb-core (>= 3.2), ia32-libs [Line 7]

I then created a new package using the command dpkg -b GoogleEarth/ [from within my Download folder].

It took a while, but that created a new file in Downloads called GoogleEarth.deb.

Install that using GDebi Package Installer, and away she goes!

 

Space after WordPress Media Player

Since the arrival of WordPress 3.6 I have ditched the plugin Audio Player in preference to the embedded version.

One less plugin is always a good thing?

One aspect of the new Audio Player that really bugs me though is the way the spacing is wrong top and bottom.  While the player provides a full new paragraph break above, it only provides a line break below which means there is no space between the player and the following text.

After my usual fruitless searches I came up with a solution of my own which seems to work well.

I simply added the following to my theme’s CSS file:

.mejs-audio {
    margin-bottom: 1.5em !important;
}

Of course the spacing can be varied, but I chose 1.5em as it is the theme’s default line height.

Speeding up a WordPress site

One of the top considerations of any web site owner should be speed.

In these days of broadband connections, people are used to near instantaneous results, and a slow loading front page is guaranteed to lose visitors.

There are several factors which control loading time.

One is of course server response times.  There is little that can be done about that!

Then there is the core code of the site.  WordPress is WordPress and there is little or nothing you can do to change it.

There are areas though that are well within the site owner’s control.

The Theme.

The one thing I would say about themes, from the speed perspective is that the more graphic the site, the slower it tends to be.  A graphic rich theme is going to be slow, and it is worthwhile bearing this in mind when making a choice.

Plugins.

Plugins can be a site killer.  I use a plugin on my sites – Plugin Performance Profiler (P3) – which is a good indicator of which plugins are holding the site back.  Using that plugin I have managed to shave seconds off sites’ load times, by either indicating which plugins to remove or which to replace with a slicker version.  In quite a few cases I have managed to find replacement plugins that have exactly the same functionality but are faster to load.

External links.

External links within plugins or extra coding (such as advertising or analysis0 are frequently the cause of sluggish sites, as the server has to wait to connect to those sites before continuing to serve up the rest of the main site.  If your traffic analysis site is having an off day then your site will too.  

As an example, I had a plugin on this site which displayed my blogroll on the sidebar along with their latest posts and date of posting.  Before the page could load, the server had to contact each linked site in turn to retrieve information.  I ditched the plugin and reverted to standard links and shaved 32 requests and several seconds off the load time.

Images.

These are probably the biggest contributors to “gross tonnage” of any site.  Always reduce images in physical size and compression before uploading.  A photograph that is say 3,500 by 2,000 pixels may look stunning but it will weigh many megabytes.  Setting its display size may reduce the visible size but it will still weigh all those megabytes.  If you only want it to appear at say 600 x 400, then reduce it before uploading.  Also compress it as much as possible as many kilobytes can be shaved off an image that way.

Caching.

Caching can have an enormous impact on page load times.  It does so by generating static pages from the normal dynamic ones and therefore cuts way back on database requests, code requests and file loads.  There are several excellent caching plugins which can be found on the WordPress site.  While I haven’t tried all of them, the ones I have tried give facilities to allow code compression and browser caching which help greatly with load times.

A word of warning about caching plugins – I have noticed that Plugin Performance Profiler (see above) tends to give very poor responses for caching plugins.  On closer examination though, the poor response times are almost exclusively within the Admin pages of the site.  One would assume that not many outside visitors are going to reach in there?!