Need help big time

Discussion in 'Linux - General discussion' started by adrian089, Sep 25, 2007.

  1. adrian089

    adrian089 Member

    Joined:
    Aug 4, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    11
    I installed ubuntu on my 2nd hard drive and then went on windows on my first and formatted my 2nd hard drive. Now whenever I try to load up windows i get the grub error 21. The only way I can use my computer now is on ubuntu which I dont want at all now i just want to go back to having windows so can any one instruct me on fixing this problem please.

    i am a moron for what i have done
     
  2. ktulu14

    ktulu14 Regular member

    Joined:
    Dec 8, 2004
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    26
    there are two ways of fixing this. firstly, do you want to keep Ubuntu and have a dual boot system? If so then you need to edit Grub to load windows as a menu option. in a terminal type sudo gedit /boot/grub/menu.lst and the text editor (gedit) will open the menu file. Now scroll down until you see something like the following (depends on your install)

    ## ## End Default Options ##

    title Ubuntu, kernel 2.6.20-16-generic
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=f397e1f0-fd1c-4707-8933-2957abf0d2b0 ro quiet splash
    initrd /boot/initrd.img-2.6.20-16-generic
    quiet
    savedefault

    title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=f397e1f0-fd1c-4707-8933-2957abf0d2b0 ro single
    initrd /boot/initrd.img-2.6.20-16-generic

    title Ubuntu, kernel 2.6.20-15-generic
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=f397e1f0-fd1c-4707-8933-2957abf0d2b0 ro quiet splash
    initrd /boot/initrd.img-2.6.20-15-generic
    quiet
    savedefault

    title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=f397e1f0-fd1c-4707-8933-2957abf0d2b0 ro single
    initrd /boot/initrd.img-2.6.20-15-generic

    title Ubuntu, memtest86+
    root (hd0,2)
    kernel /boot/memtest86+.bin
    quiet

    ### END DEBIAN AUTOMAGIC KERNELS LIST

    # This is a divider, added to separate the menu items below from the Debian
    # ones.
    title Other operating systems:
    root


    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/hda1
    title Microsoft Windows XP Professional
    root (hd0,0)
    savedefault
    makeactive
    chainloader +1


    You are looking for the last entry here (XP) and it should be something similar. If it isn't then add this text in to your menu.lst and save it. when you reboot then you should be able to get into Windows without a problem ( I have had to do this before due to a setup issue on *nix so I know this works OK).

    If you don't want to have Ubuntu as a dual boot option, then you will need to load your Win CD and get into the recovery console (cmd prompt) and then type the following: FIXMBR and hit enter. This will rewrite your Master Boot Record on the 1st hard drive, allowing you to only boot into windows. To clean your installation of Ubuntu on the second drive, you will need to either run something like partition manager (some free ones about to but this is one of the better ones) or run FDISK (can't quite remember how as I have rarely if ever used it on a pc that was not getting a fresh instal.

    Hope this all helps and if I have missed anything I am sure some other people more knowledgeable than I will correct me.
     
  3. deadlove

    deadlove Guest

    Kt.. just noticed in your menu.list there that you have 2 of the n00buntu kernals with "savedefault" in them... It should really be only the current one you use.. In fact I'd take the older ones out completely if you are no longer using them (or ## them out at least)

    That could have some bearing on the k3b issues?>

    OP... you say second hdd?
    that would have the jumper set to slave??

    If true you need to edit the file listed and where it says vmlinuz ensure the path is /dev/hdb1 (n00buntu is a bit bad at this)

    something like this on a second drive..

    title Debian GNU/Linux, kernel 2.6.18-5-686
    root (hd1,1) ## means hdd2, partition 1 ##
    kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/hdb2 ro
    initrd /boot/initrd.img-2.6.18-5-686
    savedefault
     
    Last edited by a moderator: Sep 26, 2007
  4. ktulu14

    ktulu14 Regular member

    Joined:
    Dec 8, 2004
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    26
    thanks DL, never gave it much thought TBH. I will alter the file tomorrow and try k3b and see what happens.
     
  5. adrian089

    adrian089 Member

    Joined:
    Aug 4, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    11
    thanks im gonna have to wait a few days till i can get my hands on a win cd but i'l update when i try that.
     
  6. deadlove

    deadlove Guest

    Shouldn't be too much of a problem to fix this with linux.

    Download yourself a slax disk (I like killbill.. your choice) burn it and boot it. http://www.slax.org/download.php

    Open a terminal and mount your location for grub (probably>

    mount -t ext3 /dev/hdb1 ...(rusty!! duh)

    Then you can edit the menu.list file using nano which is included with killbill.
    You might find it's easier to move your drives around so linux is on the master .. eg /dev/hda so grub is first in the list, or you could change your bios to boot first from the second drive... whatever you fancy really.
     
    Last edited by a moderator: Sep 27, 2007

Share This Page