Page 5 of 26 FirstFirst ... 3456715 ... LastLast
Results 41 to 50 of 253

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

  1. #41
    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.

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

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

    Ok I am going to tell everything now. I wanted to install a second Ubuntu for testing stuff on it so that I don't mess up my primary Ubuntu install. I wanted to do some partitioning with gparted. It gave me two errors and later it showed that I don't have partitions on my second harddrive (where both Ubuntus are now installed) just unpartitioned space. I didn't make a notice of it. I booted into windows (yes, I have windows too) and it worked (windows has a bit of that second harddrive too ). Later I installed the second Ubuntu, but when I wanted to go to the primary Ubuntu (I hadn't done it for some time) it didn't work. It gave me an error similar to "can't start tty, job control turned off". I posted a thread to get help and someone said "have you tried reinstalling grub" and gave me a link to this thread. I tried to do that now, but I got the error I discriber in the last post. Is it because the gparted errors? Do I have to throw away both Ubuntus, format the whole harddrive and start installing again those thousands of stuff?
    Viller on freenode.

  3. #43
    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....

  4. #44
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

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

    Hi commodore.
    What is the content of your /grub/boot/device.map file?

    As far as I can make out, any disk on which you want to install grub with the "sudo grub-install" command must be listed in the device.map file or you will get the error mesage you mentioned. Try adding an appropriate line to the file as in my first post to this thread, but also note the end of the error message (or at least this is what I see) telling you the error can be ignored and should not cause any problems, and then listing the content of your device.map file and telling you to amend it if needed.

    Give it a try.
    Last edited by ajgreeny; November 28th, 2005 at 11:31 AM.

  5. #45
    Join Date
    Nov 2005
    Beans
    9
    Distro
    Ubuntu Breezy 5.10

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

    Just thought I would share my experience of GRUB.

    Windows on hda
    Ubuntu on hdb
    GRUB working fine

    One day Windows just doesn't load - it just sits at the splash screen and goes nowhere.

    Used XP CD to restore MBR using fixmbr.

    I then used the "install CD" method at the top of this post to reinstall GRUB. When I got to the manual partitioning part I noticed that hdb was mounted as /media/hdb. I set this as '/'. I then jumped to the reinstall GRUB part of the install process and everything else worked as described.

    Top post from vnbuddy2002

    It wasn't all plain sailing - I tried the live CD method and got an error 21 when I tried to root (hd0,0). Tried seaching forums but couldn't get to the bottom of it.

  6. #46
    Join Date
    Sep 2005
    Location
    no fixed address
    Beans
    40
    Distro
    Ubuntu 10.10 Maverick Meerkat

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

    very first post worked perfectly for me after a Norton ghost image hosed my grub/mbr.

    Couldn't get live cd methods to work.

    Have to say, it's a little scary when the install cd asks you if you really want to write the changes to the disk (no changes, you're really just mounting existing) .. but it works!!!!!!!!!!!

    Thanks a hell of a lot, this was causing me extreme stress, what with Xmas rolling around etc..

    Real lesson: time to get rid of Windows.

    TG.

  7. #47
    Join Date
    Aug 2005
    Location
    Hamburg, Germany
    Beans
    12
    Distro
    Ubuntu 10.04 Lucid Lynx

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

    Thank you, thank you, thank you, ghostintheshell! This did the trick for me.

    Here is the problem I had: Two HDDs, just Ubuntu installed on them (so no dual-boot setup), yesterday it booted just fine, today it didn't. No updates or anything either, I shut the computer down like always and it gave me these mesages on startup today:

    Code:
    module minix not found
    ...
    can't access tty; job control turned off
    ...
    Target filesystem doesn't have /sbin/init
    So thank you again, ghostintheshell and everybody else who worked toward this solution.

    Quote Originally Posted by ghostintheshell
    Aaargh!! Thank you guys!! Very very very much!! You saved my virtual life!

    I lost my Grub / MBR and YOU restored it!

    After searching too much time on the web, I fell on this topic. I read it completely and applied a mix of your solutions.

    Here's the steps I followed to restore GRUB / my initial MBR:

    1. Boot with any live CD (I've done it with Ubuntu Live DVD)
    2. Get a root shell -> Applications / System Tools / Root Terminal
    3. Make a folder -> mkdir /mnt/ubuntu
    4. Check the Ubuntu partition -> fdisk -l (Mine is /dev/hda4)
    5. Mount the root partition of Ubuntu -> mount -t ext3 /dev/hda4 /mnt/ubuntu (replace /dev/hda4 by your Ubuntu partition determined at the step 4)
    6. Chroot the mounted partition -> chroot /mnt/ubuntu
    7. Restore Grub / the initial MBR -> grub-install /dev/hda
    8. Exit the shell
    9. Reboot

    That did the trick for me.

    Thank you very much again to all of you! ( :bigsmack: )

  8. #48
    Join Date
    Nov 2005
    Beans
    2

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

    Ive completely messed up my system, cant get into Linux or Windows.

    Had Windows installed for about 4 weeks on my new system and had left 10gb spare as a partition for linux, got round to installing it yesterday and it didnt go too well. I got upto the bit where it asks if you want to install GRUB, i said "Yes" and it did its business, told me to take out the cd and reboot.

    After that it was trying to boot from the PXE-E53, i tried various things and couldnt get it working. Put in the WinXP cd and went to recovery console and tried fixmbr/ fixboot which then gave me the error "ntldr is missing". Tried copying ntldr and ntdetect from the winXP cd in i386 but got the same message.

    So... i got told by a friends friend if i could get into linux (usin the live cd) and use GRUB, id be able to fix it and get the MBR / GRUB back. Ive tried the various ways on here to get my system back, but none have worked (prolly my fault though).

    My system:
    Shuttle SN25P (nForce4 mobo)
    AMD Athlon64 3700+ San Diego
    2Gb RAM Geil
    1 x 80Gb Maxtor SATA HDD (with 2 partitions, WinXP being the main one)
    2 x 300Gb Maxtor SATA HDD (No o/s's on either of these)
    ATi X1800XL


    Now ... the way my hdd's are setup in the BIOS shows that the 80gb hdd is listed 3rd (which would mean its sdc).
    When i got into GRUB and did the search, it told me the boot was (HD2,1), so i changed what i needed to to that and on boot up it says :

    root (hd2,1)

    Error 22: No such partition

    Press any key to continue...
    Pressing any key takes me back to the GRUB o/s selection screen where it gives me the same error for all the options accept windows which says the following :

    Booting 'Windows NT/2000/XP (loader)'

    root (hd2,1)
    Filesystem type unknown, partition type 0x42
    savedefault
    maleactive
    map (hd0) (hd2)
    map (hd2) (hd0)
    chainloader +1

    NTLDR is missing
    Peress Ctrl+Alt+Del to restart

    Would really rather not have to format and start all over again, im surei dont have to ... its just im completely stuck now and dont know what else to try.

    Please help !


    --------
    Edit:

    Fdisk -l
    root@ubuntu:/root# sudo fdisk -l

    Disk /dev/sda: 300.0 GB, 300090728448 bytes
    16 heads, 63 sectors/track, 581463 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 581463 293057320+ 42 SFS

    Disk /dev/sdb: 300.0 GB, 300090728448 bytes
    16 heads, 63 sectors/track, 581463 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes

    Device Boot Start End Blocks Id System
    /dev/sdb1 * 1 581463 293057320+ 42 SFS

    Disk /dev/sdc: 81.9 GB, 81964302336 bytes
    255 heads, 63 sectors/track, 9964 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sdc1 1 8688 69786328+ 7 HPFS/NTFS
    /dev/sdc2 * 8689 9907 9791617+ 83 Linux
    /dev/sdc3 9908 9964 457852+ 5 Extended
    /dev/sdc5 9908 9964 457821 82 Linux swap / Solaris

    Disk /dev/sdf: 250.9 GB, 250999209984 bytes
    255 heads, 63 sectors/track, 30515 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sdf1 * 1 30515 245111706 7 HPFS/NTFS
    grub> find /boot/grub/stage1
    (hd2,1)

    Just read this though on the first page... and think it may be what ive done?
    [1] Important: If you are multi-booting with Windows, make sure you do NOT install the MBR on the active partition (say /dev/hda1) but on the drive (/dev/hda). At least with Windows XP, you will have to re-install it (FIXMBR/FIXBOOT won't work).
    Last edited by Carwash; December 29th, 2005 at 03:27 PM.

  9. #49
    Join Date
    Nov 2005
    Location
    UK
    Beans
    61

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

    I may be missing the point here, but can't you just do:

    Code:
    dd if=/dev/hda of=hdambr bs=512 count=1
    to restore the 1st stage loader and the reinstate a backup of the /boot partition?

  10. #50
    Join Date
    Dec 2005
    Beans
    6

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

    Quote Originally Posted by rpakdel
    Here is another way:

    1. Boot with any live CD (I've done it with Knoppix 3.x and Ubuntu)
    2. Get a root shell and make a folder (mkdir ubuntu)
    3. mount the root (/) partition of ubuntu (e.g. mount /dev/hdb ubuntu if you have two disks)
    4. chroot the mounted partition (chroot ubuntu)
    5. grub-install /dev/hda [1]
    5. Exit the shell
    6. Reboot

    [1] Important: If you are multi-booting with Windows, make sure you do NOT install the MBR on the active partition (say /dev/hda1) but on the drive (/dev/hda). At least with Windows XP, you will have to re-install it (FIXMBR/FIXBOOT won't work).

    Thanks man, this worked great after I tried to reinstall Dell mediaDirect(apparently dell rewrites the bootloader..bad dell very bad...) If you have sata drives just use "sda" instead of hda.

Page 5 of 26 FirstFirst ... 3456715 ... 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
  •