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

Thread: Deleted grub in Windows - what can I do?

  1. #1
    Join Date
    Dec 2010
    Beans
    66
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Deleted grub in Windows - what can I do?

    In short, I've been running Xunbuntu 11.04 alongside Windows 7 in a hard drive partition. Today I accidentally deleted the hard drive partition that contained grub (I think) that allowed me to choose my operating system whenever I booted up. My question is, is there a way to recover the data?

    Here's the long version:

    Up until this morning, I had been happily running Xubuntu via a hard drive partition alongside Windows 7. I use lots of software that only runs on windows (a problem I'm working on), so ran Xubuntu on a 10GB partition, and left the rest to windows. I wanted to expand Xubuntu's 10GB to 30GB, so I had defragged the windows partition to prepare.

    Now, I originally created and named the partition I installed Ubuntu on 'LINUX', but after Xubuntu was installed, I saw that LINUX was reduced to 32MB and the rest of the 10GBs I had allotted was called 'free space' or something similarly anonymous. When using Ubuntu, LINUX was listed as another mounted filesystem.

    It seemed separate from my Ubuntu installation, since it was mounted after all, so when I went into windows to expand the partition that contained Ubuntu, I deleted the LINUX partition just to clean things up. A more cautious part of me instantly said, "Waaait..." so I rebooted, and saw 'grub_rescue>'.

    I'd like to think I didn't erase all the data in the 10GB partition, since I only told windows to delete the 32MB partition. Is there a way to set up grub again and perhaps get everything back to normal?

  2. #2
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Deleted grub in Windows - what can I do?

    Three ways I have found:

    1. Install grub again: http://ubuntuforums.org/showthread.php?t=224351
    2. Use your windows recovery partition, boot to a command-line and run :
    Code:
    fixmbr
    Then you can boot to windows and clean up linux partitions.

    3. Reinstall xubuntu.

  3. #3
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Deleted grub in Windows - what can I do?

    Windows does not properly see the Linux partitions. The Windows partitioner is really only useful for shrinking the Windows partion. Everything else use gparted or other partitioning tools from Linux.

    You could use testdisk to see what it says.

    enable the "universe" repository to download testdisk
    System>Administration>Software Sources>Ubuntu Software.
    Maverick the software sources is System, Administration, Update Manager, settings button on lower left.
    https://help.ubuntu.com/community/DataRecovery
    http://www.cgsecurity.org/wiki/TestDisk
    repairs including testdisk info & links
    http://members.iinet.net.au/~herman546/p21.html
    https://help.ubuntu.com/community/Da...st%20Partition

    Instructions
    http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step
    http://www.cgsecurity.org/wiki/Menu_Analyse
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #4
    Join Date
    Aug 2009
    Location
    United States
    Beans
    4,460
    Distro
    Ubuntu Development Release

    Re: Deleted grub in Windows - what can I do?

    Put you live cd in (install Cd and use Try Ubuntu) when boots open a terminal and:
    Code:
    sudo fdisk -l
    Lower case L
    Code:
    sudo parted -l
    Lower case L
    Copy and paste them here. I was just going to check and see if there was still a linux partition and if so how big?
    Remember hence where you come and pass it down.
    Ubuntu Forums member #899097 and Ubuntu Member:
    http://www.ubuntupocketguide.com/index_main.html
    Main Page -

  5. #5
    Join Date
    Dec 2010
    Beans
    66
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: Deleted grub in Windows - what can I do?

    So I'm using the same computer, but I'm running it off of a puppy Linux live usb. I've only been using Linux for about a year, so I'd really appreciate it if someone told me what all this means.

    Code:
    sh-4.1# fdisk -l
    
    Disk /dev/sda: 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/sda1               1          18      144553+  de  Dell Utility
    /dev/sda2   *          19       13319   106833920    7  HPFS/NTFS
    /dev/sda3           13323       14594    10207233    5  Extended
    /dev/sda5           14534       14594      482304   82  Linux swap / Solaris
    
    Disk /dev/sdb: 1002 MB, 1002438656 bytes
    31 heads, 62 sectors/track, 1018 cylinders
    Units = cylinders of 1922 * 512 = 984064 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1        1018      978267    c  W95 FAT32 (LBA)
    
    Disk /dev/sdc: 8004 MB, 8004304896 bytes
    35 heads, 21 sectors/track, 21269 cylinders
    Units = cylinders of 735 * 512 = 376320 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1       21270     7816688    b  W95 FAT32
    Code:
    sh-4.1# parted -l
    
    Model: ATA SAMSUNG HM121HI (scsi)
    Disk /dev/sda: 120GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start   End    Size    Type      File system     Flags
     1      32.3kB  148MB  148MB   primary   fat16           diag
     2      149MB   110GB  109GB   primary   ntfs            boot
     3      110GB   120GB  10.5GB  extended
     5      120GB   120GB  494MB   logical   linux-swap(v1)
    
    
    Model: USB Flash Disk (scsi)
    Disk /dev/sdb: 1002MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start   End     Size    Type     File system  Flags
     1      31.7kB  1002MB  1002MB  primary  fat32        boot, lba
    
    
    Model: SanDisk Cruzer (scsi)
    Disk /dev/sdc: 8004MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start   End     Size    Type     File system  Flags
     1      16.4kB  8004MB  8004MB  primary  fat32

  6. #6
    Join Date
    Aug 2009
    Location
    United States
    Beans
    4,460
    Distro
    Ubuntu Development Release

    Re: Deleted grub in Windows - what can I do?

    It means you have
    sda1 a dell utility partition 148 meg
    sda2 your windows install of 109 gig (windows is NTFS format) (linux is now ext4 format, in which you have none left in your partition table)
    sda3 an extended partition of 10.5 gig (extended a house for logical partitions where your linux survived)
    sda5 a 500 meg logical partition where your swap is.

    Seems as though there is 10 gig left in your extended partition being unused. (I imagine where your linux was before deleting it)

    So you have to make extended partition larger to house a bigger logical partition for Linux.
    Delete swap can make a larger one than 500 meg. (they say twice the size of installed Ram) according to how much ram installed do not need to get crazy 2 gig plenty.

    oldfred gave you some links to data recovery!!

    Or you can just download a version of Ubuntu you want and reinstall. Here is the link with "How to do it" and download. Do what you are comfortable with of course.
    Read up on partitioning for a bit. 3 types Primary, extended,logical and only allowed 4 primarys and extended counts as 1 but you can have all the logical's you want
    with linux residing in the logicals starting at sda5 and up. So the size of the extended is the key. Read a bit, pretty self explanitory.
    Download Ubuntu | Ubuntu
    HowToPartition - Community Ubuntu Documentation
    Last edited by garvinrick4; October 1st, 2011 at 12:21 AM.
    Remember hence where you come and pass it down.
    Ubuntu Forums member #899097 and Ubuntu Member:
    http://www.ubuntupocketguide.com/index_main.html
    Main Page -

  7. #7
    Join Date
    Aug 2009
    Location
    United States
    Beans
    4,460
    Distro
    Ubuntu Development Release

    Re: Deleted grub in Windows - what can I do?

    If you want to get Windows booting: Only a couple of easy commands with your windows disk.
    Grub/XP/Vista Bootloader - Ubuntu Forums

    I am going to log off and go to dinner oldfred has been around (well he is oldfred that says it) a nice guy and
    he will have this thread subscribed so will answer and help if need anymore) There are actually just
    a lot of good users willing and able to help in these Forums.
    Last edited by garvinrick4; October 1st, 2011 at 12:24 AM.
    Remember hence where you come and pass it down.
    Ubuntu Forums member #899097 and Ubuntu Member:
    http://www.ubuntupocketguide.com/index_main.html
    Main Page -

  8. #8
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Deleted grub in Windows - what can I do?

    If the 10GB is unallocated in the extended partition, I would think testdisk might recover it completely.

    I do not know if you can run testdisk from Puppy or not. The newer Puppy has access to the Ubuntu repository. Some rescue LInux liveCDs include testdisk as standard.

    gparted also has a recover partition capability. Not seen it used. One user used parted to recover a partition but he had a good idea of start & end sectors as it requires that to work.

    Can you download from another PC other liveCDs? I always recommend that you have a liveCD or repair CD for every system installed. And being a belt & suspenders type, I usually have several additional bootable ISO on my flash drive. I used to burn a bunch of CDs but I used to use so many I switched to flash drives.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  9. #9
    Join Date
    Dec 2010
    Beans
    66
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Exclamation Re: Deleted grub in Windows - what can I do?

    Ok, sorry for the delayed response.

    So I'd really like to use my Windows 7 disk to simply fix that bootloader, but my problem is that my windows 7 disk is 600 miles away at home (I'm a university student) and none of my friends seem to have theirs.

    I tried to restore the partition using testdisk, but I fear I may have made things worse. I used testdisk to write the 32MB partition as primary bootable, which may not have been as correct as it sounded.

    I can't exactly copy/paste the results, since I'm using a computer in the library (and my puppy usb can't seem to connect to the wireless), but fdisk and parted only seem to find one partition. I'll type things out as best I can:

    Code:
    #fdisk- l 
    
    Device                 Boot        Start             End                        Blocks        Id     System
    /dev/sda1            *             13319         13323                 32928+     e        W95 FAT16 (LBA)
    
    #parted -l
    number   Start              End                       Size                     Type                  File system      Flags
    1                     110GB          110GB              33.7MB             primary           fat16                     boot, lba
    I tried to follow the instructions here: http://ubuntuforums.org/showthread.php?t=224351
    but after I typed:

    find /boot/grub/stage1
    I get: Error 15: File not found

    The grub version in 0.97 as well, and a lot those steps appear to be for grub 2.

    Would it help if I reinstalled ubuntu in its old 10GB partition?

    When I install it, at some point I should have to specify where its going. I'd install it over my old Ubuntu installation, and my windows partition should still be there. After I've installed ubuntu again, there will be a new grub that recognizes my windows loader, as well as the new Linux partition I created when I reinstalled Ubuntu. Would this work?

    I'm sure there's a much better way, but at this point I'm starting to get scared of losing everything I have in Windows. I'm willing to sacrifice all that I had in Linux (most of its backed up anyway). I'd feel much more comfortable doing it like that...if it would work!

  10. #10
    Join Date
    Aug 2009
    Location
    United States
    Beans
    4,460
    Distro
    Ubuntu Development Release

    Re: Deleted grub in Windows - what can I do?

    You will have to have a linux live cd (install cd using Try) and run
    a boot script that would tell all things about your system and its booting setup.
    Is below. All other replys would now be a pure guess at best.
    Boot Info Script | Download Boot Info Script software for free at SourceForge.net
    Download to lets say Desktop and extract using archive manager and then run
    this line of code below will put a RESULTS file on desktop copy and paste to this thread.
    Code:
    sudo bash ~/Desktop/boot_info_script.sh
    Remember hence where you come and pass it down.
    Ubuntu Forums member #899097 and Ubuntu Member:
    http://www.ubuntupocketguide.com/index_main.html
    Main Page -

Page 1 of 2 12 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
  •