LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Listen Print Discuss Subscribe to Linux Subscribe to Newsletters
Linux & Unix > Excerpts >

Adventures in Migrating to New Linux Distributions

by Kevin Farnham
04/07/2005

A few months ago I decided to migrate my not entirely functioning Red Hat ES 3.0 system to the Debian stable release. I wanted to do my upcoming work using completely noncommercial, open source software, including the operating system. This migration seemed like a task that would be relatively straightforward for someone with 25 years of software development experience.

It wasn't, but the adventure was certainly educational. The next time I need to migrate a Linux system, perform a major operating system upgrade, or install a system on a new PC, I'll have a much better understanding of what to do before I start and what to watch out for as I proceed.

If you run Linux on hardware that is your own, or over which you have administrative responsibilities, it is inevitable that at some point you will need to migrate or upgrade your operating system. While my migration involved Red Hat and Debian, the lessons presented here apply generally, because you'll need to address most of the problem areas encountered in my migration regardless of which Linux system you are migrating to or installing.

My hardware is an HP Pavilion a300n with a 2.6GHz Celeron processor and 768MB of RAM. I purchased it in 2002 with Microsoft XP installed. This article describes the surprising events I encountered as I modified the system to a dual-boot configuration and migrated across four different Linux versions. The final section of the article summarizes the most important lessons I learned.

From XP to XP and Red Hat 8.0

My goal was a stable dual-boot system, obtained without an unnecessarily difficult migration process. For this reason, I purchased my version of Red Hat 8.0, and I actually studied significant portions of the included manuals before I started my upgrade.

The Red Hat Linux 8.0 Installation Guide (section G.1.1) advises, "The simplest way to make room for Red Hat Linux is to add a new hard drive to the computer and then install Red Hat Linux on that drive." This sounded like good advice to me. I purchased a new hard drive and installed it. After I booted the system, Windows detected the drive, but it didn't know anything about it. Otherwise, Windows seemed to run fine.

I followed the procedures in the Red Hat manuals and carefully installed version 8.0. Finally, when I had completed all of the steps, I had an operable Linux system, equipped with a nice array of standard Unix utilities and open source software packages.

There were only two things left to test: 1) Did Windows still run properly? and 2) Could I boot into both systems? I shut down Red Hat Linux expecting to see a choice of operating systems. To my surprise, the system went immediately into Windows XP, but in a "recovery" mode. Apparently, Windows had detected that the boot sector had been compromised and intended to "fix" the problem by rewriting the correct boot information from a backup copy. When I saw this, my immediate fear was that if I let this happen, I would have no way to return to the Linux installation I had just configured. I pressed and held the power button until the system finally shut down.

My desktop computer was, in effect, unusable! Looking again at the Red Hat manuals, it didn't appear that I had done anything wrong. Instead, Windows XP was doing something that the Red Hat documentation hadn't anticipated.

Wondering what to do, I browsed the internet (using my laptop) and studied other sections of the Red Hat documentation. In the Troubleshooting section, I saw information about alternative boot options, which included using a CD or a floppy boot disk. A floppy boot disk seemed like a simple solution to my problem. I found references on the internet to a Red Hat utility to create a floppy boot disk. I booted back into Linux using the Red Hat installation CD, opened a terminal window, and ran the command. Finally, I had my dual-boot system: with the floppy in the drive, the computer booted into Linux; without the floppy, the system booted into Windows XP.

From XP and Red Hat 8.0 to XP and Red Hat ES3

Not too long after, a new consulting assignment required that I become familiar with Oracle. A visit to the Oracle web site found a developer's version of Oracle that runs under Red Hat. I decided to upgrade my system to ES3 in order to be able to run Oracle.

The first thing that disturbed me was the high cost of ES3. I was now getting into the corporate sector of Red Hat's marketing, and the company expected me to pay big bucks in order to have the Red Hat operating system that could run a pared-down developer's version of Oracle. Well, being an entrepreneur, I accepted that and duly spent my $400-plus for ES3, and several hundred more dollars to update my memory so that it could support both ES3 and Oracle.

The available information suggested that I could perform the upgrade to ES3 on top of a previously existing Red Hat operating system. I selected the upgrade installation option, and everything proceeded apparently without error. At the end of the installation, I had a fully operating Linux system, as far as I could tell. Then I installed Oracle. This installation also went fine (a few glitches and difficult decisions set aside).

Now I had ES3 and Oracle on my computer. The system was very stable in this configuration. However, I soon discovered that all activities that required the root permission for configuring the operating system using the Red Hat GUI applications (for example, changing the system clock) were no longer functional. Somehow, either the ES3 or Oracle upgrade had altered my system, completely disabling Red Hat's very nice GUI-oriented system administration capabilities. Because I'm not a Unix system administrator, this was a very annoying problem. As usual, I searched the internet for documentation and fixes from people who had experienced similar problems, but to no avail.

From XP and Red Hat ES3 to XP and Debian Stable ("Woody")

The Red Hat system administration GUI failure was part of my inspiration to move to an entirely new Linux distribution. I chose Debian because of its reputation for stability and its commitment to remaining noncommercial, and because the size and momentum of the community seem to ensure its long-term viability.

This time I decided to be a purist and obtain my Linux system for free, downloading ISO images of the system installation CD from the internet. Thus began the first in a series of frustrations in migrating to Debian.

Finding the ISO images was not difficult. The Debian team recommends using the Jigdo software to download Debian ISOs. Jigdo, short for "jigsaw download," performs error-free ISO downloads in a piecemeal manner that does not overburden the Debian download servers with excessive bandwidth spikes. (Debian software is free, after all.)

Once I had my ISO images on disk, I needed to make the actual installation CDs. This was not as simple as expected. I knew I couldn't just put the .iso files onto the CDs using a simple Unix or Windows copy command, but it didn't take long before I had a growing stack of useless, improperly created CDs (and rapidly rising impatience). Then I discovered Alex Feinman's ISO Recorder Power Toy. ISO Recorder is a very convenient tool that runs on Windows XP. It integrates with the operating system such that when you right-click on an ISO image file, a menu option labeled "Copy image to CD" is displayed (see Figure 1). Clicking on the copying option produces a correctly formatted CD using the ISO image.

ISO Recorder
Figure 1. ISO Recorder software running in Windows XP

With proper Debian installation CDs in hand, I thought I was finally set. I made a floppy boot disk using an image from the Debian web site. Then, with the Debian installation manual displayed on my laptop, I inserted the CDs and installed Debian version 3.0 (Stable). I guessed when it came to the video card and monitor specifications, but I assumed that selecting a very generic configuration was likely to work.

Wrong! I could not persuade the X Window System to display correctly on my screen. Internet searching led me to look at my XF86Config-4 file in /etc/X11. I tried several not-too-drastic hack tweaks (making certain to save all of my intermediate file versions), but nothing worked. Finally, I broke down and went to the Hewlett-Packard site to retrieve the actual detailed specifications for my video card and monitor. A few quick internet searches later, I realized I had a big problem: Debian 3.0 ("Woody") does not support the video card in my HP machine.

This points out one of the drawbacks of Debian's slow and careful approach to advancing the version it labels "stable." My more than two-year-old computer, bought from a reputable manufacturer and equipped with a basic low-tech video card, cannot properly run the current Debian Stable version.

Further investigation revealed that the actual culprit was the version of XFree86 (4.3) implemented in Debian "Woody." Subsequent stable XFree86 versions (4.4+) include support for my video card. I could have tried to upgrade my Debian Stable installation to the newer XFree86--but that seemed like an enormous risk, given all the problems I'd already had and my total lack of experience with the Debian distribution. With a little more investigation, I found that Debian itself offered a solution: I could upgrade to the Debian Testing version ("Sarge").

Related Reading

