The Clone(zilla) Wars

view full story

http://popey.com – Continuing my Mumbuntu saga … Monday 15th Feb Today I was watching the UPS package tracking website to see if/when the Acer Aspire Revo had arrived home. Pretty much as soon as I got through the door I unpacked one of the revos and set it up on my desk and connected to one of the two LCD panels that usually connect to my desktop PC. The plan was to restore the Windows XP and Ubuntu installs onto the 160GB disk on the revo using Clonezilla, having already done the backup yesterday. The Revo has no optical drive, so I used Unetbootin on my desktop PC to write the Clonezilla ISO image onto a 1GB USB stick. Clonezilla is quite a bit smaller than that so you can probably get away with a lower capacity USB stick, but this was one I had to hand, and didn’t mind trashing the contents. Booting the Revo from USB should be fairly straightforward but for some reason pressing F12 during boot to get a ‘boot menu’ doesn’t always work. I had to boot into the BIOS and change the boot order to put USB at the top of the priority list, and disable Splashtop, to reliably make F12 work on boot. Once I had Clonezilla booted and the Revo on the LAN I thought it might be prudent to backup the factory installed stuff on the hard disk ‘just in case’. It would allow me to return it to factory fresh if I ever sold it on or had to return it under warranty. The clone takes up very little space – 1.9GB – there’s no point not doing it. Once cloned I started restoring the clone that I’d taken of the Compaq Revo 250G disk yesterday. This is where it all kinda went a bit wrong. I had assumed that Clonezilla would magically resize down the partitions when going from a 250GB disk to a 160GB one. Sadly this isn’t the case. Clonezilla doesn’t (yet) support going from a one media to a smaller one. I clearly should have read the documentation more here. I tried various options including restoring individual partitions rather than the whole disk, but it was no-go. So I had a bit of a think and formulated a plan. I’d resize the partitions on the source 250GB disk down so that they totalled less than 160GB, then clone it over to the Revos 160GB disk. I didn’t have room on my desk for the Compaq to be booted up to do the partition resizing so I took a different approach. I have a few USB disk caddies kicking around for these kinds of eventualities. Some are SATA, some are USB, one of them does both – which is quite handy. It’s a cheap and cheerful USB caddy but it works reliably enough. I yanked the 250GB disk out of the Compaq Evo – which was very easy – the Evo reminds me of the old IBM PS/2 in that it’s incredibly modular and easy to maintain inside. I attached the disk to the IDE interface on the USB caddy and plugged the USB cable into my laptop. I already had gparted installed on my laptop which is running Ubuntu Lucid (10.04), but if I didnt then I could have easily installed it or grabbed an Ubuntu Live CD off the shelf and used that instead. I fired up gparted and pointed it at ‘/dev/sdb’ (the 250GB disk) and took a look at the layout. As I’ve previously mentioned I split the disk in half, XP on the first 50%, Ubuntu on the second 50%, but what I needed was for both partitions combined to come in less than 160GB – the target disk size. It turns out to be a complex operation including resize down the XP partition, move the Ubuntu partition down (to the left of) the disk, then resize down the Ubuntu partitions (/ and swap) and resize down the extended partition that the Ubuntu partitions sit in, and finally move the extended partition down the disk. All of this can be queued up in gparted, so you basically get the disk looking the way you want before you hit apply to actually ‘make stuff happen’. I chose to resize the Windows partition down to about 55GB and the same for Ubuntu with a little extra for the swap. All of that came in under my target of 160GB, indeed I had some spare, which I could resize up to on the target, or perhaps use as scratch space later. I don’t think it matters having a GB or so free at the end of the disk when in all likelyhood my Mum isn’t going to fill much of the 55GB she has – in either OS. The gparted operations take a long time because there’s a lot of data to munch up and it’s all being done over USB, so it’s now time for bed. Tuesday 16th Feb I woke this morning to discover the gparted operation completed successfully overnight. When I got in from work I figured that I could do a direct disk to disk clone of the 250GB to the 160GB on the Revo rather than backup and restore. So I attached the USB caddy (containing the 250GB disk) to the Revo, booted Clonezilla and kicked it off. Pretty quickly I ended up with everything copied nicely over to the internal 160GB disk. Booting up the Revo from the internal disk resulted in a Grub menu (this is a good thing) and I could select Ubuntu 9.10 and it booted succesfully to the desktop. Everything was detected and just worked. Ubuntu found the wireless adapter and auto selected the open source ‘nv’ video driver. I added the nVidia binary video driver because the Revo has an nVidia ION GPU which is well supported by the binary driver – unlike the nVidia card in the Compaq Evo – which isn’t supported anymore. The whole ‘move an install from one machine to another completely different one’ success with Ubuntu is one of the features that I use infrequently, but when I do, I love that it Just Works. I then tried to boot into XP. Oh dear. Oh deary dear. Now I knew this wasn’t going to be straightforward, but it’s so sad to see an OS just barf on boot because the underlying hardware has changed a bit. I decided not to spend too long lamenting the crap situation and instead chose to reinstall Windows XP directly on the Revo. The Revo has no optical drive though, so I couldn’t stick my Windows XP CD in. USB caddy to the rescue! I yanked the IDE CD-ROM drive out of the Compaq Evo and attached it to the USB caddy in place of the 250GB hard disk. To my surprise the Revo boot menu showed up the “USB NEC CD-ROM” as an option, and I was able to boot from the XP CD. Sadly the XP setup program bluescreened after it loaded up drivers, and after a quick search I discovered there was a BIOS setting that needed changing. There is an option in the BIOS to set the SATA setting which defaults to “AHCI” which causes XP to blue screen. Changing this setting to “IDE” mode and rebooting fixed the issue. I simply followed the same process of installing XP as I did previously, but when it asked me where to install I chose to delete the XP partition and then recreate it – leaving the Ubuntu partitions untouched. My original XP CD is quite old, so it doesn’t have drivers for modern hardware. As I tell people frequently ‘Ubuntu has more drivers for more hardware out of the box than any other OS’ and that includes XP. Obviously Ubuntu is relatively new and my XP CD is years old, so it’s understandable to some degree, but that doesn’t make it any less frustrating. Especially when the XP installer has no way of adding drivers during install without re-spinning the CD – an activity I’m unlikely to do for a one-off computer setup like this Revo. Once XP was installed I had to go and find drivers for wireless LAN, the video card, audio hardware and other onboard devices. This was helped by someone who has gathered all the drivers up into one neat package . It’s a bit worrying to grab a random zip like that for the fundamental drivers for the system, but it seemed to be in use by a number of other Revo users who reported it worked well. If it barfed I could always reinstall again – I’m getting good at that After installing the nVidia drivers from that package I started getting popup errors about nvcpl.dll and some other dll every time I booted into Windows. I don’t know if it’s specific to the above packaged nVidia driver, but I doubt it. I found numerous posts from people claiming to have the issue. Good to see that nVidia drivers are the same bunch of crap on Windows as they are on Linux. One of the other (many) problems with installing XP is that it will trash the master boot record (MBR) which – if it was the only OS on the machine – wouldn’t be a problem for most people. Those of us that dual boot end up with a broken boot loader and the inability to start our favourite OS. Luckily this is all very well known and there’s a nice bit of documentation that details how to fix it. https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows I put an Ubuntu 9.10 Live CD into the CD-ROM drive which was still attached to the USB caddy and booted off it to fix this issue. I ran the grub-install command as outlined on the above page and then rebooted again. I now had a grub menu re-installed and could boot into Ubuntu again. However this now broke my ability to boot into Windows! The grub-install command when run on the Live CD had incorrectly configured the grub boot loader so it couldn’t find the Windows install. There was an error in the grub setup which made it look for Windows on (hd0) when it should be looking on (hd0,1). This was easily fixed by booting into Ubuntu on the hard disk and running grub-install from there. I actually didn’t run grub-install, but sudo apt-get install grub-pc --reinstall which seemed like a good idea at the time. Worked a treat. So at this point I now had a dual-boot Windows XP and Ubuntu 9.10 install running pretty sweet on the little Revo. Time to take a backup with my new best friend, Clonezilla! I have a nice backup of the machine in case things go horribly wrong later. alan@wopr:/media/drobo/images/2010-02-17-00-img_mumbuntu_revo$ ls -lh total 7.0G -rwxr--r-- 1 alan alan 4 2010-02-17 01:28 disk -rwxr--r-- 1 alan alan 8.0K 2010-02-17 01:28 Info-dmi.txt -rwxr--r-- 1 alan alan 16K 2010-02-17 01:28 Info-lshw.txt -rwxr--r-- 1 alan alan 2.4K 2010-02-17 01:28 Info-lspci.txt -rwxr--r-- 1 alan alan 286 2010-02-17 01:28 Info-packages.txt -rwxr--r-- 1 alan alan 10 2010-02-17 01:28 parts -rw------- 1 alan alan 2.0G 2010-02-17 01:04 sda1.ntfs-ptcl-img.gz.aa -rw------- 1 alan alan 2.0G 2010-02-17 01:12 sda1.ntfs-ptcl-img.gz.ab -rw------- 1 alan alan 1.8G 2010-02-17 01:20 sda1.ntfs-ptcl-img.gz.ac -rw------- 1 alan alan 1.3G 2010-02-17 01:28 sda5.ext4-ptcl-img.gz.aa -rwxr--r-- 1 alan alan 37 2010-02-17 00:55 sda-chs.sf -rwxr--r-- 1 alan alan 31K 2010-02-17 00:55 sda-hidden-data-after-mbr -rwxr--r-- 1 alan alan 512 2010-02-17 00:55 sda-mbr -rwxr--r-- 1 alan alan 466 2010-02-17 00:55 sda-pt.parted -rwxr--r-- 1 alan alan 361 2010-02-17 00:55 sda-pt.sf -rwxr--r-- 1 alan alan 53 2010-02-17 01:28 swappt-sda6.info Interesting that Ubuntu (sda5.ext4-ptcl-img.gz.aa) takes up much less space (1.3G) than the Windows XP (sda1.ntfs-ptcl-img.gz.aa, sda1.ntfs-ptcl-img.gz.ab & sda1.ntfs-ptcl-img.gz.ac) install (2.0+2.0+1.8=5.8G). Tomorrow Mum will be going to the library to see someone about training lessons on the computer. This will be a big moment for her as it will be the first semi-formal training on a computer she’s had. I look forward to hearing from her about how it went. (Distributions)