Page 2 of 15 FirstFirst 123412 ... LastLast
Results 11 to 20 of 253

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

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Location
    New Mexico, USA
    Beans
    Hidden!
    Distro
    Kubuntu 8.04 Hardy Heron

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

    avoid? hell, for a newbie prior to actually being booted into whatever distro, commandline is virtually impossible, it's plain wilderness stuff.
    New Mexico, USA - "Atlas Shrugged"

  2. #2
    Join Date
    Mar 2007
    Location
    Outer Milky Way
    Beans
    Hidden!
    Distro
    Kubuntu 12.04 Precise Pangolin

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

    Quote Originally Posted by RonKZ View Post
    avoid? hell, for a newbie prior to actually being booted into whatever distro, commandline is virtually impossible, it's plain wilderness stuff.
    These are cut and paste instructions, mate. Perhaps you should join Hare Krishna. They'll take care of you if you've had too many drugs to cut and paste.

    UbuntuGuide/KubuntuGuide

    Right now the killer is being surrounded by a web of deduction, forensic science,
    and the latest in technology such as two-way radios and e-mail.

  3. #3
    Join Date
    May 2005
    Location
    Karditsa , Greece
    Beans
    106
    Distro
    Ubuntu 8.04 Hardy Heron

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

    Quote Originally Posted by remmelt
    I may be missing your point though, if so, please forgive me
    This way the user must know the correct hd(0,6) .
    So I believe that this way is actually more complex
    salagata

  4. #4
    Join Date
    Nov 2005
    Beans
    19

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

    Ok, sort of figured out my problem. The offender was a 2nd PATA drive I had salvaged from an old computer and installed in my machine. When I removed that and did a clean install of Kubuntu on the partition I had made previous on my SATA drive - the defaults for GRUB worked fine. I can now get back into Windows (who ever thought I would be so happy to the see the Windows welcome screen...) and can also boot to Kubuntu.

    Going to try and few other things and see if I can't get that old PATA working and remort it for FAT32 - should be able to use it to share files between Win/Linux right?

    Now for the easy question - how do I extend the default time that GRUB gives you to make a selection?

  5. #5
    Join Date
    Jul 2005
    Beans
    70

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

    Quote Originally Posted by jars_u
    [...]

    Now for the easy question - how do I extend the default time that GRUB gives you to make a selection?
    Code:
    sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bkp
    sudo gedit /boot/grub/menu.lst
    and modify here:

    Code:
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout        1
    timeout X ==> X sec.
    -- sorry for my crappy english

  6. #6
    Join Date
    Sep 2005
    Location
    Estonia
    Beans
    388
    Distro
    Ubuntu Breezy 5.10

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

    I have two grubs accidently. They are on different partitions. Someone sayd I should reinstall grub. I tried to install it on where it was first, but I get this: xfs_freeze: specified file ["/boot/grub"] is not on an XFS filesystem
    Viller on freenode.

  7. #7
    Join Date
    Nov 2005
    Beans
    224

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

    have some difficulties with the two first suggestions.
    When booting up my pc, I directly jump into windows.

    I tried installing grub from cd and when its finished it jumps straight back to
    selecting partitions. Dont know why.
    So I then tried to install via live cd.
    type su and try the password I have on my linux partition, and it doesnt work.
    I also tried every other possible passw. but still it doesnt work.

    fdisk:
    ubuntu@ubuntu:~$ sudo fdisk -l

    Disk /dev/hda: 120.0 GB, 120034123776 bytes
    255 heads, 63 sectors/track, 14593 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/hda1 * 1 3696 29688088+ 7 HPFS/NTFS
    /dev/hda2 3697 14593 87530152+ 5 Extended
    /dev/hda5 3697 6307 20972822+ 83 Linux
    /dev/hda6 6308 6361 433723+ 82 Linux swap / Solaris
    /dev/hda7 6362 14593 66123508+ 7 HPFS/NTFS

    where hda1 is parition C: on windows
    hda2 is unknown, but I think its where hda5 and hda7 is written to.
    hda 5 is my linux (used to be hda6 and hda7 is D: in windows (used to be hda5

    so I really need help guys....

  8. #8
    Join Date
    Nov 2005
    Beans
    2

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

    Quote Originally Posted by remmelt
    Isn't it easier to do this:

    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.
    This did work wonder in restoring the MBR of my Compaq Armada 1750 after I restored the laptop from Ghost. Yet the laptop's special partitition, where the BIOS tools are located, is no longer accessible through pressing F10 duing POST.

    I can live with this as I still can access the BIOS settings through using a floppy. Yet I wonder if there is a way to have both Grub and the easy F10 access to the BIOS tools.

    I suspect that the original Compaq MBR is Windows-compatible. I may be able to Windows' boot.ini to access the Linux partitions and still keep the original BIOS access intact.

    Thanks.

  9. #9
    Join Date
    Jan 2006
    Beans
    19

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

    Quote Originally Posted by remmelt
    Isn't it easier to do this:

    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.

    I may be missing your point though, if so, please forgive me

    This method did bring back my grub, however I get an error when I boot.
    My partition list is:
    /dev/hda1 Windows NTFS (Has my XP Pro on it)
    /dev/hda2 Extended 3 (Has my Ubuntu on it, and I can mount and look at all my data)
    /dev/hda5 Swap
    /dev/hda4 Unformatted

    I opened a terminal window and did the following:

    Code:
    grub> root (hd0,1)
     Filesystem type is ext2fs, partition type 0x83
    
    grub> setup (hd0)
     Checking if "/boot/grub/stage1" exists... yes
     Checking if "/boot/grub/stage2" exists... yes
     Checking if "/boot/grub/e2fs_stage_5" exisits... yes
     Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded. succeeded
     Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,1)/boot/grub/stage2 /boot/grub/menu.list"... succeeded
    Done.
    The first time I ran this command I did get errors, but it said they were not fatal. I do not know what they where, but now it seems to succeed just fine.


    But when I boot my screen looks like:
    Code:
      Booting 'Ubuntu. kernel 2.6.12-10-386 '
    
    root (hd0,2)
     Filesystem type unknow, partition type 0x5
    kernel /boot/vmlinuz-2.6.12-10-386 root=dev/hda3 ro quiet splash
    
    Error 17: Connot mount selected partition
    
    Press any key to continue...
    Also when I boot using the the rescue option and then type:

    Code:
    sh-3.00# grub-install /dev/hda2
    I get:

    Code:
    The file /boot/grub/stage1 is not read correctly.
    So now I am not sure what I should do.... My linux is on hda2. I have very little knowledge of linux. The menu still boot my Windows XP. I wish it was there other way around.

    Thanks for your help.

  10. #10
    Join Date
    Jan 2006
    Beans
    19

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

    If anyone caree, I was able to fix my problem by editing the menu.lst file in /boot/grub. I changed the file to read:

    root (hd0,2)
    kernel /boot/vmlinuz-2.6.12-10-386 root=dev/hda3 ro quiet splash

    to

    root (hd0,1)
    kernel /boot/vmlinuz-2.6.12-10-386 root=dev/hda2 ro quiet splash

    and all works fine now. This thread helped alot. Thanks.

Page 2 of 15 FirstFirst 123412 ... 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
  •