
Howto Not Panic...when something goes wrong
Date: Monday, January 17 @ 01:24:18 CST Topic: Tips & Tricks
How to Not Panic when something goes wrong.....
This article results from this journal entry, ewiget-01-16-2005 in which installing a dual boot system went terribly wrong.
For a little background into this without reading the journal entry above, this was the scenerio:
Add Windows XP to an Existing Linux Installation
Windows XP was needed because I had recently started teaching a Microsoft Access 2003 course at the Maysville Community College. I did not currently have any computers running Windows of any version because I had finally weined myself away from the Gates empire a few years ago. I have told an associate of mine at the college, Janet Garrison, that I know this must be a consipiracy to get me back to using and relying on Windows (of course, this conspiracy theory is all in fun and humor). This would, under normal circumstances be a couple of hour job, with the bulk of the time being the back-up stage and the final Windows XP service pack upgrade stage. My course of action was planned as follows:
- Step 1 - Locate original Toshiba Satellite 6100 Pro Recovery disk that had never been opened or used
- Step 2 - back-up entire laptop hard drive to remote file system using compressed files, i.e. tar.gz
- Step 3 - shrink existing ext3 partition to make free space on hard drive that will hold Windows XP
- Step 4 - Install Windows XP onto free space created above
- Step 5 - Modify grub.conf to reflect new operating system
- Step 6 - finish up Windows XP installation by installing service packs and hardening system
- Step 7 - go to bed and sleep after an estimated 6 hour upgrade / modification
From the time this laptop was brand new, I had never so much as booted this Toshiba laptop when it arrived from the factory with Windows, matter of fact, very first thing I did was plug it into a power source, eject the cd-rom drive and insert the Gentoo minimal live cd, which I then booted, formatted the drive, and installed Gentoo. I had no want or reason to use Windows, and it was only a nuisance that it came pre-installed.
So, where did all of this go wrong? Everything was going great until Step 4. Because I had never actually used the Toshiba Recovery CD, I was completely un-aware that their would be absolutely 0 installation options. Let me explain this a little further. I inserted the first of five cd-roms and started the laptop. There was a choice to install either Windows 2000 Professional or Windows XP Professional - the OEM license actually has the serial number for both, but I had never used either. Anyways, it was something like press 1 to install Windows 2000 Professional or press 2 to install Windows XP Professional. I pressed 2, and then it said, insert disc 3 and reboot. I inserted disc 3 and rebooted. The very next thing I see on the screen says: Formatting 55.5.xMB.....1% complete. I thought, whoa, this cant be correct....its not even gonna ask me to select my partition sizes or partition type. But after about an hour, it rebooted into my newly formatted Windows XP Professional piece o crap laptop with Windows XP consuming the entire hard drive.
I take a deep breath and utter some remarks towards my newfound hatred to Windows and Toshiba. I smoke a cigarette and drink a cup of coffee and wonder where my Gentoo cd is at, or if I should just download another new one. I wonder if I should have just fired up Limewire and got a free copy of Windows XP Professional that I could have just then removed the pirated serial number and used my OEM number. Then I chuckle as I remember the conspiracy theory, and I set out to prove that Gates and Co. dont have me yet.
Fixing It
First things first, put Windows back in its place by robbing all my disc space back. Linux is able to shrink NTFS partitions - find out more at this web site - Linux NTFS Project Luckily I had several Live Linux CD Roms laying around and was able to do this rather easily. I ended up using the Adios Live CD from the Intro to Unix course that I was also teaching. I went about setting my NTFS partition to something I felt was satisfactory for my uses, which was as damn little as possible, so 15GB did the trick.
Once I had the NTFS partition resized, I thought about using the Adios cd to recover the system but since I am more experienced with the Gentoo live cd, I rebooted to it instead. First thing I did at the shell, was created the Linux partitions. I then formatted them. I went ahead an mounted the newly created partitions under /mnt/gentoo/partition_name. Next, I set a root passwd and fired up ssh service so I could ssh into the live cd from the machine that had my backups from the laptop I had created before this mess started. Since the IP address was the same on the Live CD as the laptop was when I had previously used it, I had to remove the id from known_hosts file on the remote backup system. I was then able to ssh into the live cd. From here, I scp the backup files to the created mountpoints where they would be restored. The home directory was the largest at 11GB because it has several virtual machines in it that I use for testing and I never really thought I would be using the backups anyways. I used scp to transfer the home backup over to the laptop to the mounted /mnt/gentoo. Asa safety precaution, I created new backups of each directory before replacing them with the ones I had previously backed up. I then extracted the backup using the command tar xzvpf home.tar.gz which extracted all the files with the correct permissions. I did this for each of the backed up files.
After all of the backup files were extracted, I had to finish up by modifying the /boot/grub/grub.conf configuration file for the new partition layout. I then held my breath as I unmounted the mounted partitions, shut down ssh on the Gentoo Live CD, and rebooted.
All was restored and working as expected. I hope you can find something enlightening in this article because no matter how bad it may seem, everything is recoverable as long as you plan ahead! If I had not thought this through before hand, I would have lost a considerable amount of time and work that was stored in the original laptop configuration before installing Windows XP. Although this article was the result of Toshiba not allowing any type of configuration options on their recovery cd, I still believe the Toshiba Satellites are rock-solid linux laptops.
Hope you have enjoyed this article.
|
|