Page 21 of 26 FirstFirst ... 111920212223 ... LastLast
Results 201 to 210 of 253

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

  1. #201
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

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

    rugbert, I'm glad it worked.

    The "root (hd0,0)" grub command tells GRUB to mount /dev/sda1 and look for files there.

    The command
    Code:
    kernel /boot/vmlinuz-2.6.20-16-server root=UUID=6e69ca5e-3407-4afd-835d-2e1b7c019cb7 ro quiet splash
    tells GRUB to look inside the filesystem on /dev/sda1 for a file whose path is /boot/vmlinuz-2.6.20-16-server. You were getting Error 15 (File not found) because vmlinuz-2.6.20-16-server is inside the /boot directory.

    The next part I'm a bit shady about, but I'll tell you what I think is true. I'd appreciate it if anyone can confirm this or correct me:

    The kernel needs other files to complete the boot. Some of those files might live in /etc for example. The "root=UUID=6e69ca5e-3407-4afd-835d-2e1b7c019cb7" tells the kernel to look for these other files on the partition whose UUID is "6e69ca5e-3407-4afd-835d-2e1b7c019cb7". You can find the UUID by running "blkid".

    The "ro quiet splash" are kernel boot options sent to vmlinuz-2.6.20-16-server.
    ro means "Mount root device read-only on boot". I find this a little strange, since the root filesystem is not read-only by the time the boot completes. I guess it is remounted later, but I'm unsure.
    quiet means "Disable most log messages"
    splash means display the orange progress bar instead of text messages
    Last edited by unutbu; September 11th, 2008 at 04:39 PM.

  2. #202
    Join Date
    Oct 2007
    Beans
    23

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

    Quote: <<<
    Re: HOWTO: Restore GRUB (if your MBR is messed up)
    at step 10, I encountered a problem: it asks you if you want to proceed when you click the Install Grub, and in all the previous steps, "yes" or "continue" was the correct response, at step 10, if you select "yes" the ubuntu disk will proceed and attempt to install ubuntu.... which will ruined my current install... ah well....
    >>>

    I feel for you. 8)
    I did soemthing quite similar myself. I selected "yes" and it said
    "installing base system". I thought - but this will wipe out my current
    installation - and with panic I hit the reset button. So far it seems to be OK,
    I am running (the previously installed) Ubuntu as I type and nothing *seems*
    to have changed. I guess it was still "reading" the CD and didn't have time
    to start writing yet. But in general the install CD tries to force you to
    install. I'd rather avoid that and use the other methods people contributed
    here. I'll have to download a "live" CD. Then after I have it, translate the
    following for my computer...

    Quote: <<<
    1. Pop in the Live CD, boot from it until you reach the desktop.
    2. Open a terminal window or switch to a tty.
    3. Type "grub"
    4. Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
    5. Type "setup (hd0)", ot whatever your harddisk nr is.
    6. Quit grub by typing "quit".
    7. Reboot.
    >>>

    In my case, Windows is on the first drive on channel 1 and Ubuntu is on
    partition 3 of the first drive on channel 2. Linux calls these /dev/hda
    with windows at /dev/hda1, and /dev/hdc with Ubuntu at /dev/hdc3.
    So, translating the above, what should I type?
    "root (hd2,2)" { assumming that /dev/hda hd0 and /dev/hdc is hd2 }
    "setup (hd0)" { to install in the MBR is the first drive /dev/hda }
    Did I get this right?
    I know this will install grub in the MBR of my first drive: this is what
    I want to do. (If you don't want to do that, you should do something else).

  3. #203
    Join Date
    Mar 2008
    Location
    Northern Virginia, USA
    Beans
    41
    Distro
    Hardy Heron (Ubuntu Development)

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

    These answers tell what is so basically wrong with Linux Pundits. How do we open a terminal? What do I do if I do not have a live CD? What is tty?

    Plus what about a two or more disk scenario? How about if you have Vista installed? Here is my scenario:

    The first PATA Harddisk (0) has three partitions. Ubuntu is installed in the third partition.

    The second is a larger and newer SATA hard disk (1) which already has Vista installed in its partition one.

    In my BIOS I have designated my larger SATA disk (1) as the boot disk.

    When I installed Ubuntu on the older and my first PATA hardrive, Ubuntu correctly installed GRUB on the PATA Disk (0). I changed my BIOS settings and designated the PATA Disk (0) as my first boot hard drive. GRUB came up and I was able to start Ubuntu and later "Windows longhorn" as well.

    But the next day something happened and GRUB did not come up. I used the Ubuntu in rescue mode and got my Ubuntu installation back.

    Question and Problem: Where (and How) should I install GRUB?

    P.S: Both, my Vista and Ubuntu (Intrepid beta), are properly installed and work fine when I do a manual boot through the SUPER GRUB DISK. However, SuperGrub fails to install GRUB. The GRUB menu still comes up but gives a disk error when I attempt to start Intrepid. However, when I use the same GRUB to start "windows longhorn" Vista boots fine.
    Last edited by kushykush; September 19th, 2008 at 07:57 AM. Reason: added more info

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

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

    Kushykush, since you can boot Ubuntu from Super Grub, go ahead and do that, and once you are in Ubuntu, open a terminal (Applications > Accessories > Terminal), and post the output of the following:
    Code:
    sudo fdisk -lu
    cat /boot/grub/menu.lst
    Also, I assume you want to keep Grub installed to your PATA Ubuntu drive, and not your SATA drive, is that right? In other words, do you want to keep the PATA drive first in the boot order, and have it load Grub on start up?

  5. #205
    Join Date
    Mar 2008
    Location
    Northern Virginia, USA
    Beans
    41
    Distro
    Hardy Heron (Ubuntu Development)

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

    I have no preference as to which hard drive the system boots from. Note that grub menu.lst rightly shows a Vista installation on Sda1 (hd0,0). However, this is an old Vista installation that does not work and Windows is not using it. I am using the new Vista installation on Sdb1 (hd1,0). This is currently the system boot.
    Here is an ancilliary problem. When for some reason, my GRUB got messed up, I installed GRUB on the Ubuntu-Intrepid partition (/dev/Sda5). This GRUB installation works manually through SuperGrub disk, and Ubuntu-Intrepid starts. However, Intrepid had installed GRUB on the MBR of VISTA (/dev/Sdb1). It is this GRUB which does not work. GRUB menu comes up but it fails to connect with Ubuntu-Intrepid installationn on /dev/sda5). Will this be a problem? I mean should the GRUB installed inside Intrepid on /dev/sda5 pose a problem when GRUB is finally installed on /dev/sdb1 ? (I do not know how to install GRUB there and if that is where it should be installed.
    Here is the output from fdisk -lu and cat /boot:
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Disk identifier: 0xc518c518

    Device Boot Start End Blocks Id System
    /dev/sda1 * 63 65239964 32619951 7 HPFS/NTFS
    /dev/sda2 65241088 137517055 36137984 7 HPFS/NTFS
    /dev/sda4 137532465 312576704 87522120 5 Extended
    /dev/sda5 219447963 308672909 44612473+ 83 Linux
    /dev/sda6 308672973 312576704 1951866 82 Linux swap / Solaris
    /dev/sda7 137532591 219367574 40917492 83 Linux

    Partition table entries are not in disk order

    Disk /dev/sdb: 400.0 GB, 400088457216 bytes
    255 heads, 63 sectors/track, 48641 cylinders, total 781422768 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Disk identifier: 0xce66706a

    Device Boot Start End Blocks Id System
    /dev/sdb1 * 2048 204802047 102400000 7 HPFS/NTFS
    /dev/sdb2 204802048 330860543 63029248 7 HPFS/NTFS
    /dev/sdb3 330860544 453740543 61440000 7 HPFS/NTFS
    /dev/sdb4 453755925 551415059 48829567+ 83 Linux


    cat /boot/grub/menu.lst
    default 7
    timeout 12

    ### 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=38e428ce-aa58-4038-8300-0725b56bc8d2 ro

    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd0,4)

    ## 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

    ## should update-grub add savedefault to the default options
    ## can be true or false
    # savedefault=false

    ## ## End Default Options ##

    title Ubuntu intrepid (development branch), kernel 2.6.27-3-generic
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.27-3-generic root=UUID=38e428ce-aa58-4038-8300-0725b56bc8d2 ro quiet splash
    initrd /boot/initrd.img-2.6.27-3-generic

    title Ubuntu intrepid (development branch), kernel 2.6.27-3-generic (recovery mode)
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.27-3-generic root=UUID=38e428ce-aa58-4038-8300-0725b56bc8d2 ro single
    initrd /boot/initrd.img-2.6.27-3-generic

    title Ubuntu intrepid (development branch), kernel Last successful boot
    root (hd0,4)
    kernel /boot/last-good-boot/vmlinuz root=UUID=38e428ce-aa58-4038-8300-0725b56bc8d2 ro quiet splash last-good-boot
    initrd /boot/last-good-boot/initrd.img

    title Ubuntu intrepid (development branch), kernel 2.6.27-2-generic
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.27-2-generic root=UUID=38e428ce-aa58-4038-8300-0725b56bc8d2 ro quiet splash
    initrd /boot/initrd.img-2.6.27-2-generic

    title Ubuntu intrepid (development branch), kernel 2.6.27-2-generic (recovery mode)
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.27-2-generic root=UUID=38e428ce-aa58-4038-8300-0725b56bc8d2 ro single
    initrd /boot/initrd.img-2.6.27-2-generic

    title Ubuntu intrepid (development branch), memtest86+
    root (hd0,4)
    kernel /boot/memtest86+.bin

    ### END DEBIAN AUTOMAGIC KERNELS LIST

    title Other operating systems:

    title Windows Vista/Longhorn (loader)
    root (hd0,0)
    chainloader +1
    savedefault
    makeactive

    title Windows Vista/Longhorn (loader)
    root (hd1,0)
    map (hd0) (hd1)
    map (hd1) (hd0)
    chainloader +1
    savedefault
    makeactive

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

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

    Quote Originally Posted by kushykush
    The first PATA Harddisk (0) has three partitions. Ubuntu is installed in the third partition.
    OK, you've got me confused then, because according to your fdisk output, you have 6 partitions on your PATA drive (sda), including the extended partition. So is Ubuntu-intrepid on sda5 like you said in your follow-up post? Also what is sda7 and sdb4 (they are also Linux partitions)? And did the menu.lst you posted come from Ubuntu-Intrepid in sda5?

  7. #207

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

    hi folks,

    just a note that might help some.

    if you have partitioned your installation like:

    /boot
    /
    /swap
    /home

    you should change your command in grub from

    find /boot/grub/stage1

    to

    find /grub/stage1

    the reason is that there will be no folder under "/" (root) for boot


    just a catch for those that do not know it.


    regards,


    Nicolas
    www.brainpowered.net
    supporting Open-Source in Europe. Business Intelligence, Talend ETL & Database Services

  8. #208
    Join Date
    Feb 2009
    Beans
    2

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

    i was initially having windows vista.. then i installed xp by ist changing the bios setting and making hard disk to ATA format... i tried many options to install the grub as linux is already installed in a separte partition sda7... following is menu.lst ... please help me out in installing the grub...


    # menu.lst - See: grub(, info grub, update-grub(
    # grub-install(, grub-floppy(,
    # 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 use 'savedefault' or your
    # array will desync and will not let you boot your system.
    default 8

    ## 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

    # 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=f9c966fa-b83b-47d0-be89-9995b5a9d19a ro

    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=f9c966fa-b83b-47d0-be89-9995b5a9d19a

    ## 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

    ## should update-grub add savedefault to the default options
    ## can be true or false
    # savedefault=false

    ## ## End Default Options ##

    title Ubuntu 8.10, kernel 2.6.27-11-generic
    uuid f9c966fa-b83b-47d0-be89-9995b5a9d19a
    kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=f9c966fa-b83b-47d0-be89-9995b5a9d19a ro quiet splash
    initrd /boot/initrd.img-2.6.27-11-generic
    quiet

    title Ubuntu 8.10, kernel 2.6.27-11-generic (recovery mode)
    uuid f9c966fa-b83b-47d0-be89-9995b5a9d19a
    kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=f9c966fa-b83b-47d0-be89-9995b5a9d19a ro single
    initrd /boot/initrd.img-2.6.27-11-generic

    title Ubuntu 8.10, kernel 2.6.27-10-generic
    uuid f9c966fa-b83b-47d0-be89-9995b5a9d19a
    kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=f9c966fa-b83b-47d0-be89-9995b5a9d19a ro quiet splash
    initrd /boot/initrd.img-2.6.27-10-generic
    quiet

    title Ubuntu 8.10, kernel 2.6.27-10-generic (recovery mode)
    uuid f9c966fa-b83b-47d0-be89-9995b5a9d19a
    kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=f9c966fa-b83b-47d0-be89-9995b5a9d19a ro single
    initrd /boot/initrd.img-2.6.27-10-generic

    title Ubuntu 8.10, kernel 2.6.27-7-generic
    uuid f9c966fa-b83b-47d0-be89-9995b5a9d19a
    kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=f9c966fa-b83b-47d0-be89-9995b5a9d19a ro quiet splash
    initrd /boot/initrd.img-2.6.27-7-generic
    quiet

    title Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
    uuid f9c966fa-b83b-47d0-be89-9995b5a9d19a
    kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=f9c966fa-b83b-47d0-be89-9995b5a9d19a ro single
    initrd /boot/initrd.img-2.6.27-7-generic

    title Ubuntu 8.10, memtest86+
    uuid f9c966fa-b83b-47d0-be89-9995b5a9d19a
    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/sda1
    title Windows Vista/Longhorn (loader)
    root (hd0,0)
    savedefault
    chainloader +1

  9. #209
    Join Date
    Oct 2006
    Beans
    2

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

    Thanks, Rhyder... the second method in #204 worked for me!

  10. #210
    Join Date
    Dec 2004
    Beans
    374

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

    Quote Originally Posted by nicolasdiogo View Post
    hi folks,

    just a note that might help some.

    if you have partitioned your installation like:

    /boot
    /
    /swap
    /home

    you should change your command in grub from

    find /boot/grub/stage1

    to

    find /grub/stage1

    the reason is that there will be no folder under "/" (root) for boot


    just a catch for those that do not know it.


    regards,


    Nicolas
    Yes! That's huge.

    I have replaced the hard drive in my laptop with a larger one and have been banging my head against the wall trying to get it to boot. That little hint got me past the "file not found" when trying to boot. If anyone is particularly interested, I saved (text) screen dumps of all pertinent information that got me to that point and can post.

    Unfortunately, I seem to be not out of the woods yet. During the boot process, the screen just fades to white and the machine locks up.

Page 21 of 26 FirstFirst ... 111920212223 ... 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
  •