Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: I am in hell, Trust me.

  1. #1
    Junior Member registered user
    Join Date
    Feb 2004
    Posts
    14

    I am in hell, Trust me.

    Sigh!

    I have deleted the MBR. Yes i know, then everything is lost and unrepairable.

    *BUT, the thing is that i have not yet booted my computer yet*.

    When i do all will be gone forever, hda1, hda2, hda3, all of it. No harddisk recovery program will ever get the system back. I have (had?) a dualbootsystem that i have optimised for a half year or so. I feel sick when i think about it. But now everything works nice, i can access all partitions everything is still here, exept when i take a look on hda with qtparted. Then hda ofcourse is totally unreadable, because it tries to read from the actual master boot record (and not from memory and the post-booted info on disk.)

    THE QUESTION :
    Is there anyway that i can copy the data my computer is aware of right now when it still is unbooted and put it on the mbr? Something in the /boot folder? Anything that would make it possible to once more see that lovely Debian dualbootscreen once more? Can i make a startupdisk with the help of grub? And then copy the floppy to the hda bootblock?

    How did this happend?
    I was going to to copy a image of the mbr of my external drive to that very drive(sda1) but by fatal error i copied to hda. Adios partitions.

    The limits of language fails to express how grateful i would be if someone could offer a glimpse of salvation out of this evil mess.

    Thanks for reading this,
    Björn.

  2. #2
    Senior Member registered user
    Join Date
    Oct 2004
    Posts
    260
    Take some deep breaths and know that most of us can relate to this.

    I have used this bootloader ( see link below ) to rescue systems I couldn't boot any other way

    http://gujin.sourceforge.net/

    My thought is if you can enter/boot the system with this bootloader you can
    then create a floppy or reinstall grub from the running system itself.

    I'm sure there are ways to do this with grub, at the command, line but my experiance
    is mostly editing menu.1st. In fact I haven't found the grub command line to be so easy.

    Good luck!

    Note: It seems like most of the ideas put forth, after this post, focus on different tools which are fine.
    But I'll just say that I have gujin on a floppy just for this type of situation and it never fails to boot a
    reluctant system (as long as it's still there) I just like the lazy approach.

  3. #3
    Member registered user
    Join Date
    Apr 2004
    Posts
    50
    First, relax. Everything will be fine.

    I've done the same thing before--accidentally overwritten my partition table but the rest of the files are there. Luckily there is a tool called gpart that can recover everything for you. When I give Knoppix talks, I actually purposely write zeros over my MBR with dd and then recover with gpart while the audience is watching. I go over the steps in my talk at http://greenfly.org/talks/knoppix_hacks/intro.html near the end, but here are the basic steps:

    1) Open a terminal and type:
    Code:
    sudo gpart /dev/hda
    2) The gpart program will scan your system for partitions and then recreate a partition table based on them. Check out what partitions it finds.

    3) If you accept what it finds, run
    Code:
    sudo gpart -W /dev/hda /dev/hda
    4) The -W option will write the new partition table onto /dev/hda, so run this when you are fine with what it says. If you see a minor discrepancy, don't edit it within gpart as it can get a bit complicated. I've found that it's easier to use cfdisk afterwards.

    5) Run
    Code:
    sudo cfdisk /dev/hda
    and check out your new partition table. You can make any changes you need to (I've noticed gpart doesn't always find the end of the partition correctly so it'll be a few megs off).

    6) Try to get this far. I assume at this point that your partition table is restored. The next step is to restore the boot loader, but all of that depends on whether you use lilo or grub. You need to identify your root partition. Let's say it is /dev/hda2

    7) Mount your root partition:
    Code:
    sudo mount -o rw /dev/hda2 /mnt/hda2
    8a) If you use lilo:
    Code:
    sudo chroot /mnt/hda2 lilo
    8b) If you use grub:
    Code:
    sudo chroot /mnt/hda2 grub-install /dev/hda
    or if that doesn't work,
    Code:
    sudo grub-install --root-directory=/mnt/hda2 /dev/hda
    9) reboot and everything should be normal

  4. #4
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441

    Re: I am in hell, Trust me.

    Quote Originally Posted by Schopenhauer101
    I have deleted the MBR. Yes i know, then everything is lost and unrepairable.
    .....
    When i do all will be gone forever, hda1, hda2, hda3, all of it. No harddisk recovery program will ever get the system back........
    Not at all. The first question is just how did you delete the MBR, and did you delete just the MBR or the entire first sector?

    If I recall right, The first sector of your hard disk contains both the mbr and the partition table. If you've just deleted the MBR (the first four hundred and some bytes of the sector), you can easily fix it. "FDISK /MBR" from the DOS command line is one way. You might also look at it as an excelent oppertunity to install Smart Boot Manager to the hard disk MBR; think of it as an upgrade with no down side risk.

    If the entire first sector is blown, including that the partition table is gone, then you would need some way to rebuild the partition table. Turns out there's a handy linux command to do just that! It scans your hard drive, figures out where the partitions are and their type and size and recreates the table for you. If only I could remember the name of that command (but then what fun would Linux be without all of the cryptic commands that only geeks know?) Sadly, I'm sure the program is there but not as sure of the name, but you might look and see if there is a command called "gpart" or somethings very similar to that (I'm on Windows at the moment and can't boot Knoppix because of other things running that shouldn't be stopped) . And, of course, after fixing the partition table, you'll want to do one of the above to replace the MBR too.

    Good luck and please post back to let others know how it goes (and what you did to kill the MBR in the first place).

  5. #5
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    Ah, I see that while I was typing greenfly posted and confirmed that it is gpart! Great.

  6. #6
    Junior Member registered user
    Join Date
    Feb 2004
    Posts
    14
    Hi and thanx alot for your advices and concern. Well im writing this from a knoppix cd so i think that pretty much gives a clue about how my system (and nervous system too) is doing. Well everything isnt death and despair anyway after all.

    Let me tell. First i burned a backup-cd of the entire /boot folder with grub and all inside. About 12 megs. Then i created a grub bootfloppy with stage1 and 2 whatever that is supposed to mean. then i downloaded and created a GAG boot disk. And then i found out something great. In the grub folder there is always a file called "boot.0300" That file is actually a mbr-image. I googled around a bit more and then after a while i felt secure enough to add the image to my hda. Then i opened qtparted again. YES, all partitions back again looking just the way they are supposed to.

    Relifed i rebooted my decitefull little darling just too get struck by the famous 99 99 99 99 99 99 99 screen. Sigh. I inserted the grubdisk and it showed all that i wanted. But it couldnt launch linux, it complained about the stuff not being on my harddrive. I tried the GAG disk and reached a very limited grub shell. The XP partition worked however. I then used knoppix and found my linuxpartitions and everything on em to be alive.

    If anyone knows how to make grub come alive again it would be great. I really miss my linux system and hope to be able to stay away from XP as much as possible exept when using my music/midi equipment.

    Thanx for all help. The partition table seems to be ok, and if anyone knows how to get things working with grub it would be great help coz the stuff i get when i google is so contradictory.

    Take care/
    Bj;rn

  7. #7
    Member registered user
    Join Date
    Apr 2004
    Posts
    50
    Quote Originally Posted by Schopenhauer101
    <snip>

    If anyone knows how to make grub come alive again it would be great. I really miss my linux system and hope to be able to stay away from XP as much as possible exept when using my music/midi equipment.

    Thanx for all help. The partition table seems to be ok, and if anyone knows how to get things working with grub it would be great help coz the stuff i get when i google is so contradictory.

    Take care/
    Bj;rn
    Congrats! I bet you feel a lot better now. I'm glad you were able to find a backup copy of your MBR. The steps are slightly different since you have a separate /boot partition. Assuming your /boot partition is /dev/hda2 here is what you do:

    1)
    Code:
    sudo mount -o rw /dev/hda2 /mnt/hda2
    2)
    Code:
    cd /mnt/hda2; sudo ln -s . boot
    this creates a recursive symlink called boot, as the grub-install tool expects to be pointed to a directory that contains a boot directory inside.

    3)
    Code:
    sudo grub-install --root-directory=/mht/hda2 /dev/hda
    this should restore grub completely to your boot code.

    4) Reboot and hopefully you should see your old grub menu.

  8. #8
    Junior Member registered user
    Join Date
    Feb 2004
    Posts
    14
    Thank you, really!!! When shit like this kind of crashes happens i wonder why i bother to care about linux or even computers in general. But when i get suprised the other way around, by the effort, friendliness and solidarity from people stuck in the linux swamp im really quick to re-remember why it fun and worth it.

    I will try out to reinstall grub but im first going to check out the smart boot manager, just because ive never tried it before. I do not by the way have a separate boot partition. I got a boot folder under / on hda. Should that make anything very different from what you recommended?

    Take care, and thanx once more.

    /Bj0rn

  9. #9
    Member registered user
    Join Date
    Apr 2004
    Posts
    50
    If /boot is under your root partition and not on a separate partition, you can simply skip the step that makes a boot symlink inside your /boot directory.

  10. #10
    Junior Member registered user
    Join Date
    Feb 2004
    Posts
    14

    Thanx for all help!

    This is a great forum. Everythings works fine. This night i will browse around the forum and see if i can help some people that got some very newbie questions:
    Take care all.
    /Björn