Windows to Linux Migration Toolkit
By David Allen, Christian Lahti, Herbert Lewis, John Streeton Stile, James Stanger, Andrew Taylor Scott, Timothy Tuck

Now I faced a dilemma: my initial goal had been to have a very stable installation, but the only Debian version that supported my hardware configuration was the Testing version. After all the effort I'd already invested in Debian, going back to Red Hat or to another Linux distribution was not an option. Hoping that what Debian calls "testing" might be "stable" to many other organizations, I decided to migrate to the Debian Testing version, aka "Sarge."

From XP and Debian Stable to XP and Debian Testing ("Sarge")

The first thing I noticed is that the Debian team has significantly simplified the installation procedure for the Testing version. The installation requires only one CD. The installation launches from the CD and establishes a connection to a Debian network installation server. The installation proceeds over the Net.

My installation of Debian "Sarge" proceeded without incident. I was cautious selecting the default properties for my video card and screen during the installation. Once I saw that the X Window System worked, I went back to the XF86Config-4 file and added higher-resolution graphics modes in its Screen section. If you decide to edit this file yourself, study the XF86Config man page first, and make a backup of your working copy before you proceed.

The most worrisome period of my "Sarge" installation was when the system asked me about configuring the boot. I could not find any information about making a floppy boot disk for "Sarge." Would Windows XP overwrite any attempt by Debian to make itself bootable from the hard drive?

The Debian installation uses the GNU GRand Unified Bootloader (GRUB) utility to configure the boot procedure. I was somewhat optimistic when the procedure clearly showed several operating systems available for booting (including a Debian Recovery system) and let me arrange the order in which the operating systems would boot. There was also an option for disabling (temporarily) individual operating systems. One surprise was that in addition to Windows XP, there was also a bootable Windows NT operating system.

I completed the boot configuration procedure and rebooted the computer. Sure enough, it presented me with the list of operating systems I had requested, with Debian Testing as the default operating system. I let the system boot into Debian, and everything worked fine. Next I tried booting into Windows XP. That worked, and Windows made no attempt to "fix" my corrupted boot sector.

Ever curious, I next selected that surprising Windows NT entry. Immediately, the warning message appeared and the system launched into its Windows boot sector recovery procedure. I pressed and held the power switch, and the system powered down. Now I understood a secret about my as-purchased HP system: the standard boot was into this mini-NT operating system, the only purpose of which was to check for a "corrupted" boot sector. If the sector contained only the original NT and XP data, XP launched; otherwise, the Windows recovery procedure launched. It's a clever system for fighting virus attacks on the boot sector.

I've run the Debian Testing version for several months now without any significant problems. Several times I've downloaded new packages using the Debian package management utility apt. I've also occasionally refreshed my entire set of packages using the very convenient apt-get update command. All the packages/applications I've needed thus far (mostly software development tools) have been available using apt. If you have a choice between downloading source code and building from scratch, or using apt-get, the latter will most certainly be the most convenient and straightforward option.

Recommendations for Installing/Upgrading/Migrating a Linux System

I've now "successfully" migrated my HP computer through four complete Linux distribution installations. Here's what I recommend to anyone who needs or chooses to migrate a Linux system:

  • Make sure you have a good reason for migrating. Migrating to a new operating system entails risk and lots of work.
  • Have a second computer (with internet access) available. The best guidebook for problems you encounter is searches for info on the web. In most cases, others have done what you're trying to do and have met up with the same or similar problems.
  • Installation CDs: download or buy? Downloading and writing using ISO Recorder is very easy, but buying a distribution release costs not much more than the cost of the CDs in most cases.
  • Know and document your hardware details in advance. Linux is Unix, and its system configuration is ultimately text files and scripts. You will save yourself a lot of headaches by knowing exactly what hardware you're asking your new system to address.
  • Search the internet for issues involving your hardware and your new version of Linux. Find out if your hardware is compatible with your new Linux before you've devoted hours or days to your migration, not after.
  • Save any data that you don't want to lose. This includes files you might not think about at first, such as notes to yourself that may reside on your current desktop.
  • System boot issues: know your options and provide yourself with multiple methods of booting into the new operating system if possible.
  • Anticipate having problems with your video card, monitor screen, display resolution, and the like. These problems seem to affect almost any new Linux system installation.
  • Selecting the initial package set: should you just install all packages? Err on the too-many-installs side, because updating a Linux system and installing new packages is not always straightforward.
  • Monitoring the final install: don't just walk away and let the install happen on its own. Messages may display that will become key clues in diagnosing and correcting problems later on.
  • The first boot of your new system: if you see all the operating system selections you expected to see and you can boot into a Linux that successfully launches the X Window System and lets you log in, you've succeeded!
  • After you upgrade: upgrading within a Linux release and adding packages is becoming much easier, provided that you are running one of the mainstream distributions. Debian and Red Hat, for example, have utilities (apt and rpm installers, respectively) that eliminate the need to download and build from source code.

