I’ve been randomly offline a lot over the last few days. Partially because I’ve been visiting friends and family, partially as I’ve been migrating hard drives in my laptop. Again.
Currently I run Windows XP and Ubuntu Jaunty Jackalope (9.04) – predominantly the latter, though I keep the former around for a couple of utilities and for checking things when I’m doing support. I’ve also decided I want to install the Windows 7 release candidate I downloaded. However, disc space wouldn’t let me do that without ditching one of the other OS‘s so I turned to Amazon and ordered a 160Gb ATA drive (the largest available in 2.5″ format, I think) and an external caddy into which to place the soon-to-be-spare 120Gb device.
The procedure should be simple with the right tools:
- Attach new hard drive via USB
- Mirror internal 120Gb onto USB 160Gb
- Use some partition software to increase the size of data partition, leaving space for Windows 7 install
- Remove 120Gb and swap it with the 160Gb which becomes my internal drive
Of course, these are computers. So it wasn’t going to go smoothly. Especially with the mixed operating systems.
First up, the hard drive enclosure I bought didn’t seem to like the 160Gb drive. If I connected it under Ubuntu, it detected it fine. Windows, however, did not. It “bing”ed to say a USB device had been attached, then never let me see it. Not even through Disk Manager so it wasn’t the fact that it was empty. I couldn’t even create a partition. If I rebooted the machine while the device was attached, the reboot stalled on the BIOS screen.
I disassembled another enclosure I have and tried that with more success. Reboots were fine and the drive was detected under both OSs. Hopefully the new enclosure would have more success with the older 120Gb drive I was soon to have spare.
Next step was to mirror the drive. I tried Paragon Partition Manager’s imaging (which has worked for me in the past), but it kept getting partway through and then rebooting with only a fraction of the drive copied. I began to worry about the new disc, but an attempted surface scan looked like taking 24 hours+.
Instead, I downloaded the (simple and free) Easus Disk Copy program. Burn the ISO onto a CD, reboot with the disc in the drive and away you go.
Slowly. Very slowly indeed.
The initial estimated time was around an hour. The copy eventually took a smidgen under 21 hours.
I had planned on using GParted to shift the partitions around, but it seems it’s not capable of doing this. What I needed to do was to alot roughly half of the increased 40Gb to my FAT32 data partition and leave the rest unallocated so that Win7 could use this when I installed it. So, back into XP and Partition Manager Pro for this task.
Before the repartitioning would complete, I had to run checkdisk on the two FAT32 source drives. On my copy run, it had to come up with read errors. In all, there were 200 and PMP would not continue until these were cleared.
So off I went to play Lego Batman and Guitar Here while the checks and the data migration occured. Finally I had a hard disc with everything organised as required. Phew.
Out with the old, in with the new, reboot… and a screen full of flickering “GRUB“s. No boot menu, no progress. Ah. By moving all the partitions around, I’d shafted GRUB. And possibly the MBR on the boot drive. Here’s where it got technical.
Step one was to repair the MBR and this is where having a bootable CD/DVD with your operating system on is very useful. Laptop manufacturers can burn in Hell if they don’t supply these. If you don’t have one, download it via a Torrent. You’ve paid for a license, there’s nothing wrong in having a copied disc with the software on in case you need to fix it.
Quickly boot off the Windows CD, go to the recovery console, boot into the Windows install on the C: and run one command:
fixmbr
It takes less than a second and on reboot, the PC went right into Windows. A step forward, but still no GRUB so I couldn’t access Ubuntu. Out with the 8.10 CD that I have kicking around, and into a Live session. With a terminal open, the commands to fix things weren’t too hard (thankfully).
sudo grub root (hd0,5) setup (hd0)
Well, it would have been nice if it were that simple. First of all, finding the correct partition to use in “root” takes a little digging.
As I’d jiggled things around, what had been (0,4) in my old setup had been changed to (0,5) – this can be discovered by running the command:
sudo fdisk -lu
Assuming you only have one Linux install, only one of these will be labelled “Linux”. Take the number “x” from the left column “/dev/sdax”.
That gave me (0,5) as I used. However, I then got an “Error 12: Invalid device requested” when running the “setup” command. A lot of digging online got me a solution to this. First “quit” out of the grub program to the command prompt again. Then:
sudo fdisk /dev/sda
At the prompt that comes up, enter “w” (no quotes) and hit return. Then repeat the grub commands listed above.
Finally:
sudo gedit /dev/sda/boot/grub/menu.lst
And ensure all the menu entries are correct. As I said, I had to change all my (0,4)s to (0,5)s.
Save, reboot, clap with glee.
Next step is to install Win7, which is tomorrow’s little job. I fully expect to have to repair GRUB again afterwards. Windows (all versions) has a habit of deciding that all other boot loaders are “wrong” and places itself before them. At least I’m expecting it!

![Reblog this post [with Zemanta]](https://i0.wp.com/img.zemanta.com/reblog_e.png?w=840)