Page 1 of 2 12 LastLast

Similar Threads

  1. Printer Hell
    By sakiZ in forum Hdd Install / Debian / Apt
    Replies: 5
    Last Post: 12-02-2006, 02:58 AM
  2. gaim .deb .rpm hell
    By dvryknopper in forum General Support
    Replies: 1
    Last Post: 03-16-2006, 09:59 PM
  3. Trust Spyc@m 100 on Knoppix
    By fcamisa in forum Hardware & Booting
    Replies: 0
    Last Post: 06-24-2004, 12:58 PM
  4. Java Upgrade Hell
    By Arkaein in forum Hdd Install / Debian / Apt
    Replies: 12
    Last Post: 03-30-2004, 04:00 AM
  5. Everything goes to hell after ppoe install... plz help me
    By Jackson5 in forum General Support
    Replies: 6
    Last Post: 05-30-2003, 05:02 AM

Posting Permissions

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


DELL PowerEdge R730XD 24x 2.5

DELL PowerEdge R730XD 24x 2.5" Server Dual 750W Dual Heatsink - BareBones TESTED

$269.99



Dell PowerEdge R620 Server 2x E5-2660 v1 2.2GHz 16 Cores 256GB RAM 2x 300GB HDD picture

Dell PowerEdge R620 Server 2x E5-2660 v1 2.2GHz 16 Cores 256GB RAM 2x 300GB HDD

