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

Thread: Windows deleted the Linux partition!

  1. #1
    Join Date
    Feb 2013
    Beans
    8

    Windows deleted the Linux partition!

    Hello everyone, I was trying to reinstall Windows 7 on a dual-boot PC, I am not sure which Ubuntu version was installed (no experience with Linux...). I deleted the Win partition in Setup and this action seemes to also have deleted the Linux one (it appears as 'free space'). I didn't proceed with the Windows install and left it as is. The pc will not boot and give the 'grub rescue' prompt. Is there a way to recover the Linux partition, since all important data is there? I don't want to recover Windows 7, just a safe way to reinstall it. Thanks for the support...
    Last edited by AmigaMind; February 16th, 2013 at 06:18 PM.

  2. #2
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,560
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Windows deleted the Linux partition!

    First, for future reference, you don't need to delete the windows partition especially if you want to use the same partition again for windows. Simply tell the installer to install there and to format it. That will make sure old system files are deleted.

    To try recover a deleted partition, try testdisk from live mode. If you are confused by the Deeper Search scan results, post a screenshot before you do anything. Testdisk is very powerfull and can recover partitions, but it can also mess things up even more.
    www.cgsecurity.org/wiki/TestDisk_Step_By_Step
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  3. #3
    Join Date
    Jan 2008
    Beans
    7,744

    Re: Windows deleted the Linux partition!

    I will assume you followed the official instructions for dual booting Ubuntu and Windows? Since the first step is "back up your data" you should be OK with simply reinstalling both OS's and then restoring your files from backup. Since you "have no experience with Linux" backups are super-extra-important---one typo on the command line is all it takes to lose everything sometimes.

    If you did not make backups then I agree with darkod's suggestion to use testdisk. If this is over your head then spend a few bucks (or whatever is your local currency) to take it to a pro data recovery specialist, if the non-backed-up files are of great value to you.

  4. #4
    Join Date
    Feb 2013
    Beans
    8

    Re: Windows deleted the Linux partition!

    No backups, sadly... Thank you both for the immediate replies. I will boot from an Ubuntu 12.10 live USB to see if I can get a testdisk screenshot. The official instructions link has interesting suggestions but I'm not trying anything yet, I'll post back asap.

  5. #5
    Join Date
    Feb 2013
    Beans
    8

    Re: Windows deleted the Linux partition!

    Had a hard time running it from Linux so I used Hiren's Boot Cd and a camera for the screenshot... The jpg is about 4MB so I hope it's ok I uploaded it here, along with a log. Testdisk seemed to report the partition fine, I'm not sure what the errors in the log are about.
    Last edited by AmigaMind; February 16th, 2013 at 07:54 PM.

  6. #6
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,560
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Windows deleted the Linux partition!

    Is that the Quick scan or the Deeper scan screen?

    It looks good, all partitions recognized, the start/end points and sizes look fine. I assume writing a partition table with these values should be fine.

    What problems did you have running it from live mode? The only issue might be the path where the program is. You need to be in the correct folder or use the correct path ot run it.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  7. #7
    Join Date
    Feb 2013
    Beans
    8

    Re: Windows deleted the Linux partition!

    Sorry, that's a Quick Scan. I've started the deep and will upload it when it's done. I extracted the "testdisk-6.14-WIP.linux26.tar" contents and tried to run 'testdisk.8' and testdisc_static' from the USB but got error messages and I gave up... couldn't find it inside Ubuntu - not experienced at all in Linux.
    How do I write partition tables? Using Testdisk? Thanks for helping out...

  8. #8
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,560
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Windows deleted the Linux partition!

    On second thought you might not even need the deep scan since the partitions seem recognizable with the quick scan too.

    Refer to the step by step of testdisk, but in general if the partition list shown on screen is correct, you will hit Enter to continue to the next step, where you will have option to write the table with 'w' if I remember it correctly. You then use 'q' few times to close testdisk and that should be it.

    Even with the partitions recovered you might need to reinstall grub2 to the MBR from live mode since it was probably blown away by windows when deleting the partition. But that is easy to do once you get there.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  9. #9
    Join Date
    Jan 2008
    Beans
    7,744

    Re: Windows deleted the Linux partition!

    ^ Good advice above. The only thing I'd add is, once you've restored the partitions, your immediate next step should be to boot from a Live CD and back up the data you have worked so hard to restore. Then you can proceed to restoring GRUB and setting up the dual boot following the official guide I linked to in post #3. Good luck!

  10. #10
    Join Date
    Feb 2013
    Beans
    8

    Re: Windows deleted the Linux partition!

    Thanks for your invaluable support. It won't boot yet but I got the partition back and currently backing up files. I'll try repairing grub2 using Ubuntu secured remix. Do you think I should install Windows first and then deal with grub2 or viceversa? I'm kind of scared the Windows setup will mess it up again when it'll create the deleted partition. Should I also worry about possibly different Linux versions on the pc and the Live CD?
    Last edited by AmigaMind; February 16th, 2013 at 09:31 PM.

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
  •