Find the answer to your Linux question:
Results 1 to 8 of 8
The question How do I get my computer back the way it was before? - Fedora Core 6 bootloader - dualboot windows XP The story Windows XP, Fedora Core 6, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Posts
    4

    Help! MBR and GRUB erased!


    The question

    How do I get my computer back the way it was before?
    - Fedora Core 6 bootloader - dualboot windows XP


    The story

    Windows XP, Fedora Core 6, ntfs-3g
    Copied 5000 files from "Documents and Settings" to "Documents and Settings Backup" both in ntfs.
    Shutdown -> umount: Persmission denied etc.

    Boot windows XP CD (before SP1 or SP2). Exit because it only detected 131GB of free space.

    Boot: hard drive detected with LRG instead of LBA (always does this for new unformatted SATA for some reason). BIOS only has options Auto or Large.

    Put it in the other computer

    Windows detects the drive as all free space (unformatted).

    MBR partition table destroyed
    partition 1:
    Starting head 0, ending head 0
    Starting sector 1, ending sector 1
    Starting cylinder 0, ending cylinder 1023
    Relative sector 0
    Total sectors 268435455

    partitions 2, 3, 4: empty


    Information

    Hard Drive
    Model: WDC WD2500KS-00MJB0

    Size: 250056737280 bytes
    Sector size: 512 bytes
    Total sectors: 488392065
    Cylinders: 30401
    Heads (tracks/cylinder): 255
    Sectors/track: 63


    Partition table doctor detected:
    C H S Size (MB)
    NTFS 0 1 1 217469
    /boot ext3 27851 0 1 101
    27864 0 1 19900

    Sector 0: MBR
    Sectors 1-62 are all zero.
    NTFS boot sector: 63
    Number of sectors: 447426240
    NTFS end = 44726303
    NTFS backup boot sector = 447426314
    447426315 - all zeroes
    447426317 - some data with a string "/boot" (what is the format of ext3?)


    The backup NTFS boot sector should be at the end (44726303)?
    Should i change it or is it right being at 447426314?

    Fedora Core 6 uses GRUB?
    How do i restore my partitions?
    How do i restore GRUB?
    Where is GRUB boot data? Has it all been erased?

    I have dskprobe.exe so i can write raw data into the hard drive.
    Which programs will solve my problem (free programs)?
    Which forums are best to find help?

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    first of all fix Master Boot Record for normal windows bootup.
    boot up from Windows installation CD, select 'Repair(R). this will drop you at prompt. type "FIXMBR".
    reboot..... windows should boot up normally now. install GRUB again.
    boot up from FC6 CD/DVD and execute this code.

    Code:
    linux rescue
    chroot /mnt/sysimage
    grub-install /dev/hda



    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Nov 2006
    Posts
    4
    thanks for the quick reply.

    ok i wrote the ntfs partition manually in to the MBR, otherwise the windows boot CD doesn't even give you the option to repair it.

    i did fixmbr

    After booting from the fedora core dvd and doing a rescue, it says:
    "could not find any linux installations"

    This is probably because of the same reason windows thought the drive was totally unformatted: it doesn't know about any partitions.

    I wrote the /boot partition into the MBR, but linux rescue still can't find a linux installation.

    Now all i have to know is how to get GRUB to find the Fedora LVM installation so that GRUB can boot into it.

  4. $spacer_open
    $spacer_close
  5. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    I wrote the /boot partition into the MBR, but linux rescue still can't find a linux installation.
    how did you do that? by default, Linux create separate /boot partition and write first stage of GRUB in MBR.




    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #5
    Just Joined!
    Join Date
    Nov 2006
    Posts
    4
    i used partition table doctor to find /boot

    if the MBR is gone, then GRUB can't find the first stage, so it can't find the second stage where all the partition information is kept.

    So i should make the MBR partition point to GRUB first stage. Then i should make a new first stage that points to the old second stage.

    Where is the GRUB second stage? Is it all within /boot?
    How do i make GRUB know about the lost partition?

  7. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    first of all, Linux installation CD/DVD should work. you can install GRUB through installation CD/DVD only.
    as you know, Linux uses first 512 bytes ( 0x00 - 0x1BD ) of first(0) sector for GRUB stage 1 and next 32 KiB ( 0x1BE - 0x1FD ) for stage 1.5
    on boot up, stage 1 lookup stage 1.5 and then grub.conf, device.map files.
    in case you have a copy of stage 1, save it in 512 bytes.




    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #7
    Just Joined!
    Join Date
    Nov 2006
    Posts
    4
    hi,

    it's all working now
    thanks for your help. It's made my life a whole lot easier

    I did a search and found a program that detects lost partitions.
    TestDisk: http://www.cgsecurity.org/wiki/TestDisk



    It worked perfectly, just like how i would want it to work. I expect things to not work straight away from experience. Partition table doctor searched the whole hard disk, and can't find LVMs. TestDisk found all partitions instantly.

    fdisk -l

    Before TestDisk:
    /dev/sda1: ntfs
    /dev/sda2: /boot

    After TestDisk:
    /dev/sda1: ntfs
    /dev/sda2: /boot ext3
    /dev/sda3: linux LVM

    Then i just did the chroot and grub-install in your post above

  9. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Well Done !! i am glad it worked out.......




    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

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