Results 1 to 7 of 7

Thread: Can't repair grub after installing Windows 7

  1. #1
    Join Date
    May 2008
    Location
    France
    Beans
    8
    Distro
    Ubuntu 9.10 Karmic Koala

    Can't repair grub after installing Windows 7

    Hi everyone,
    I installed Windows 7 today and everythings ran fine.
    When I restarted I knew grub would be missing, so I booted on an ubuntu live cd to repair it, and I did as always :

    grub
    find /boot/grub/stage1 => error 15
    root (hd0,2) (I know the numbers even if find doesn't work)
    setup (hd0) => error 17

    My ubuntu's partition still exists, the live cd mounts it in /media/disk and I have access to my /home.

    I didn't want to reinstall ubuntu but I can't find any solution to repair my grub :/

    Any idea ?

  2. #2
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Can't repair grub after installing Windows 7

    These look like legacy grub commands:

    Quote Originally Posted by koskoz View Post
    grub
    find /boot/grub/stage1 => error 15
    root (hd0,2) (I know the numbers even if find doesn't work)
    setup (hd0) => error 17
    ... but your profile to the left of your post says your are running Karmic. Did you do a fresh install of Karmic, or did you upgrade from Jaunty? If a fresh install, then you have grub2 and those commands won't work.

    Have a look at this:

    http://ubuntuforums.org/showthread.php?t=1195275

    What you need is the section titled "Reinstalling GRUB 2 from the LiveCD". It's numbered 13 at the top of the post, but 12 in the body of the text. It's not as straightforward as with legacy grub. Good luck!

    Edit: by the way, I don't think the new Windows install will be added to the menu automatically - I'm new to grub2 myself. If it isn't, the information you need should be in that link, or in:

    https://help.ubuntu.com/community/Grub2

    What you shouldn't do is edit the main config file, grub.cfg, directly.
    Last edited by coffeecat; November 4th, 2009 at 10:55 PM.
    Ubuntu 16.04 Desktop Guide - Ubuntu 17.10 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags - IRC #ubuntuforums

    Member: Not Canonical Team

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  3. #3
    Join Date
    May 2008
    Location
    France
    Beans
    8
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Can't repair grub after installing Windows 7

    Ow thanks, I didn't know it was grub2.

    My live CD is a 8.10 but my ubuntu's version on my hard drive is 9.10.
    I guess I need a 9.10 live cd to reinstall my grub ?

  4. #4
    Join Date
    Oct 2009
    Location
    TN
    Beans
    429

    Re: Can't repair grub after installing Windows 7

    You'll need a 9.10 CD if you did a fresh install.

  5. #5
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Can't repair grub after installing Windows 7

    Quote Originally Posted by koskoz View Post
    My live CD is a 8.10 but my ubuntu's version on my hard drive is 9.10.
    I guess I need a 9.10 live cd to reinstall my grub ?
    You don't have a 9.10 CD? So did you do a fresh install or an upgrade from an earlier version?

    If you're not sure which version of grub you have, the best way is to look in /boot/grub. If you have menu.lst, then you have legacy grub and we need to see why those commands you posted didn't work. If you don't have menu.lst, but have grub.cfg, then you have grub2.

    And if you have both......
    Ubuntu 16.04 Desktop Guide - Ubuntu 17.10 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags - IRC #ubuntuforums

    Member: Not Canonical Team

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  6. #6
    Join Date
    May 2008
    Location
    France
    Beans
    8
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Can't repair grub after installing Windows 7

    I first install 8.04 then did upgrade to 8.10 then 9.04 then 9.10.
    I do have a menu.lst

    And I almost posted everything in the first post :/

  7. #7
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Can't repair grub after installing Windows 7

    Quote Originally Posted by koskoz View Post
    I first install 8.04 then did upgrade to 8.10 then 9.04 then 9.10.
    I do have a menu.lst
    Then you have legacy grub after all, and grub2 was a red-herring.

    Quote Originally Posted by koskoz View Post
    And I almost posted everything in the first post :/
    If sda3 is your root partition, or boot if you have a separate /boot, then those commands should have worked. To be honest I never bother with the find command. If I know the partition number, I just do the root and setup commands and it's never failed - and I've reinstalled grub many times before.

    Are you absolutely sure your root partition is sda3? Why not post the terminal output of "sudo fdisk -l" from the live CD to be sure (that's lower-case L). I've read somewhere that Windows 7 sets itself up with a tiny subsidiary partition as well as the main C: partition - it's unlike XP and Vista in this respect. I wonder if it's changed the partition table such that your Linux root partition now has a different number.

    And those errors 15 and 17 are odd. Curious.
    Ubuntu 16.04 Desktop Guide - Ubuntu 17.10 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags - IRC #ubuntuforums

    Member: Not Canonical Team

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

Bookmarks

Posting Permissions

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