Find the answer to your Linux question:
Results 1 to 9 of 9
How do I repair or re-install grub without formatting? I am using lenny, p4 3.00Ghz, pure intel....
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    88

    Question [SOLVED] grub hell!

    How do I repair or re-install grub without formatting?

    I am using lenny, p4 3.00Ghz, pure intel.

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,343
    Can you boot into the system? If so, just run update-grub. Another option is to use the Super Grub Disk.

  3. #3
    Just Joined! mrrangerman's Avatar
    Join Date
    Jul 2008
    Posts
    34
    Here is a good Grub booting tips howto.

  4. #4
    Just Joined!
    Join Date
    Jan 2008
    Posts
    53

    easy grub fix!

    Quote Originally Posted by njuguna View Post
    How do I repair or re-install grub without formatting?

    I am using lenny, p4 3.00Ghz, pure intel.
    Use the GRUB command you can found in live-cd of other distros, try it with Ubuntu or openSUSE, i have not test it in another distro than these two!.

    now once you are into the live cd if you are using ubuntu do this to gain admin privileges, because i do not like sudo i use this alternative:

    $ sudo passwd root
    passwd:
    Retype the passwd:
    $ su
    passwd:

    For openSUSE do this:
    $ su
    #

    And that is all.

    Now being root mount each partition until find the one containing /boot/grub/menu.lst, read it and you will find a line saying something like this:

    root (hd#1,#2)

    then exit and run the grub command:

    grub

    now copy what you saw
    >root (hd#1,#2)
    then do
    >setup (hd0)
    to record into the mbr
    and ready
    that is all
    have fun!

  5. #5
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    As suggested by daark.child, its really easy to re-install GRUB using SuperGRUB CD. If you have LiveCD of any Linux distro ( except Ubuntu 9.10 ), just chroot / partition of Debian and execute grub-install /dev/sdx command with root privileges.
    Code:
    mount -t ext3 /dev/sd<root_partition> /mnt
    chroot /mnt
    grub-install /dev/sdx
    Press Ctrl+D to exit chroot
    umount /dev/sd<root_partition>
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #6
    Just Joined!
    Join Date
    Sep 2008
    Posts
    88
    At that time, no!(I formatted my box: patience issues, not stable internet services here.) But am still willing to learn.

  7. #7
    Just Joined!
    Join Date
    Sep 2008
    Posts
    88

    Angry Grub heller!!!

    Quote Originally Posted by rojoblandino View Post
    Use the GRUB command you can found in live-cd of other distros, try it with Ubuntu or openSUSE, i have not test it in another distro than these two!.

    now once you are into the live cd if you are using ubuntu do this to gain admin privileges, because i do not like sudo i use this alternative:

    $ sudo passwd root
    passwd:
    Retype the passwd:
    $ su
    passwd:

    For openSUSE do this:
    $ su
    #

    And that is all.

    Now being root mount each partition until find the one containing /boot/grub/menu.lst, read it and you will find a line saying something like this:

    root (hd#1,#2)

    then exit and run the grub command:

    grub

    now copy what you saw
    >root (hd#1,#2)
    then do
    >setup (hd0)
    to record into the mbr
    and ready
    that is all
    have fun!
    Ubuntu 9.1 refused to repair/reinstall grub. The reported error was "could not determine permissions to /dev/hda1(where my MBR is located in the primary harddrive)". I do not possess a live disk for suse.

  8. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Post the output of sudo fdisk -l and df -h commands.
    Code:
    sudo fdisk -l
    df -h
    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
    Jan 2008
    Posts
    53

    Grub hell!

    Quote Originally Posted by njuguna View Post
    Ubuntu 9.1 refused to repair/reinstall grub. The reported error was "could not determine permissions to /dev/hda1(where my MBR is located in the primary harddrive)". I do not possess a live disk for suse.
    Yes u got that message because the mbr is locate in hd0 and for install it u run the grub comand as root then setup where is located the root partition with "root (hd#1,#2)" and then install it on the mbr with "root (hd0)".

    If you are doing it with grub-install i'm shure u type './grub-install /dev/hda1', else if u did, u'r going back were you started.

    it should be: './grub-install /dev/hda'

    It is not going to work if you are setting a bad partition o disk no present.

    You have Ubuntu so the same CD works well, i just write suse as an example, but you can use wathever distro that allows u tu use the grub command, run the cd of ubuntu 9.1 on livecd mode, then wait to get a graphical enviroment, once u are in, go to a shell and type:

    /*For setting the root password*/
    $ sudo passwd root
    passwd:
    /*To gain root access, more confortable than doing sudo at the beginning*/
    $ su -

    now suppose your distro recognice your hard drive as hda mount each partition until find /boot/grub/menu.lst on it, suppose you found it on hda1.

    so the drive is (hd0,0) so you will run as root:

    #grub
    /*Once in the grub command now copy what you saw
    >root (hd0,0)
    /*then do to install in the mbr*/
    >setup (hd0)

    If you found the /boot/grub/menu.lst on hda6 for example do the same but watch that the drive info change:

    The drive is (hd0,5):
    #grub
    /*Once in the grub command now copy what you saw
    >root (hd0,5)
    /*then do to install in the mbr*/
    >setup (hd0)

    If you have more than one hard drive and supposely u found it on the second one, the drive info change, but we do the same, suppose you found it on hdb3:

    The drive is (hd1,2):
    #grub
    /*Once in the grub command now copy what you saw
    >root (hd1,2)
    /*then do to install in the mbr*/
    >setup (hd0)

    The same if your disk is sda1 sdb1 or wathever in grub the root option is always (hd#1,#2) where #1 is the drive a=0,b=1,c=2...z=n-1 and #2 is the partition 1=0,2=1,3=2,....n=n-1.

Posting Permissions

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