Friday, 25 February 2011

Cleaning Up a Virtualbox XP Install

(Or frankly just cleaning up an XP install. But then XP natively will have a big chunky disc to spread all of its insanity into, whereas a Virtual XP install will probably be quite restricted.)

I have started using VirtualBox to run XP on my Ubuntu workstation just in case I have any compatibility problems with native Ubuntu programs. Like, for instance, the Exchange Server connection in Evolution. This part seems to have been programmed with all the precision and attention to detail of a Jackson Pollock painting. Want to move a large email to a public folder? "The connection to the Exchange Server has been lost". OK maybe that was a tad ambitious. How about just opening a sodding email? "No chance mate, you're getting the raw HTML of the Outlook Web Access login screen instead".

So an XP guest OS with Outlook installed seems like a good idea to cover the rare occasions when Evolution acts like a total dick. Like Tuesdays. Or Thursdays.

I am no expert when it comes to the arcana of Microsoft licensing, but my case has an official sticker on it with a product key, so I think I am safe running XP on it using that key, albeit as a Virtual Machine. Same goes for the Office suite that came with the machine as well. It isn't being used anywhere else since I wiped the disk and stuck Ubuntu on a couple of years ago.

Or Wednesdays, come to think of it.

Well, happily the installation and activation of both XP and Office went swimmingly. My installation CD was only SP1. I installed SP3 over the top of it, but now I have a large collection of crap in the Windows folder to be used in the unlikely event that I ever want to NOT have SP3 installed. Space in general is a bit of an issue. I have a 40Gb SSD drive in the machine, which is more than fine for Ubuntu, but is slightly pushing it for Ubuntu + XP, even as a VM. I gave the virtual machine a 10Gb HDD, which I think is about the bare minimum for an XP install. After installation of Office and a bit of Proprietary Management Software, it is down to less than 3Gb free. Which is not ideal.

So lets fire up Tree Size Free and have a look at where all the space is going.

Biggest Culprit is the Windows folder with 3.5Gb
Next up is the root folder of C: with 1.5Gb
Next is the User folder with about 1Gb in it.
Lastly there is about half a Gb in Program Files.

Yes that adds up to about 6.5Gb. Where has the remaining half gigabyte gone? Two words. System Restore. Great idea in general, no use on a space limited task dedicated machine if you do regular back ups. To remove this, Start -> Right Click on -> My Computer -> Left Click on -> Properties -> System Restore Tab -> Turn Off System Restore Check Box. It is not that hard is it?

OK, first proper clean up - I had left the installation files for the proprietary software lying on the desktop. Delete = 300Mb back. The rest of the User folder was an archive of emails amounting to a couple of hundred Mb which I uploaded to the server, and the local copy of my exchange emails. Can't do anything about them, or indeed the Program Files. Need those to actual run the applications. Still, we've cleared half a Gb. Lets look at the root of C: next.

It has one big file in it: pagefile.sys. It is a whole 1.5Gb itself. This is the famous windows pagefile which the system uses if windows runs out of RAM. Lets run a basic test by opening all the applications installed. Word, Excel, Outlook and the Proprietary software. Done that, and the pagefile usage barely his 250Mb. So, let's trim back the 1.5Gb pagefile to a more sensible 512Mb to give us some headroom.

To do this we go to Start -> Right Click on -> My Computer -> Left Click on -> Properties -> Advanced Tab -> Performance Settings Button -> Advanced (Again) -> Virtual Memory Change Button. I chose a custom size, starting at 512Mb and limited to 1024Mb. Much more sensible for a machine with 1Gb of ram to start with.

Lastly we have the Windows folder. Most of this we DO NOT WANT TO FUCK WITH. However, there are a number of temporary files that we can get rid of. The reason is that XP keeps the files that were replaced by each update or Service Pack install just in case you want to undo the update. As long as it works, I don't. And, as with the System Restore rational, I will be keeping a backup of the install so I don't need the install to back itself up. This is dead easy with virtual disks - you just make a copy of the disk image somewhere. For instance with this command:

sudo apt-get install p7zip-full
7za a XP_10Gb.vdi.lzma XP_10Gb.vdi

So, what can we get rid of in Windows? There are four main folders that I looked at:

C:\Windows\$NtUninstall[blahblah] <- lots of these
C:\Windows\Driver Cache\I386
C:\Windows\ServicePackFiles\I386
C:\Windows\SoftwareDistribution\Download

The first type are just lots of hidden (Explorer Window -> Tools Menu -> Folder Options -> View Tab -> Show Hidden Files and Folders Radio Button & Uncheck Hide Protected Operating System Files) folders storing uninstall data for most windows updates. It is Completely messy of XP to just dump them in the Windows folder.

The next three folders all store downloaded files that have been installed. You MAY need these again if you are installing any new software. What I did was copy all of the foregoing directories into a backup folder, and then stuck that on my NAS [Network Attached Storage]. Bear in mind that you need to install any outstanding updates before moving these files otherwise the update will break and need to be downloaded again.

Also in Windows is a folder called Installer. Do not mess with this. But if you do want to mess with this, google for msicuu2.exe and use that rather than doing it manually.

Anyway, with that clear out, the Windows folder was reduced from 3.5Gb to 1.7Gb, which is ideal. I now have just under 7Gb free, representing a space recovery of 4Gb on a 10Gb drive. Good Stuff.

There is also a temp folder has appeared in the root of C: called MSOCache. This is apparently a copy of the Office install files - presumably in case I want to install any optional items, or parts I chose not to install to begin with. It is only 100Mb or so, and it also appears in the Disk Cleanup program (Start -> My Computer -> Right Click -> C: -> Properties -> Disk Cleanup Button) so I can clean this up easily at a later date if I want.

Why oh fucking why are the stupid Uninstall, Driver Cache, Service Pack, and Downloaded files not also in the Disk Cleanup program? As Advanced options perhaps? As it stands I will have to go through this lengthy process every so often to clean out these unnecessary files. Pain.

Friday, 18 February 2011

LAP - Accessing NTFS Partitions

Eventually you may want to use your Linux USB system to access a Windows HDD. It won't be a problem if the windows system uses a FAT32 disk, but those things are rare outside USB Keys now. Most windows HDDs will be formatted with NTFS, and that required some tweaking to get my system to talk to it. First of all I needed to recompile the kernel. Yes, really. If you followed my instructions on how to compress your kernel source directory using LZMA then you can just run the following command to uncompress it to the ramdisk. Makes things a bit quicker, but you need a sensible (2G) amount of ram to make this work.

cd /dev/shm
cat /sources/linux.tar.lzma | lzma -d | tar x
cd linux-2.6.32.8
make mrproper
cp /boot/config-2.6.32.8 ./.config
make LANG=en_GB.utf8 LC_ALL= menuconfig

You then go into the Filesystems section and activate NTFS support (including write support) and also turn on Fuse (as a module). You can now exit the menu system. You compile the kernel, make a backup of your old kernel and settings and copy the new kernel into place by running these commands:

make $CORES_TO_USE
make modules_install
cp -v /boot/vmlinux-2.6.32.8-lfs-6.6 /boot/vmlinux-2.6.32.8-lfs-6.6.backup
cp -v /boot/System.map-2.6.32.8 /boot/System.map-2.6.32.8.backup
cp -v /boot/config-2.6.32.8 /boot/config-2.6.32.8.backup
cp -v arch/x86/boot/bzImage /boot/vmlinux-2.6.32.8-lfs-6.6
cp -v System.map /boot/System.map-2.6.32.8
cp -v .config /boot/config-2.6.32.8

You would be best to reboot now, to make sure the new kernel is working. After you get back up and running, you then download the source code for the necessary software in the usual way:

cd /sources/extras
wget http://prdownloads.sourceforge.net/fuse/fuse-2.7.4.tar.gz
wget http://www.ntfs-3g.org/ntfs-3g-2009.4.4.tgz

Now, move to the ramdisk and uncompress and compile FUSE. I am not entirely clear what FUSE is, but it seems to be a bit of software that lets you load weird and wonderful filesystems.

cd /dev/shm
tar -xzvf /sources/extras/fuse-2.7.4.tar.gz
cd fuse-2.7.4
./configure --prefix=/usr &&
make $CORES_TO_USE
make install &&
rm -rf /etc/init.d
cd ..
rm -rvf fuse-2.7.4

The installation is pretty basic. Not sure why it wants to delete the whole of [/etc/init.d] though. Still my LFS install doesn't use that, so hey ho. Next up is the ntfs driver itself:

tar -xzvf /sources/extras/ntfs-3g-2009.4.4.tgz
cd ntfs-3g-2009.4.4
./configure --prefix=/usr --libdir=/usr/lib &&
make $CORES_TO_USE
make install
cd ..
rm -rvf ntfs-3g-2009.4.4

Again, all pretty straightforwards. We just need to make sure it knows where to put its libraries.

You then mount NTFS partitions with:

mount -t ntfs-3g [device] [mountpoint]

Friday, 11 February 2011

Fixing a fucked Grub

If you followed along with my instructions you will have a handy little grub.conf file in your /etc folder. This means that if your grub gets corrupted for whatever reason, it should be a simple matter to get it up and running again. Well, simple for Linux anyway.

Boot from another version of Linux - either from another partition in dual boot, or Live media. Run the command:

sudo fdisk -l

Check the partition ID for the one you want. In my case it was sda7. Now what we want to do is mount the whole of our LFS partition into the filesystem we are currently using. We are then going to chroot (remember that) into that system and effectively reinstall grub, thus:

sudo mkdir /media/problem
sudo mount /dev/sda7 /media/problem
sudo mount -v --bind /dev /media/problem/dev
sudo mount -vt devpts devpts /media/problem/dev/pts
sudo mount -vt tmpfs shm /media/problem/dev/shm
sudo mount -vt proc proc /media/problem/proc
sudo mount -vt sysfs sysfs /media/problem/sys
sudo mount -v --bind /tmp /media/problem/tmp
sudo chroot "/media/problem" /usr/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login

MAKE SURE the contents of /etc/grub.conf match your the partition that you want to fix. If you want to install Grub to sda7 for instance, you want to see [hd0,6] in the .conf file. If you have another bootloader in the MBR of the drive for dual booting, you want BOTH entries for in the .conf file to show [hd0,6] not one at [hd0]. If you installed to a USB Key and are reinstalling Grub on a different machine, the chances that all the partitions are the same number are very very poor indeed. If that is the case you will need to [nano] into the [conf]iguration file to set it right.

grub --batch < /etc/grub.conf

Job is, as they say, a good'un.

Friday, 4 February 2011

LAP - WPA Wireless Security

OK, this one was one of the tasks I set myself at the end of my project last year. I just could not get to grips with the wpa-supplicant documentation. It seemed from reading it that I would have to rebuild my network driver or get a new one or, or, some other bloody stupid thing. Anyway, pleasantly it turned out to be considerably easier than I had lead myself to believe.

So, grab the source code, and move to the ramdisk in the usual way:

cd /sources/extras
wget http://hostap.epitest.fi/releases/wpa_supplicant-0.6.10.tar.gz
cd /dev/shm

Now, we unpack the source code, and build it with these commands. The [defconfig] is a default config file which basically contains all the usual settings that you would use a [./configure] script to set. It is fucking painful to wade through, and was really what put me off this whole endeavour to date. Helpfully, though, with my Compaq Mini, it worked fine with the default settings. i haven't tested it on any other hardware yet, and it may well b0rk if I do.

tar -xzvf /sources/extras/wpa_supplicant-0.6.10.tar.gz
cd wpa_supplicant-0.6.10
cd wpa_supplicant &&
cp defconfig .config
make $CORES_TO_USE
cp -v wpa_cli wpa_supplicant wpa_passphrase /sbin
cd ..
rm -rvf wpa_supplicant-0.6.10

You will notice we did not [make install]. There as no need, we are just installing the three programs that we [c]o[p]ied to [/sbin].

The software also needs a configuration file to work. To connect to a WPA2 enable network with a personal key, you would make the following configuration file:

cat > /etc/wpa_supplicant.conf << "EOF"
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
        ssid="NAME OF NETWORK"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk="VERY SECRET PASSPHRASE"
}
EOF

The NAME OF NETWORK and VERY SECRET PASSPHRASE should be obvious. If you just want to connect to a WEP enabled network, wpa_supplicant can handle that as well. Just make this configuration file instead:

cat > /etc/wpa_supplicant.conf << "EOF"
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
network={
        ssid="NAME OF NETWORK"
        key_mgmt=NONE
        #wep_key0="passphrase"
        wep_key0=HEXCODE
        wep_tx_keyidx=0
}
EOF

Obviously you set the [wep_key0] to whatever you use, either hexcode or passphrase. The [#] operates in the usual way, so that line is blanked out in the example above.

You have the option of putting both the WPA2 and WEP in the same .conf file. What you do is just copy the [network={...}] bit and paste it at the bottom of your .conf file. If you move your laptop/netbook around different locations, you will end of with a list of different network settings. What you then have to do is, at the end of each [network={...}] bit, put a line just before the [}] saying [priority=] and then a number. The software will try the highest numbered networks first, so make sure you give your usual networks the highest priorities.

Incidentally if you want to use WPA rather than WPA2 and you have a Compaq Mini netbook, then as far as my rigorous testing has been able to determine, you are going to have to learn to live with disappointment. I have tried three separate routers, and it just doesn't fucking work.

Lastly we need to create a script to run on boot to run the software:

cat > ~/wifi_wpa_wl.sh << "EOF"
rmmod b43 
rmmod ssb 
rmmod wl
rmmod lib80211
modprobe lib80211
modprobe wl
wpa_supplicant -D wext -i eth1 -c/etc/wpa_supplicant.conf -B
dhcpcd eth1
EOF

You will spot the similarity to the iwconfig wifi script I used in the past. The [-D wext] setting tells the software it can use the standard linux [w]ireless [ext]tensions, and not some fancy driver. These must be installed with the kernel, because I do not remember compiling them. The [i]interface and [c]onfiguration file commands are self explanatory. The [B] option tells it to run as a daemon.

Useful tips:
Run the wpa_supplicant command from the script with -d instead of -B to test the settings and report back error messages. The command:

wpa_passphrase ESSID PASSPHRASE

(where ESSID is the name of your wireless network, and PASSPHRASE is, well, work it out) will output an encrypted version of your passphrase for you to pop into the wpa_supplicant.conf file instead of the clear text. Remember to:

chmod 600 /etc/wpa_supplicant.conf

to protect the file from all but root. You can also run:

wpa_cli status
wpa_cli scan
wpa_cli scan_results

to obtain some self evident information.

Friday, 28 January 2011

get_iplayer 2011

[This Update has now been Updated]

Time, I think, for an update on the get_iplayer situation. For the last few months I have found that my previous instructions work just fine for downloading SD content. They were borked though, for HD content. Which has been a crying shame, because that's the whole sodding point of get_iplayer as far as I am concerned. Want to watch BBC HD content but have an ISP comprised of a larger collection of cocks than the mid-west's bi-annual prettiest rooster award? Tough, your bandwidth will never be enough to watch streaming HD. Unless, of course, you set your alarm for 3 a.m.

So, time for an update, especially when I noticed that my previous and well thought out instructions were being described as out of date. The shame.