$89.99



Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD picture

Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD

$389.99



Dell PowerEdge R720 Server - 2x8c CPU,256Gb RAM, 128Gb SSD/3x900Gb SAS, Proxmox picture

Dell PowerEdge R720 Server - 2x8c CPU,256Gb RAM, 128Gb SSD/3x900Gb SAS, Proxmox

$340.00



DELL PowerEdge R730 Server 2x E5-2680v4 2.4GHz =28 Cores 32GB H730 4xRJ45 picture

DELL PowerEdge R730 Server 2x E5-2680v4 2.4GHz =28 Cores 32GB H730 4xRJ45

$284.00



DELL POWEREDGE T430 SERVER W/ DUAL XEON E5-2609 CPU & 16GB MEMORY picture

DELL POWEREDGE T430 SERVER W/ DUAL XEON E5-2609 CPU & 16GB MEMORY

$329.00



CTO Dell PowerEdge R630 Server, 2x Xeon E5-2620V4, 64GB- 512GB RAM, 480GB SSDs picture

CTO Dell PowerEdge R630 Server, 2x Xeon E5-2620V4, 64GB- 512GB RAM, 480GB SSDs

$246.67



Dell PowerEdge R620 Server 2x E5-2650 V2 = 16 Cores H710P 128GB RAM 2x 600GB SAS picture

Dell PowerEdge R620 Server 2x E5-2650 V2 = 16 Cores H710P 128GB RAM 2x 600GB SAS

$274.99



DELL PowerEdge R630 8SFF Server 2x E5-2690v4 2.6GHz =28 Cores 256GB H730 4xRJ45 picture

DELL PowerEdge R630 8SFF Server 2x E5-2690v4 2.6GHz =28 Cores 256GB H730 4xRJ45

$600.00



Dell R730 8B LFF 2x 2.40GHz 14C Intel Xeon E5-2680 v4 32GB RAM 2x 3TB HDD HBA330 picture

Dell R730 8B LFF 2x 2.40GHz 14C Intel Xeon E5-2680 v4 32GB RAM 2x 3TB HDD HBA330

$299.99