Find the answer to your Linux question:
Results 1 to 9 of 9
Hi. I have a Debian installation on my desktop PC, but after installing Windows XP Pro on an other partition, there's no option at boot up anymore to boot the ...
  1. #1
    Linux User Daan's Avatar
    Join Date
    Aug 2005
    Location
    The Netherlands
    Posts
    320

    Question How can I boot Debian Linux after have installed Windows? Or: how to restore GRUB?



    Hi. I have a Debian installation on my desktop PC, but after installing Windows XP Pro on an other partition, there's no option at boot up anymore to boot the Debian Linux OS: the GRUB menu is gone and my system goes strait into Windows.

    How can I restore the GRUB menu? Or just reinstall it?

    When I boot up from the Debian installation CD there's an option to install the GRUB boot loader, but when I try to do that, I go to the partitioning section first. My guess is that I have to set a bootable flag or something first before I can install GRUB. Am I right? Would setting the bootable flag on what was my / (root) partition anable me to install a nice GRUB that lets me choose between Debian and Windows?

    Thanks,

    Daan

  2. #2
    Just Joined! tb10alj's Avatar
    Join Date
    Feb 2006
    Location
    Germany
    Posts
    31
    Hi,

    the windoze installation has overwritten your MBR.
    An easy way to restore GRUB is to boot from a LiveCD (for example KNOPPIX).

    Boot from a LiveCD and mount the partition which contains the boot directory
    of your Debian system (i.e. to /mnt/target)

    Edit /mnt/target/boot/grub/menu.lst and add an entry for your Windows
    installation.

    Code:
    title Windows XP
      # Adjust the root entry for your system!!!!!
      # (hd0,1) is the second partition of the primary master
      root            (hd0,1)
      makeactive
      chainloader     +1
      boot
    Type grub to get a GRUB shell. In the GRUB shell, you should first run
    the root command, to tell GRUB where to find the necessary files:
    Code:
    root (hd0,0)
    (hd0,0) stands for hda1. If your are not sure, which partition you should
    enter here, you can figure it out with:
    Code:
    find /boot/grub/stage1
    To install GRUB in the MBR of the first drive enter:
    Code:
    setup (hd0)
    Now type quit, reboot your system and cross your fingers

    Cheers
    JAN

  3. #3
    Linux User Daan's Avatar
    Join Date
    Aug 2005
    Location
    The Netherlands
    Posts
    320
    Thanks Jan!

    I did as you told me and as soon as found out that I had to run the grub command as root, it was really easy. (You can run grub as a normal user, but than it will nor respond as you said it would).

    Thanks again,

    Daan

  4. #4
    Just Joined!
    Join Date
    Dec 2006
    Posts
    8

    GRUB Loading stage.1.5

    I did what Jan said, but when I boot I get the following message:
    Code:
    GRUB Loading stage.1.5
    (with a bunch of strange signs after it)

    Can anyone please tell me what to do. This is really working on my nervs now.

    Thank you.

  5. #5
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,308
    please provide a little more details. which distro? is there any other OS installed in Harddisk? how many harddisks do you have? is it a fresh install?







    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #6
    Linux Newbie craigevil's Avatar
    Join Date
    Jun 2005
    Location
    Terra in the Milky Way
    Posts
    110
    Here are a couple ways of doing it and hopefully one of them will work for you:

    Boot with a Knoppix CD (or some other live-cd), or use a rescue/boot floppy like Tomsrtbt ( http://www.toms.net/rb/ ); determine your root partition and mount it to a temporary mount point; then chroot into it; then reinstall GRUB:

    sudo mkdir /mnt/temp

    sudo mount /dev/hda1 /mnt/temp
    (change /dev/hda1 to match your own root partition)

    sudo chroot /mnt/temp

    sudo grub-install /dev/hda

    or...

    determine your root partition, then mount it "dev" option enabled with write permissions. If the filesystem isn't mounted you'll need to mount it like this (be sure to change "hda1" and "hda" to match the location/device in your own system):

    sudo mount -o dev,rw /mnt/hda1

    if it's already mounted, remount it like this:

    sudo mount -o remount,dev,rw /mnt/hda1

    now restore grub like this:

    sudo chroot /mnt/hda1 grub-install /dev/hda

    if it doesn't work using chroot, try remounting as outlined above and do:

    sudo grub-install -root-directory=/mnt/hda1 /dev/hda

    Kanotix has an option to "Restore Grub", simply boot with the livecd and choose restore grub.
    Debian Sid LXDE Kernel liquorix CPU Pentium IV 2.80GHz GeForce 9400 GT
    Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
    Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi

  7. #7
    Just Joined!
    Join Date
    Dec 2006
    Posts
    8
    Quote Originally Posted by devils_casper
    please provide a little more details. which distro? is there any other OS installed in Harddisk? how many harddisks do you have? is it a fresh install?
    Thanks for the reply. I'm running Debian Sarge and a installation is a few weeks old. I installed Windozs last night witch ate my GRUB!!! I have one hard disk with two partitions. Linux is on the first partition.

  8. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,308
    boot up from Debian installation CD and type 'boot=/dev/hda1' at prompt. Debian will boot up. execute 'grub-install /dev/hda' in konsole to reinstall GRUB.






    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #9
    Just Joined!
    Join Date
    Dec 2006
    Posts
    8
    Thank you both so much for your help! Its working now! I did what Craigevil said (the first way) and it worked. I used some other tutorials before posting here, but it didn't want to work. So... Great job Craig!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •