Tuesday, May 04, 2010

Losing My Linux

You may be remember my travails establishing an XP-Win7 dual-booted desktop last fall. So when I upgraded my 60GB laptop harddrive to a 500GB harddrive over Christmas, and wanted to triple-boot it, I knew what to do.

First, I installed XP. It was a clean install, from which I subsequently restored a backup of the 60GB drive, keeping all my computer programs. The XP boot manager is called “ntldr”. I gave this partition 80GB.

Second, I installed Win7. The Win7 boot manager, “BCD”, is backward-compatible with ntldr, which it calls when the XP option is selected. I gave this partition 100GB

Finally, I installed Linux (Fedora). The Linux boot manager is called “GRUB” and in addition to two options for starting Linux (I’m not sure how that happened or what it means), it has an option called “other”, which calls BCD.

Did you follow that?

The Problem.

It turns out that I underestimated how much space I would want devoted to Win7. For several reasons. First, although Linux can see the Win7 partition, the Linux partition is invisible to Win7, so I can’t easily use it to store my growing video library (from which I create iPod Touch copies) . Second, despite its problems, Win7 really does provide the best computing experience, especially its Live Writer blog program and its printer management. Linux, meanwhile, has issues with the screen resolution and both Linux and XP seem very . . . <em>plain</em> by comparison.

The bottom line is that I wanted to expand my Win7 partition at the expense of Linux. As you all know, Windows functionality in this regard is extremely limited. What do do . . . .

First, I downloaded a program called Gparted that advertised itself as being able to shift the partition boundaries. Short answer: it didn’t work on the Windows partitions. But the side effect that it made the Linux partition non-bootable.

Second, since it wasn’t working anymore, and I hadn’t been using it anyway, I went to Windows and deleted the Linux partition. The weird thing was that there were two non-Windows partitions, one of them trivially small, like 100MB, and the other was the 300GB partition. Since I didn’t know what they were for, I did the logical thing and deleted them both. This allowed me to expand Win7 into the empty space.

But when I rebooted, GRUB informed me that it couldn’t find the partition table. Evidently, while GRUB was apparently on one of the remaining Windows partitions, the partition table it needed was not. GRUB’s user’s manual says of the message I was getting, partition table invalid or corrupt: “This is not good.”

I then attempted to use a utility called Testdisk. Testdisk advertises itself as being able to repair or replace partition tables used by GRUB. It also says that it came with Gparted, but I couldn’t find it. So I put my own copy on a usb drive and then used the installation media for Windows 7 to obtain a command prompt at which to run it. I was told that the program was incompatible with that version of Windows. So I used my installation media for WinXP, but depending on which disk I used, I either was told that I needed an administrator password (which I didn’t seem to have) or that I was restricted to the OS command set and not allowed to run any programs.

Finally, I said, screw it, and I installed Win 7 again in the empty space left over from the Linux partition. This reasserted BCD primary control over the boot process, and allowed me to boot both the older and the newer installations of Win7.

When I look at the the Win7 disk manager, I see that when I am running the older Win7 installation, that partition is labeled “System, Boot, Page File, Active, Crash Dump, Primary Partition”. I assume this means that I can delete the second installation because the new boot manager and partition table is securely on the old Win7 partition.

The remaining problem is: XP won’t boot anymore. The new boot list displayed by the new BCD installation showed only my new and “old” Win7 options. I used a program called EasyBCD to edit the partition list and add an option for XP, but I can’t seem to connect that option with the actual XP location.

On a positive note: for some mysterious reason, the “hibernate” function now works. Also on a positive note, my new Win7 installation starts up using only about 600MB of memory, more than the mere 400MB that XP requires, but a lot less than the 1.4GB that the older installation presently demands. Somewhere that is a lot of extra crap being loaded into memory that I can probably get rid of if I can find it.

5 comments:

Anonymous said...

Why did you need the extra space for Win7? If it wasn't for applications, my advice would be to keep a separate partition for non-system files. Something like 30GB for each OS and then 375GB for a data partition for data files. Or 50 per OS and 315 for data. Rarely will you need more than 30, though.

Dr. Φ said...

That's not a bad idea. I guess the applications created data directories in the same partition. I could have worked around that, I guess, but at some point I thought it would be easier to add space to the win7 partition. (Didn't work out so great.)

Anonymous said...

In my experience, which is dated, trying to alter partitions (even with commercial software dedicated to that purpose) is always somewhat risky. A while back the late, great Partition Magic made a whole slew of files on a partition inaccessible.

I thought that maybe the more recent software was better, but I wouldn't trust it with a partition with data on it. Sounds like for your purposes you didn't have any sensitive data on there that didn't exist elsewhere (or little enough of it that you could have backed it up) so it was probably worth a shot. Sorry it didn't work out.

Anonymous said...

I thought even Vista had a built-in partitioner? I'm pretty sure I changed the size of my partitions from within Vista so I could co-install Ubuntu...? No?

Dr. Φ said...

I haven't used Vista, but both XP and Win7 will allow you to create partitions or expand them in unpartitioned space. It will also allow you to delete partitions, but what it will NOT allow is moving the boundary between two partitions that you want to keep.