I find it is best to start with a vanilla version of Ubuntu when working out how to do stuff like this, otherwise you never know which package you installed six months ago and forgot about is actually essential to the whole enterprise. You then write down a careful list of instructions for someone else to follow who has NOT installed the critical package, and it doesn't sodding work, and you end up looking like a half-wit.

So, best to use the latest Ubuntu LiveCD in a virtual machine for testing purposes. [You can then make sure that everything actually works. If it doesn't the problem is somewhere at your end. If it does work you can go on to try to install the software on your distribution of choice, and enjoy some dependency hell, but knowing all the time that the theory is sound. None of this is necessary, if you want to you can just skip over all the virtualisation stuff and get straight to the software, go ahead.]

A perfectly sensible virtual machine is VirtualBox. You will find the installer package here. Grab the one for your architecture (intel/amd basically). You can even install the Windows version and then run Ubuntu inside the VirtualBox, and follow along with these instructions if you so desire.

If you are running it from Ubuntu, you also need to install the following package to get a screen resolution more than 800x600. This is optional if tiny resolutions do not bother you, or if you remember the time when 640x480 was standard and 800x600 was High-End.

sudo apt-get install virtualbox-ose-guest-x11

Now reboot your host machine (the physical machine you are working on).

When it comes back on, you may need to run the following command to get VirtualBox to work - I need to using Lucid:

sudo modprobe -r kvm_intel

Welcome back Windows people. Next step is to grab the Ubuntu CD from here. 32bit is fine. [I have also tested this with the latest (10th February 2011) daily build of Natty, and it still works fine - in fact the VirtualBox extensions aren't needed to get a decent resolution.] Once that has downloaded, fire up VirtualBox and create a new machine. I gave mine 1024Mb RAM. For our current purposes we will not actually be installing the OS, just testing get_iplayer and friends, so do not bother with a Hard Disk. In my version, that is all that is needed to create the machine, which will of course NOT WORK, because there is no boot media.

So, next click on the machine, and hit the settings button. I then went to the Storage option on the left hand side of the window which pops up. I clicked on the shiny CD with 'empty' next to it, and then in the drop down menu under Attributes on the right hand side I changed it to Primary Master. I then clicked the small CD button next to the drop down menu and choose to use a virtual CD/DVD file. I then just navigated to where ever I downloaded the Ubuntu LiveCD.

Next, to optionally get a better screen resolution, I went back to the middle panel, and clicked on the IDE Controller line and clicked the CD image with the green plus on it to add a new CD drive. I opted to choose a disk, and navigated to

/usr/share/virtualbox/VBoxGuestAdditions.iso

I am not sure where that file will be located on a Windows install, but you can presumably search for it. [I tested this on Windows 7 and it worked fine. The .iso I refer to in stored in the Program Files folder where VirtualBox is installed.] It is not essential for what comes next though - it just make using VirtualBox a nicer experience.

I then fiddled about with some other settings. I activated USB 2.0, and I wanted to us 2D acceleration but that only works on Windows machines. Having done all that I just clicked OK at the bottom right of the window. I then just made sure my Machine was still selected at the left hand side of the window and hit the start button. I chose to try Ubuntu rather than install.

OK. We should now be at the Ubuntu desktop. It is a bit cramped at 800x600. If you are fine with that, just scroll down. If not, mount the Additions CD (just click on it in the places menu) pop open a terminal window and run:

sudo /media/VBOXADDITIONS_4.0.2_69518/VBoxLinuxAdditions.run

It took a few seconds to install and then invited me to restart the machine. That would be DAFT on a live cd, so instead just shut down X:

sudo /etc/init.d/gdm stop

And when the dust has settled, you need to switch to a text terminal screen. You would ordinarily do this with Control + Alt + F1, but if you are using an Ubuntu host, that will just change you to the terminal screen on your host. Instead use the RIGHT Control Key, NO Alt, and hit F1. Now restart X:

startx

Bingo, better screen resolution.

Now, onto get_iplayer. Welcome to people who could not be bother with VirtualBox.

First open a terminal, make sure you have the latest package information and install some software we will be needing:

sudo apt-get update
sudo apt-get install git-core build-essential subversion libssl-dev ffmpeg

If you are playing along at home, you should now be able to paste commands straight into the Virtual machine. [So what is this extra software? 'git-core' and 'subversion' do essentially the same thing. These are programs that let you download software, including source code, from internet sites. The software maintainers are able to keep track of different versions of their software and you can interact with it. All we will be doing is downloading the latest version. 'build-essential' is a collection of tools that let us compile software from source code into executable files and libraries. 'libssl-dev' contains software that needs to be incorporated in the programs we are downloading when they compile. SSL is a secure communication system for the internet, and it is already installed on your machine. However, we need the 'dev'elopment files for it, so that it can get built into the new software. All you have at the moment is the end product. Finally 'ffmpeg' is a powerful command line video converter which is going to be used to convert the downloaded video from flash format to the easier to use .mp4 format.]

Once that software has downloaded, make sure your terminal prompt shows you are in a sensible place. Your home directory is just fine:

ubuntu@ubuntu:~$

If not, change to your home directory by running:

cd ~

Now grab the latest version of get_iplayer by running this command (it will make a directory called get_iplayer in directory you run the command from, which is why we made sure you were in home):

git clone git://git.infradead.org/get_iplayer.git

Move into the directory that was just made and download the latest rtmpdump (which will be downloaded into its own folder much like get_iplayer):
cd get_iplayer
svn co svn://svn.mplayerhq.hu/rtmpdump/trunk rtmpdump

Then move in to the rtmpdump folder and build the software:
cd rtmpdump
make SYS=posix

The [SYS=posix] tells it to build the Linux version, as opposed to Windows or whatever else is possible. I then test ran the rtmpdump program that had been created and got this:

./rtmpdump
./rtmpdump: error while loading shared libraries: librtmp.so.0: cannot open shared object file: No such file or directory

This got no better when I [make install]ed the rtmpdump software. I would prefer to keep everything in [~] home if I can. The error was complaining that it could not find a library. The library was right there in a subfolder, so I just made a link to the Ubuntu library folder:

sudo ln -sv ~/get_iplayer/rtmpdump/librtmp/librtmp.so.0 /lib

I then tested again, and got:

RTMPDump v2.3(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPLERROR: You must specify a hostname (--host) or url (-r "rtmp://host[:port]/playpath") containing a hostname

Which was much better. Now to set up get_iplayer, I dropped back down to the get_iplayer directory, and ran the program once to update its plugins from the net:

cd ..
./get_iplayer

And then I setup the usual preferences I use:

./get_iplayer --prefs-add --modes=flashhd,flashvhigh,flashhigh,flashnormal,iphone
./get_iplayer --prefs-add --flvstreamer "/home/ubuntu/get_iplayer/rtmpdump/rtmpdump"

It was quite happy being told to use rtmpdump under the flvstreamer preference. Job is, as they say, a good'un.

Friday, 21 January 2011

Acronis True Image Home 2011

Through several annoying, and a few heartbreaking, incidents I have learned well the IT lesson that "Data you do not have backed up is data you do not want". So I back stuff up. I back stuff up in a number of ways.

Firstly, I have an external drive from seagate (the clicky clicky special referred to in my post about encryption). It has a 5 year warranty, which is a good sign (and the clicky clicky sound has gone away). On that drive I mirror My Music, My Documents, My Videos, My Pictures and My Dropbox folders. I use Allway Sync for this, and it is pretty good. It is available as a "free" version, but is actually a nagware version, because after you have synced so many files it starts hassling you to buy the full version. It is, however, very intuitive to use. File synchronization software is not, by and large, written by people who have an innate talent for user interface design. When you run Allway Sync it pops up suggestion tip boxes telling you what to click and where to type to do a basic sync. You can completely ignore these if you like, and you will do so once you get to grips with it, but it is very welcome at the start.

With this backup method, what I end up with is a copy of all my data on an external disk. All I need to do is connect up the external drive, fire up Allway Sync and run the saved settings. The length of the backup just depends on how much stuff has changed since the last time I did a backup. It can be very very quick in deed. I am now into the habit of running one everytime I buy some new iTunes music, or upload some new digital photos from my camera. I treat all new material as not really existing until such time as I have run a sync.

It is also worth pointing out that you can set the software up to sync in one direction or both directions. Both directions is useful if you are moving the external drive between machines, where you may be adding data to it from both machines. The two way sync makes sure that every machine has the same data on it as the other machines. Ideal for sharing an iTunes library around the house. If running with a one way sync - just to back up stuff from one machine, you can also choose NOT to replicate deletions, so you keep a copy of all files on the external drive even if you delete them (accidentally!) on the main machine.

The second backup method I use is Dropbox. This allows you to select a folder on your machine which is then replicated on the Dropbox company's servers. If you install the software on another machine you get a copy of the folder on that machine as well. It works with Windows and Linux. I have it installed on every machine I use (netbook, HTPC, Desktop, and both of my work machines). That is a mixture of Ubuntu and Windows 7 machines. I get exactly what it says on the tin - one folder which is on all of those machines.

Dropbox, like AllwaySync, comes in a free version. You get 2Gb of space to use before you have to part with any cash. I just use the free version, and keep the folder contents to the really important stuff. Like, for instance, password safe databases, bitlocker recovery keys and so on. This backup method is very useful because it is off site storage. So if the house burns to the ground, I still have all the data in my dropbox folder. Also, if the dropbox company goes out of business I have all the data in the folder on 5 separate machines in three different buildings. Quite, quite, secure.

The third type of backup I do is to take an image of my system partition on various machines. If you are connected to the internet, you are going to get some sort of problem software installed at some point. Or you are going to change a stupid setting in the OS which is a pain to put right. Or you may just have a good old fashioned hardware failure. The BEST way of resolving the foregoing issues that I have found is not to bother with manuals, or anti-malware programs, but just to say "fuck it" and restore the last working image of the system partition. As a rough rule of thumb every gigabyte of data takes about 1 minute to restore. So if you install windows and a couple of bits of software you are only looking at 10-15 minutes to get back to a fresh working machine. You can EASILY spend that amount of time trying to get rid of whatever rootkit has infected your machine.

The software that I use for this task is True Image Home from Acronis. Unlike the other options I outlined above, this is not free (although there is a free trial). It does a couple of very useful things which made me spend money on it. Firstly, it lets you mount the archives it creates as virtual disks, so if you just want to grab a file or two out of it you can. Secondly, it lets you build a bootable USB stick so you can boot from that and use the software without having installed it. Go on, use Windows Backup to restore an image to a bare metal HDD. Not possible. You need to install Windows FIRST. Also the USB Key approach will happily back up and restore Linux partitions as well.

I had an older version of the software which I had to replace because it did not recognise my SATA connected hard disks. When browsing in the shop, I found two different versions of the 2011 software: a netbook "optimized" version which came on a USB key, and a Desktop version. The Desktop version cost £10 more. Now, I decided that I could put up with the inconvenience of using software designed for a netbook screen on a larger screen in exchange for a ready made USB key and the £10 price difference.

It turns out, however, that when Acronis say netbook "optimized" they actually mean netbook "crippled". Because you see (and it mentions this nowhere on the fucking box) it ONLY WORKS ON NETBOOKS. Yes, the software starts up on the desktop and says to itself, "hang the fuck on, this is not a netbook processor, I am going to go in a huff". The software was therefore completely fucking useless. Apart from on my netbook. Worked fine there.

So back to the shop. Explain predicament. Part with £10. Get full version. Go home. Install full version. Run a system disk backup.

Now, fast forward to last Saturday. I was downloading some hefty multipart files and the machine kept crashing. Odd, I thought. Possibly a hardware issue. I broke out in a cold sweat with thoughts of the Hardware Fuckup trilogy. Thankfully though, it did not seem to be hardware related. All temps were fine, and it kept going for a few more hours before crashing again. Hmm. Quick browse with Malwarebytes Anti-Malware (again the free version) revealed that yes, a nasty infection of something or another had taken hold. Bugger.

First solution is the "fuck it" solution. Fire up Acronis, tell it to restore from the previous Wednesday's backup. It tells me it needs to restart the machine to restore to the system drive. Fine, fine, just get on with it. It restarts ... back into Windows. No sign of a backup being restored. Arse. Next, grab a USB stick, set it up as bootable media and boot from that. Fine. Select archive to restore. It cannot be restore because there may not be enough space left to boot. What. The. FUCK. is that about? This is a mirror of a whole disk. It is not possible to fit more stuff in the image than was on the disk in the first fucking place.

I have never seen this message on earlier version of True Image. So I take a punt and download the trial version of the 2010 software. It complains that the image is corrupted. A Ha! says I. Maybe the error message is some sort of default and actually the archive is bollocksed. So I reinstall the 2011 version and validate the archive. The archive is fine. Fucking arseholes. This must be a backwards compatibility issue. So I then use the 2011 software to convert the archive from True Image format to Windows Backup format, boot to the USB key version 2010 and ... it complains about the image being too big for the blah blah. However, it does at least let me IGNORE THE BULLSHIT ERROR and just restore the image anyway. Which is what it is doing now. [UPDATE] It has now finished and the restore went fine. So if you backup using TIH2011, all you need to do to restore an image is to convert it to a Windows Backup Image, remove TIH2011, install TIH2010, create a USB rescue disk, boot from the same and restore the Windows Backup Image. Simples.

I also discovered a little gem of a bug in the software. I like incremental backups, where only the changes since the last backup are recorded. It lets you keep lots of different versions for relatively little hard disk space. There is only one problem with this option in the 2011 version. It does not fucking work. With one archive, which extends to 2Gb, I watched as it made the first archive file, then a day later made the second (7Kb - no changes), then a day later made the third file (also 7Kb no changes) by OVERWRITING THE FIRST FILE. Fucking brilliant. All data gone. Even when all of the data is demonstrably there it complains about being unable to find the original volumes. Fucking useless. I now have two 7Kb files and no 2Gb data anywhere.

Apparently both of these problems are known in the world of Acronis Users. This has left me fucking pissed off. I have backup software which, at a fairly fundamental level, does not fucking work. If it wasn't bad enough that it overwrites backup files, it also DOES NOT LET YOU RESTORE FROM BACKUPS THAT YOU HAVE MADE. Backup software which just backs up and does not restore IS NOT BACKUP SOFTWARE; it is a useless pile of crap.

I loved the previous version of Acronis I had. I can't even remember where I got it - it may have come bundled with the Seagate. It worked fine. I used it for months doing regular backups of my important stuff, and I did restores from time to time. It just would not detect my SATA hard disks on my new motherboard. Now I have the latest 2011 version which is useless.

Now, what about this Norton Ghost stuff then?

Friday, 14 January 2011

Finding correct Ubuntu packages

I have ranted at length in earlier posts about the hassle of trying to install software from source on Ubuntu. What you end up with is a conflict between the Ubuntu package naming conventions and what the source code developer has put in its error messages. See for instance the texinfo/makeinfo nonsense here.

I have stumbled upon an excellent way to resolve this. What you do is go to http://packages.ubuntu.com, and then scroll down to the "Search the contents of packages" section.

In the "Keyword" box type in the name from the source code error - such as "makeinfo". In the dropdown list next to "Distribution" choose the version of Ubuntu you are running. Then hit "Search".

Hey presto, the third result is [/usr/bin/makeinfo] and the associated package is [texinfo]. Brilliant.