Page 20 of 26 FirstFirst ... 101819202122 ... LastLast
Results 191 to 200 of 253

Thread: HOWTO: Restore GRUB (if your MBR is messed up)

  1. #191
    Join Date
    Dec 2007
    Beans
    121

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    After following this guide to back up and restore my system, and then running the following commands in the grub menu
    find /boot/grub/stage1 (optional)
    root (hdX,Y)
    setup (hd0)
    quit
    I then get Error 15: File not found.

    So I hit a key and it brings me to the grub menu (I guess it does rebuild the grub) but any option I choose I get the Error 15. When I choose E to edit an entry the kernel line is listed as follows:

    kernel /vmlinuz-26.20-16-server root=UUID=2d58187c-3077-4c41-9a07-10a35ce5b062 ro quiet splash
    I dont know enough about the grub but it looks a little funky. I only have one HDD and the entire thing is dedicated to the install. Please help!
    Last edited by rugbert; September 10th, 2008 at 11:02 PM.

  2. #192
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Rugbert, so on start up you get the Grub menu, but when you choose any of the Ubuntu entries it gives the error 15? Please boot your Live CD, open a terminal, and post the output of:
    Code:
    sudo fdisk -lu
    From the above command, also figure which is your Ubuntu partition in the form sdXY (like sda2 or similar) by noticing which partition is "linux" under the "system" category, and then use that:
    Code:
    sudo mount /dev/sdXY /mnt
    cat /mnt/boot/grub/menu.lst
    That will probably give us enough info to fix your problem.

  3. #193
    Join Date
    Dec 2007
    Beans
    121

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Thank you caljohnsmith, here ya go:

    Code:
    fdisk -lu
    
    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Disk identifier: 0x89254f32
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *          63   470672369   235336153+  83  Linux
    /dev/sda2       470672370   488392064     8859847+   5  Extended
    /dev/sda5       470672433   488392064     8859816   82  Linux swap / Solaris
    Mounting sda1
    Code:
    root@ubuntu:/home/ubuntu# cat /mnt/boot/grub/menu.lst
    # menu.lst - See: grub(8), info grub, update-grub(8)
    #            grub-install(8), grub-floppy(8),
    #            grub-md5-crypt, /usr/share/doc/grub
    #            and /usr/share/doc/grub-doc/.
    
    ## default num
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used.
    #
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    # WARNING: If you are using dmraid do not change this entry to 'saved' or your
    # array will desync and will not let you boot your system.
    default		0
    
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout		3
    
    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    hiddenmenu
    
    # Pretty colours
    #color cyan/blue white/blue
    
    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line)  and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    #      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret
    
    #
    # examples
    #
    # title		Windows 95/98/NT/2000
    # root		(hd0,0)
    # makeactive
    # chainloader	+1
    #
    # title		Linux
    # root		(hd0,1)
    # kernel	/vmlinuz root=/dev/hda2 ro
    #
    
    #
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
    
    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below
    
    ## DO NOT UNCOMMENT THEM, Just edit them to your needs
    
    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specific kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    ##      kopt_2_6_8=root=/dev/hdc1 ro
    ##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
    # kopt=root=UUID=2d58187c-3077-4c41-9a07-10a35ce5b062 ro
    
    ## Setup crashdump menu entries
    ## e.g. crashdump=1
    # crashdump=0
    
    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd0,0)
    
    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ##      alternative=false
    # alternative=true
    
    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ##      lockalternative=false
    # lockalternative=false
    
    ## additional options to use with the default boot option, but not with the
    ## alternatives
    ## e.g. defoptions=vga=791 resume=/dev/hda5
    # defoptions=quiet splash
    
    ## should update-grub lock old automagic boot options
    ## e.g. lockold=false
    ##      lockold=true
    # lockold=false
    
    ## Xen hypervisor options to use with the default Xen boot option
    # xenhopt=
    
    ## Xen Linux kernel options to use with the default Xen boot option
    # xenkopt=console=tty0
    
    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ##      altoptions=(recovery) single
    # altoptions=(recovery mode) single
    
    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ## alternative kernel options
    ## e.g. howmany=all
    ##      howmany=7
    # howmany=all
    
    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ##      memtest86=false
    # memtest86=true
    
    ## should update-grub adjust the value of the default booted system
    ## can be true or false
    # updatedefaultentry=false
    
    ## ## End Default Options ##
    
    title		Ubuntu, kernel 2.6.20-16-server
    root		(hd0,0)
    kernel		/vmlinuz-2.6.20-16-server root=UUID=2d58187c-3077-4c41-9a07-10a35ce5b062 ro quiet splash
    initrd		/initrd.img-2.6.20-16-server
    quiet
    savedefault
    
    title		Ubuntu, kernel 2.6.20-16-server (recovery mode)
    root		(hd0,0)
    kernel		/vmlinuz-2.6.20-16-server root=UUID=2d58187c-3077-4c41-9a07-10a35ce5b062 ro single
    initrd		/initrd.img-2.6.20-16-server
    
    title		Ubuntu, kernel 2.6.20-15-generic
    root		(hd0,0)
    kernel		/vmlinuz-2.6.20-15-generic root=UUID=2d58187c-3077-4c41-9a07-10a35ce5b062 ro quiet splash
    initrd		/initrd.img-2.6.20-15-generic
    quiet
    savedefault
    
    title		Ubuntu, kernel 2.6.20-15-generic (recovery mode)
    root		(hd0,0)
    kernel		/vmlinuz-2.6.20-15-generic root=UUID=2d58187c-3077-4c41-9a07-10a35ce5b062 ro single
    initrd		/initrd.img-2.6.20-15-generic
    
    title		Ubuntu, memtest86+
    root		(hd0,0)
    kernel		/memtest86+.bin
    quiet
    
    ### END DEBIAN AUTOMAGIC KERNELS LIST
    huh so yea, that kenel line needs to be pointing to the partition that holds the kernel im guessing? and instead its looking at what, a symbolic link?
    Last edited by rugbert; September 10th, 2008 at 11:56 PM.

  4. #194
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    OK, while you still have your Ubuntu partition mounted, do:
    Code:
    gksudo gedit /mnt/boot/grub/menu.lst &
    And change the following:
    Code:
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout		10
    
    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    #hiddenmenu
    So give it a longer timeout, and comment-out the hiddenmenu. Next do:
    Code:
    sudo blkid
    ls -l /mnt
    ls -l /mnt/boot
    So do you get the Grub menu on start up? Or do you get the error 15 before you get the Grub menu?

  5. #195
    Join Date
    Dec 2007
    Beans
    121

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by caljohnsmith View Post
    OK, while you still have your Ubuntu partition mounted, do:
    Code:
    gksudo gedit /mnt/boot/grub/menu.lst &
    And change the following:
    Code:
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout		10
    
    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    #hiddenmenu
    So give it a longer timeout, and comment-out the hiddenmenu. Next do:
    Code:
    sudo blkid
    ls -l /mnt
    ls -l /mnt/boot
    So do you get the Grub menu on start up? Or do you get the error 15 before you get the Grub menu?
    I get the grub yes, but any entry I choose give me the error 15.

    Im assuming I should edit the entries accordingly?

  6. #196
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by rugbert View Post
    I get the grub yes, but any entry I choose give me the error 15.

    Im assuming I should edit the entries accordingly?
    Yes, you will need to edit your Ubuntu entries in menu.lst, and if you can do it on your own, that's great. If you need help with it, then please post the output of those other commands I gave while your Ubuntu partition is still mounted on /mnt.

  7. #197
    Join Date
    Dec 2007
    Beans
    121

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by caljohnsmith View Post
    Yes, you will need to edit your Ubuntu entries in menu.lst, and if you can do it on your own, that's great. If you need help with it, then please post the output of those other commands I gave while your Ubuntu partition is still mounted on /mnt.
    Ok, so when I got in the grub menu and went to edit the entry I made it this
    Code:
    root (hd0,0)
    kernel /vmlinuz-2.6.20-16-server root=UUID=6e69ca5e-3407-4afd-835d-2e1b7c019cb7
    initrd /initrd.img-2.6.20-16-server
    quiet
    saveddefault
    buuut I still get the Error 15. But I just noticed that even after I make changes, if I hit ESC to go back to the grub and then edit the entry again the changes werent saved. How do I save them?

  8. #198
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Perhaps try this:

    Boot from LiveCD
    Code:
    sudo mount /dev/sda1 /mnt
    gksu gedit /mnt/boot/grub/menu.lst
    Go down about 2/3 of the way through the menu.lst file.
    Edit the first boot stanza:

    Code:
    root (hd0,0)
    kernel /boot/vmlinuz-2.6.20-16-server root=UUID=6e69ca5e-3407-4afd-835d-2e1b7c019cb7 ro quiet splash
    initrd /boot/initrd.img-2.6.20-16-server
    quiet
    saveddefault
    Save, exit, reboot.

  9. #199
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by rugbert View Post
    Ok, so when I got in the grub menu and went to edit the entry I made it this
    Code:
    root (hd0,0)
    kernel /vmlinuz-2.6.20-16-server root=UUID=6e69ca5e-3407-4afd-835d-2e1b7c019cb7
    initrd /initrd.img-2.6.20-16-server
    quiet
    saveddefault
    buuut I still get the Error 15. But I just noticed that even after I make changes, if I hit ESC to go back to the grub and then edit the entry again the changes werent saved. How do I save them?
    When you edit the Grub menu on start up by pressing "e", the changes are only temporary and not saved once you boot an OS or restart. You have to modify your menu.lst to make the changes permanent.

  10. #200
    Join Date
    Dec 2007
    Beans
    121

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by unutbu View Post
    Perhaps try this:

    Boot from LiveCD
    Code:
    sudo mount /dev/sda1 /mnt
    gksu gedit /mnt/boot/grub/menu.lst
    Go down about 2/3 of the way through the menu.lst file.
    Edit the first boot stanza:

    Code:
    root (hd0,0)
    kernel /boot/vmlinuz-2.6.20-16-server root=UUID=6e69ca5e-3407-4afd-835d-2e1b7c019cb7 ro quiet splash
    initrd /boot/initrd.img-2.6.20-16-server
    quiet
    saveddefault
    Save, exit, reboot.
    THAT WORKED! THANKS!


    So basically, the grub was referring to a block location on the previous HDD that no longer exists, so blkid finds the correct block on the current HDD? Just so I understand how it works. this is going to help me out SO MUCH in couple of weeks.

Page 20 of 26 FirstFirst ... 101819202122 ... LastLast

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
  •