Conclusion

If you are not a Unix/Linux system administrator, migrating or installing a new Linux distribution can be a daunting and time-consuming task. Planning ahead, including being prepared to scour the internet for details of issues you encounter along the way, will enable your system migration to proceed with fewer delays and, we hope, eliminate dead ends before they happen.

Related Links

The following links provide useful information on installing and migrating Linux systems:

  • Debian.org, the central location for Debian information, news, and distributions.
  • The XFree86 Project, Inc. XFree86 is the open source implementation of the X Window System used by Debian.
  • The Linux Documentation Project provides links to many useful Linux resources available on the internet.
  • ISO Recorder Power Toy, a convenient tool for writing ISO images to CDs from Windows XP.

Kevin Farnham is the owner of Lyra Technical Systems, Inc, a small consulting and publishing company.


Return to the Linux DevCenter.


What are your tips for finding the right distribution and staying there? Let us know here.
You must be logged in to the O'Reilly Network to post a talkback.
Post Comment
Full Threads Oldest First

Showing messages 1 through 10 of 10.

  • a300n, how ironic!
    2005-09-23 17:02:44  simeandrews [Reply | View]

    I have that exact computer! But you were wrong about something, it doesn't have a boot sector checker, it has a recovery system. That's what the NT thing is, I've used it a bunch of times when I screw my computer up. It reinstalls Windows with normal, and deletes everything on the hard drive and installs windows with destructive.

    This is really useful if GRUB or LILO screw up or you want to get rid of Linux for any reason.
  • Reporting bugs
    2005-05-02 16:50:12  oisinfeeley [Reply | View]

    I can't see where you reported that after paying for Red Hat ES3 you used the support available from Red Hat. Also I can't see where you posted your bug in Bugzilla. I'm sure if you'd done the latter then someone would have been all over it. Here's the result of the search I did for Enterprise Server 3 and Oracle

    Bugzilla search results

    It would be useful to add "report bugs to your distro" to the list of recommendations. Who knows, maybe other people know _exactly_ what your problem is because they fixed it on their own and didn't report the bugs back to their distro maintainers?
    • Reporting bugs
      2005-05-02 18:46:16  Kevin Farnham | O'Reilly Blogger [Reply | View]

      A very good point. I did not report the problem. But, you are quite correct: as users of "free" software, it really is our duty to document and report the problems we notice.

      Users of open source software are the final QA team. In this case documented in this article, by the time the problem was noticed, other work priorities loomed, resulting in my moving on to the next step.

  • Dual booting
    2005-04-15 18:06:02  keyfitter [Reply | View]

    One thing that I found useful as a
    beginner at this is using PQ Partition
    Magic in Windows. Come July I will have
    one years experience at this. I now have 5
    operating systems on this computer. Win 98,
    Win XP, SuSE 9.2, Ubuntu, and FreeBSD. It
    certainly is a learning experience.
  • migration
    2005-04-14 17:02:12  marcusfallon [Reply | View]

    I can comletely understand this type of problem. I have had considerable success using Mandrake as a stand alone server in various companies, and have recently had a peek at Novell's/Suse Open Enteprise Server which I think may be an extremely promising step forward for the Linux community, free software and desktops with a paid for server with Novell's name thrown in behind. What is more I really hate Fedora and Redhat, give me Mandrake or Suse any day.
  • Multiboot System / Migrating between distros
    2005-04-10 16:33:44  bairdcarr1 [Reply | View]

    I can certainly identify with the author's experiences, but must point out that most user oriented distros are incredibly easy to install, unlike those chosen by the author. So this should not be considered an average user's linux install. The author is not an average user with average needs, but still could have avoided all the problems listed by simply asking questions. Most linux users are very eager to give advice or assistance. Anyway, here is my advice:

    If you are new to linux and setting up a multiboot system, use a separate hard drive for linux or be prepared for the possibility of messing something up.

    Put the Linux drive in Primary Master position, so the installer does not have to modify the Windows mbr. If you mess up, you can always move the Windows drive back to Primary Master.

    If think you would like to switch distros occasionally (every few months on the laptop I'm on now), make sure you create a /home partition, so you never lose your user data. You will just format and install to the / partition, and preserve your /home.

  • Things I would have done differently
    2005-04-09 07:45:23  cyber_rigger [Reply | View]

    I would have used debian sarge (testing)
    instead of woody (stable).

    You don't need jigdo
    if there is already an installation CD.

    Here are the network install CDs for sarge.

    http://www.debian.org/devel/debian-installer/

    For i386 you wil probably want this iso
    http://cdimage.debian.org/pub/cdimage-testing/sarge_d-i/i386/rc3/sarge-i386-netinst.iso

    After you are installed then edit /etc/apt/sources.list
    and change each word "testing" to "sarge"
    (most debian mirrors recognize either name).

    This will allow you to stay with sarge
    even when sarge becomes offically "stable".


    The network install CD is dead simple.
    • Things I would have done differently
      2005-04-09 08:04:07  cyber_rigger [Reply | View]

      IIRC the sarge installer CD just lists the "main" packages

      If you also want "contrib" and "non-free" and "non-US"
      your /etc/apt/sources.list should look something like this:


      deb ftp://ftp.us.debian.org/debian/ sarge main contrib non-free
      deb http://non-us.debian.org/debian-non-US/ sarge/non-US main contrib non-free


      To add/remove packages use the text based "dselect".

      To configure a bunch of stuff at once use "tasksel".

      Once you have your GUI going use "synaptic".


      If you need to tweak X use (from console as root)

      dpkg-reconfigure xserver-xfree86
  • apt-get update
    2005-04-08 09:51:55  JoeNiner [Reply | View]

    FYI, apt-get update does not upgrade packages, it just updates the package repository info. apt-get upgrade is the command you need.
    • apt-get update
      2005-05-02 18:53:32  Kevin Farnham | O'Reilly Blogger [Reply | View]

      READERS, PLEASE NOTE THIS! this is an important error in my article. Thank you for your correction, JoeNiner.

      Here's the link to the debian apt "how-to" documentation:

      http://www.debian.org/doc/manuals/apt-howto/

      which confirms JoeNiner's comment.


Tagged Articles

Post to del.icio.us

This article has been tagged:

linux

Articles that share the tag linux:

Managing Disk Space with LVM (74 tags)

Use Your Digital Camera with Linux (60 tags)

mdadm: A New Tool For Linux Software RAID Management (59 tags)

Asterisk: A Bare-Bones VoIP Example (43 tags)

View All

Recommended for You

  1. Cover of Take Control of Permissions in Mac OS X
    Take Control of Permissions in Mac OS X
    Ebook: $10.00
  2. Cover of Debian System
    Debian System
    Print: $44.95
  3. Cover of PThreads Programming
    PThreads Programming
    Print: $34.95
  4. Cover of Wicked Cool Shell Scripts
    Wicked Cool Shell Scripts
    Print: $29.95

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

O'Reilly Media

©2010, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com