Intro : First, GRUB was erased. After fixing it, XP did not boot from GRUB owing to ‘ERROR 12’. Lastly, How I could fix both, rather discovered work-around for some part.
Recently I faced the first battle arising from the conflict between Windows and Linux. Thanks to Linux, I won it 🙂 .Let me give you a brief history of the problem.
I had to format my friend’s hard disk for some reason and connected it to my comp. Here, the sane me should have relied upon Ubuntu Live CD and formatted the whole thing. But the insane me chose to rely upon Windows. So, I used Partition Magic ver 7.0 and tried to do the job, but failed miserably. After a few more futile attempts, the Insane me decided to rely upon Windows again. I used the WinXP Pro installer CD and wished to format the slave drive through DOS. Voila! It worked. My friend was too happy and left my place cheerfully!
Now, I switched ON my PC after sometime and to my horror, didn’t find the GRUB. (GRUB – GRand Unified Bootloader; somewhat similar in concept to the OS-selection menu in Windows) WTF!!! What did Windows do to my GRUB? Being a newbie to Ubuntu, I was clueless. I tried hopelessly to somehow fix it up by using the live CD. FUCK! No success. Then, I browsed through the web from the Live CD itself and found this link which was very helpful. (Plz go through the link to understand what is written further)
Assuming that u’ve gone through the link I’ve given above, I’ll use a few terms without any explanation. I created the GRUB diskette as described in the above link. After leaving the diskette in the floppy drive, I rebooted the PC.
Run the system BIOS. Make sure you’ve specified the boot device priority in this order : 1st – Floppy drive, 2nd/3rd – CD Drive/Hard disk. Save changes and exit. Now, the PC reboots again and something like this appears.
[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
First, I specified the root drive where GRUB has to be installed, by this command
grub> root (hd0,4)
hd0 – My 1st hard disk.
4 – the partition number on the first hard disk where GRUB is to be installed.
Generally speaking, the ‘n’th partition of the ‘m’the hard disk is written as (hd[m-1],[n-1]).
Next, I’d to setup the GRUB, and this command did the job.
grub> setup (hd0)
This command sets up the GRUB on the root drive specified. Simple enough right? 😉 Now, remove the floppy diskette, change the 1st boot device priority to hard disk and reboot. A round of applause ladies and gentlemen, a novice just meddled successfully with GRUB, MBR (Master Boot Register) and a few alien things, of whose importance I know little about! 😀
But my sigh of relief was shortened when booting into XP was not possible 😦 . Ubuntu could not mount the XP drive even at startup and I was left clueless again. Fuck! 😦 I thought about it for a while and tried out something which would turn out successful. Here is what I did.
- Make the 1st boot device as CD-ROM by following the procedure mentioned earlier.
- Insert XP installation Disc into the tray.
- Let it do all the pre-install-setup-bullshit.
- When it asks if you wish to install XP or repair using Recovery console, press ‘R’ which means the latter option.
- It scans your hard disk for available XP installation and asks you to select the one you choose to repair.
- Enter the Number specified against the Installation you wish to repair and press ‘Enter/Return’ key.
- Type this command and press ‘Enter’ key.
- This thing checks the apparently inconsistent FAT/FAT32/NTFS/NTFS-3g disk drive for volume errors and fixes them.
- Now boot into Ubuntu or any other distro and go to the drive where you’ve an installation of XP.
- Copy the files “AUTOEXEC.BAT”, “boot.ini”, “CONFIG.SYS”, “IO.SYS”, and “MSDOS.SYS” into some other drive. Congrats! You’ve just made an alternate “boot sector” for WinXP 😀 . Please note the partition number of the destination drive.
- Now, to edit the GRUB menu : open the all powerful ‘Terminal’ and type the following command
sudo gedit /boot/grub/menu.lst
- Provide your password. The window opening now is the ‘menu.lst’ file which determines which OS boots from which partition. scroll down to last to find something like this :
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
title Other operating systems:
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title MS WinXP Pro
- I’ve ‘bold’ed the parameter to be changed in the above sequence.
- Primarily, my XP partition was (hd0,0). But, in the above visual, it shows (hd0,1). That means, I’ve changed the drive, which XP seacrhes for the boot sector to exist.
- In your case, If the files you’ve to move are in the 1st partition of your first hard disk then it should be as (hd0,0) in the GRUB menu file, initially. If you are copying the files to the 2nd partition of the first hard disk, then change the ‘bold’ part to (hd0,1) as in my case. As said earlier, the ‘n’th partition of the ‘m’the hard disk is written as (hd[m-1],[n-1]). Save the file and close.
- That said, make the change only in the ‘bold’ed part and NOT anywhere else, because, I CANNOT help you with the problems arising out from that.
- Reboot your PC and you should be able to boot int XP. (Atleast, I could do it in my case, and so, since there is nothing much to meddle with the hardware, your problem should be solved too.)
Important part : Disclaimer : I’m a novice and did many things (esp the latter half) according to my instinct/intuition and was not guided by any tutorial either on the WEB or on paper. So, it is up to you to believe in me and perform all these, the proof of whose working is the successful re-birth of my PC without any damage, and through which I’ve written this post 😛 .
I do not know the persom whose link I’ve provided here. Whoever you are, thank you very much, man. You revived my hopes 🙂 .
If anyone else faced the same problem and solved it in a different way, Please let me know. If any pro’s or Ubuntu/Linux Gurus find this stupid, please educate me further.
And so ended my first adventure in Ubuntu 🙂 . Hope I see much more and learn much much more! 😀 Thank you for being here.