1

I wanted to have a feel of ubuntu so I installed Ubuntu 14.04 LTS on windows 7 using a USB stick to boot. But I made a horrifying mistake of not installing ubuntu on a separate partiton. This resulted in removing my windows 7 completely from my laptop along with the previous partitions. Now all I have are two linux filesystem partions : one swap and one for every thing else.

I have my factory default image of windows 7 burnt to a DVD. When I try to restore this image using the factory reset DVD of windows 7 I get an error saying that :

"The program cannot restore the system partition because its structure is incorrect. You may have to recreate the partition to continue."

Please help me restore my windows 7 back and reinstall Ubuntu alongside windows.

Regards Robin

robby29
  • 11
  • 1
  • 3

1 Answers1

1

You can create a Windows-compatible partition using the GParted application that is included in the Ubuntu live USB. Use GParted to format the entire drive to NTFS with the boot flag set to bootable. Then you can reinstall Windows 7 from the factory default image of Windows 7 that you have burnt to a DVD. For more information see: How to remove Ubuntu and put Windows back on?.

It is always a good idea to install Windows before you install Ubuntu. When you install Ubuntu and get to the Installation type screen in the Ubuntu installer, choose the option that says: Install Ubuntu alongside Windows 7. This option will install Ubuntu alongside Windows 7 in a dual boot layout so that when you start the computer you can select to boot to either Ubuntu 14.04 or Windows 7 from the GRUB boot menu.

enter image description here

karel
  • 114,770
  • Is there any way that I can get the data which was on my hard disk prior to Ubuntu installation? I have lost too much data due to formatting of my hard disk. :( – robby29 Jun 22 '14 at 09:38
  • Yes, there certainly is a way to recover your lost data that was on the Windows partitions by using the Ubuntu live USB that you already have. If you have a small amount of space for persistent file storage on the Ubuntu live USB you can install testdisk on the USB and recover the data following these instructions: How do I recover my accidentally lost Windows partitions after installing Ubuntu?. Make sure that you tell testdisk to also recover all your files' names. – karel Jun 22 '14 at 09:51
  • Also very important. Recover all your data first before you write anything else to that drive!!! Recovering data that has been overwritten is much more difficult than recovering data from a partition that has been quick reformatted but not otherwise overwritten. – karel Jun 22 '14 at 09:52
  • please can you guide me through the steps of using gparted apllication. – robby29 Jun 22 '14 at 09:56
  • I like this tutorial: GParted partitioning software - Full tutorial. Although it's too long, all the other tutorials I found are missing some information, so that tutorial is good to have bookmarked as a reference in case you have any specific questions about how to use GParted. Tip: Always check 3 times before you apply any changes to make sure that you have selected the right drive/partition. – karel Jun 22 '14 at 10:10
  • Thanks for the help Karel but unfortunately I am unable to recover data from my lost partitions. – robby29 Jun 29 '14 at 07:31
  • I used testdisk, however it only showed the windows recovery partition which was earlier D: drive.I could see all the data in that partition. But when I now go for deeper search it showed a partition named windows7_os which I believe is my original C: drive. When I tried to list the files in that, it said cannot read files. I would like to mention that I did not let deeper search to complete as it was taking too long. Should I let deeper search run completely or my partition is non recoverable now? – robby29 Jun 29 '14 at 07:39
  • Just to give you a little background , originally I had only two partitions C: and D:. Now there are 3 partitions in ubuntu and all are primary partitions. – robby29 Jun 29 '14 at 07:42
  • I also tried using photorec and it did recover some files. But I believe it recovered files mostly which were windows library and header files with extension .txt and some .jpg files but very few because I had a lot of image files. I noticed that photorec went in some endless loop in pass1 wherein it was scanning the same 5 to 7 sectors over and over again. Is it because those sectors are damaged or corrupted or should I wait for longer time. I waited for half and hour and still it was scanning the same sectors without recovering any file. Please help me, I really need to recover some files. – robby29 Jun 29 '14 at 07:48
  • Testdisk does not recover filenames by default possibly to save time. There are open source programs such as scalpel that are even more thorough about recovering data than testdisk and they are very slow indeed. As a general principal, it is possible to recover under very bad conditions limited only by the amount of time (or maybe money) you are willing to invest in it. In my experience testdisk will recover ALL the files rather quickly if all you did wrong was accidentally reformatted a partition, assuming that you didn't write anything else to that partition after you reformatted at it. – karel Jun 29 '14 at 08:15
  • So what do you suggest me to do now. Should I go for other tools? I do not understand why photorec got stuck on a few sectors. Can that be solved, so that I can use only photorec to recover files. Thing is I only need to recover some .jpeg, .docx and .pdf files. – robby29 Jun 30 '14 at 09:30
  • The reason why people on Ask Ubuntu often mention testdisk first is that testdisk is the fastest file recovery application and it is also the easiest to use. Scalpel is more powerful, but it is also very difficult to use, similar to a forensics tool. Since you want to recover .jpeg, .docx and .pdf files you could try using terstdisk without the recover filenames option (to save time). I've also done it that way before, and it's not so bad with images and documents. When you open the document you can probably remember what the document's name would have been from reading the first page. – karel Jun 30 '14 at 09:40