Installing Ubuntu Wiped out Windows, Need help recovering files

Asked by Jillian on 2009-04-04

I installed Ubuntu last night and it seems to have wiped my Windows partition. I don't understand how this could have happened as it was not made clear to me in the install that my Windows would be wiped.

I've been searching for a solution and have read about success stories with testdisk and photorec, but I am completely new to Ubuntu and can't make any of their methods work.

I need step by step, idiot proof help!

When I do sudo fdisk -lu I get this:

   Device Boot Start End Blocks Id System
/dev/sda1 * 63 75168134 37584036 83 Linux
/dev/sda2 75168135 78140159 1486012+ f W95 Ext'd (LBA)
/dev/sda5 75168198 78140159 1485981 82 Linux swap / Solaris

I don't know if this means it's gone forever.

When I open testdisk and go through Intel, and then Analyse I get this:

 Partition Start End Size in sectors

 1 * Linux 0 1 1 4678 254 63 75168072
 2 E extended LBA 4679 0 1 4863 254 63 2972025
 5 L Linux Swap 4679 1 1 4863 254 63 2971962

I don't know what to do from here! Please help me recover some of my files!!!!

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Last query:
Last reply:

Boot from the live CD go to

System-->Administration-->Partition Editor

If the windows disk is actually still there it should be easy to find out. If one of the sections of the drive is NTFS or FAT32, you might not have lost anything.

Post what you find out, because I don't make it online often and other people might be able to help faster than me.

peter b (b1pete) said : #2

bad news Jillian, I'm sorry that it happened. win partition is gone and I'll tell how it 'disappeared'

- at install time in the HD partitioner phase it is my strong belief that somehow Manual partition option was not used but the other one namely Use the entire disk; that is reflected in the fdisk -l output above. again I'm v sorry to see that.

recovering some files - only if you have some backups available otherwise the v first partition were win used to live was totally overwriten from sector 63 onwards. if you have some backups then probably the best thing in your case is to reinstall win and restore the files backed up then reinstall ubuntu using Manual option this time.

do not despair, worse things happen in this world all the time. believe me, it was v hard to write these lines but I firmly believe that giving the user the straight news is better than going in circles and pretending that everything is fine knowing inside that it is not (is that called hiding the truth? misleading?).

best regards,
peter b

I don't mean to be rude and imply that another person is misleading like some people who write responses, but even after your drive has been written over there are ways to recover much of the info. Usually it involves taking out your hard disk and using and external enclosure and software. If that task is to far beyond what you know, unfortunately you would pay a pretty penny to have some one else do the job. On the same note if you have already reinstalled windows like peter said, it will make restoring any of those files about twice as unlikely. The reason I wrote the response earlier is, because I have seen people just mess up their boot record doing dual boot installs. But Peter if you read this, how about you stop pretending every body else is an idiot and that you are a "God" of computers (I hope that wasn't misleading enough).

Jillian (jillian-rains) said : #4

So I booted from the live CD and there was not partition with NTFS or FAT32 :(.

Using photorec I've "recovered" a bunch of files but they're mostly random cookies from browsing the internet. When I try to open the documents, sometimes it says "can't read file" and sometimes it works. I've retrieved around 50 photos and found about 20 workable documents a long with a bunch of music files.

Does anyone know how to make photorec more specific so I can just get my documents? And if the Ubuntu Office can't open them, does that mean they're corrupted? Should I put both the readable and non-readable documents together to burn to a disc/USB?

Jillian (jillian-rains) said : #5

Also all the recovered files have a "lock" symbol above them, and it won't let me move them to another folder. Anyone know how to rid of that?

Tom (tom6) said : #6

Avoid writing to the drive and use

You should be able to get rid of the lock symbol by right-clicking (i do a bunch of files all at the same time) choose "Properties" from the bottom and click on the "Permissions" tab. Hopefully this should allow you to change all the permissions. It's possible that you might need to be in as Root but it should be possible as normal user. Please let us know.

Thanks and regards from

PS Good luck with this

peter b (b1pete) said : #7


probably DCrashA can help you more/better in carrying out successfully the task of recovering the files under these conditions. for sure he is more than eager to prove to the world that he is not an '........'; these are his words ....'But Peter if you read this, how about you stop pretending every body else is an idiot and that you are a "God" of computers '.....

the straight speaking 'God' that I was called will be more than happy to see the task you're facing is completed to your satisfaction under his precious guidance and equally precious indication of ....'unfortunately you would pay a pretty penny to have some one else do the job'....

best of luck in your endeavors Jillian.

peter b

Jillian (jillian-rains) said : #8

On the documents permissions page it says that I can't make any changes because I'm not the user.

Tom (tom6) said : #9

There is a way around that but it means going in as Root or SuperUser (same thing). After you've completed the task please close both windows/consoles that see you as Root to prevent further potential problems. I will try to explain all that at the end. Anyway, please go up to the top taskbar and click on

Applications - Accessories - Terminal

and into the terminal/command window/console type


it should ask for your SuperUser password but if you're running from the LiveCd i'm not sure whether it will or not, it wont display stars as you type the password - this is to prevent someone else finding out how long your password is. If there's a problem with this we'll deal with that later in this thread. If you are using Ubuntu rather than Kubuntu then type


and your file-browser should pop up. Navigate to the files and change their read/write permissions, make sure you also change the permissions for all users so that everyone can read/write the files.

Once you've done that please close the file-browser (nautilus) console and the terminal console too. As promised earlier here's a link about root and user security issues.
One of the reasons Windows has so much trouble with viruses and security generally is that even in normal everyday use many tasks give a user Root privileges without them even knowing about it. In Windows security is bolted-on-top of a system almost as a whimsical after-thought but Linux was based on Unix which ran (and still does) almost all of the huge server-networks, so security is built in at all levels which leaves us free to do day-to-day tasks much more safely.

I hope this helps
Good luck and regards from
Tom :)

Can you help with this problem?

Provide an answer of your own, or ask Jillian for more information if necessary.

To post a message you must log in.