Tuesday, August 11, 2009

Toshiba Satellite Ubuntu-Vista dual boot configuration

Previos: The Great Laptop Quest Part 2: The Hardware.

It should be a straightforward matter to configure a machine to boot into alternate operating systems. Resize, move, and/or create partitions on the hard drive or drives; install the operating systems into the appropriate partitions; mount any shared data partitions in each operating system; and "To start, press any key."

It should be a straightforward matter.

In reading about the particular hardware and software products I intended to configure on the Toshiba Satellite laptop, I learned about quite a few problems people were having when trying to set up a dual boot with Windows Vista. Vista, it seems, is a bit non-standard in the way it manages its boot partition. What's more, it's fairly unfriendly toward those who try to muck with it. The salient points are:
  1. Vista has to boot from the first primary partition on the hard drive.

  2. Vista writes a special "boot code" into bytes 63 through 2047 of the boot partition. The "real" partition data starts at offset 2048. This appears to be designed to defeat partition management programs that were not published by Microsoft Corporation. If that was the design intent, then it has succeeded.

  3. When you use a non-Microsoft partition management program to shrink the Vista boot partition to make space on the hard drive for a second operating system, the program might innocently rewrite the partition data starting at offset zero. After all, why shouldn't it? At that point Vista is broken.

  4. Did I say "broken?" I'm sorry. I meant to say, "unrecoverable." There's no option but to reinstall Vista from scratch using the original installation DVDs. Unfortunately...

  5. ...you don't have the original installation DVDs if you purchased an OEM system with Vista pre-installed.
On my first attempt to set up the dual boot environment, I followed the tutorial at http://apcmag.com/how_to_dualboot_vista_with_linux_vista_installed_first.htm, which seemed to me to be well throught-out and reasonable. I used Vista's Disk Manager utility to shrink the partition. Then I installed Ubuntu using a Live CD burned on the Mac. The installation went smoothly and there were almost no issues on the Ubuntu side. I spent a few hours tracking down a problem with Ubuntu recognizing the Intel 5100agn wireless chipset, and there was an issue with power management settings causing "shutdown" to terminate Ubuntu but not to turn the machine off. When I booted into Vista the first time after the Ubuntu install, there were no errors related to the partition resize.

So I had a functional dual boot configuration. But the resulting configuration was not quite what I had in mind. Disk Manager would not allow the Vista boot partition to shrink any smaller than about half its original size. That resulted in a Vista partition of about 154 GB. Since my goal was to create a shared data partition occupying most of the hard drive space, most of the Vista partition would simply contain wasted space. What I really wanted to do was shrink the Vista partition to about 16 GB. Neither Disk Manager on Vista nor the partitioner in the Ubuntu install process offered a way for me to set up the partitions in this way, although the Ubuntu installer did have an option to set up all partitions manually. Under the circumstances, I wasn't confident that doing so would leave Vista undamaged or recoverable.

What I had in mind was a configuration like the one described in this description of a partitioning scheme: http://www.psychocats.net/ubuntu/partitioning. Although Ubuntucat considers this approach outdated and currently favors Wubi, I think the partitioning scheme shown below would be ideal for my needs:



What about the risk of destroying my Vista installation? I sifted through many online forum postings, blog entries, and articles. I kept finding contradictory information. It occurred to me that the apparent contradictions might simply be due to timing. Many of the horror stories about repartitioning causing a broken and unrecoverable Vista installation dated from 2007. Reading more carefully, I learned that gparted version 0.3.4 and later are reported to be able to resize a Vista partition without damaging it, although moving a Vista partition may require a system recovery using a bootable Vista installation disc. Well, I wasn't planning to move the partition, was I?

Furthermore, I read on a couple of forums (for instance, here: http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=45393&tstart=0) that Toshiba ships its pre-installed Vista systems with a recovery partition on the hard drive, as well as a utility to create a bootable recovery disc based on the contents of that partition. It was claimed that the recovery disc can fix the problems that resizing the Vista partition might cause. "Recovery" in this case means restoring the factory settings; that is, putting the factory-installed Vista back where it was when the unit shipped. That would wipe out any user data or installed applications as well as the Ubuntu partitions. But it would (hopefully) get the machine back into a usable state so that I could continue to break it again and again in the process of learning how to get to the configuration I really wanted.

This information gave me greater confidence to try to configure the hard drive as I had originally intended. In addition, my risk of data loss was minimal. I had not yet installed anything on the Vista instance or the Ubuntu instance. They were both clean installs. If the Vista recovery disc failed to repair any damage I might do to the Vista partition, I could order an installation DVD from Toshiba for a nominal price (about $20). My greatest cost in that case would be the time lost while waiting for the installation DVD to be delivered. Even if that failed, I could conceivably install Ubuntu alone on the Toshiba laptop and use the little Acer unit for the two Windows-specific applications I cared about. All my current work is safely on the MacBook Pro and/or an external storage device.

So, why not?

I booted from the Ubuntu Live CD and followed the instructions at https://help.ubuntu.com/community/WindowsDualBoot for setting up a dual boot configuration with Windows. The partitioner was unable to resize the Vista partition. After it spun for a long time at 0% complete, it aborted the operation with no further information.

End of story for now. Obviously, I need more knowledge and experience before I can successfully set up a system such as many Linux aficionados consider routine and simple. Frustrating!

Afterwards I tried booting into Vista. It detected a problem with the hard drive and ran chkdsk. It found no errors, yet hung at the point where it says, "Please wait while your computer restarts." After 15 minutes the computer had not restarted. With some apprehension, I powered it off manually and turned it back on. Fortunately, Vista started normally this time.

Next, I shut down Vista and booted into Ubuntu, to ensure I hadn't broken it. It started fine.

For the moment, the configuration has a couple of shortcomings:
  1. I wasn't able to allocate as much hard disc space to Ubuntu as I had wanted; and
  2. My /home directory will be embedded in the same partition as the rest of Ubuntu.
When I've learned enough to configure the system in a more suitable way, I'll be able to save my /home directory contents by making a backup of its contents prior to installing another Linux. That's slightly less convenient than having the /home directory in its own partition, but probably not a big deal.

Next: Updating Ubuntu

No comments:

Post a Comment