Ubuntu install deleted all my partitions - any way to restore them?
GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Ubuntu install deleted all my partitions - any way to restore them?
So I decided to try and install Ubuntu over my Fedora install to see what it was like. I had 2 Windows partitions (15GB just for Windows and 140GB or so for files). The rest was reserved for linux. Now during the Ubuntu install it came up to the partitioning part. Unlike most other linux distros I've tried, Ubuntu didn't offer the option to delete only linux partitions. It did offer an automatic setup and claimed that it wouldn't make any changes until after I reviewed everything. Not knowing how to setup partitions properly for linux, I figured I'd see how it would setup everything and then I could base my manual settings off that. In the end, it didn't ask me to confirm before it over wrote my Windows partitions with linux ones.
Now I've tried to reload the Windows boot loader with the SuSE CDs I had but it couldn't find any Windows partitions to install it on. From there I tried the Windows recovery console and the fixboot command. This seemed to create a new FAT partition with just C:. But no success with it loading Windows. The computer just stops at a GRUB boot loader command prompt. I also tried partition magic to see if it could undelete the partitions but since new partitions were created over them it can't. After I finish this post I have a Knoppix CD I'm going to try.
It looks like all my data from the NTFS partitions is still there - Ubuntu didn't format the partitions it created. It's just a matter of recreating the partition table. Any suggestions?
But if you could paste your partition table info here, it would be of help to diagnose the situation. Unfortunately it might be very difficult to restore all the previous settings.
You might need a professional hard disk data recovery tool to take all the back up and then proceed to install from scratch.
Last edited by vharishankar; 11-26-2005 at 10:37 AM.
I bought a program named partition table doctor and that was able to go recover the 140GB partition information. I'm in Knoppix now transferring information over to another computer and immediately to an external HDD. After that's done I'll go back to the original (screwed up) partition table data and see if I can get the 15GB Windows partition restored for the last of the data.
Now Knoppix is giving a bit of a problem. It wouldn't give me write access to the external HDD, which is why I'm going over samba to the other machine and then to the drive. Any way to fix this? It'd make transferring much faster.
"Now Knoppix is giving a bit of a problem. It wouldn't give me write access to the external HDD, which is why I'm going over samba to the other machine and then to the drive. Any way to fix this? It'd make transferring much faster."
Knoppix always mounts all disk partitions as read only. You have to umount the partitions and mount them again as read/write. For this reason I use something other than Knoppix for a rescue CD.
As long as you bailed out of the install when you noticed the error -=- you may just be lucky. It sounds like that was the case.
When the table was overwritten, well, without a copy, it starts to get very tricky but you do mention your having some success with the recovery program your using, so that sounds ok.
If you can remember the general size/layout of your partitions though, then you could also do an ordered seach, from a LiveCD.
Partitions will tend to be ailgned on a 63 sector boundary, due to the way the system insists on using the imaginary geometry system in its layout, regardless whether or not LBA addressing is being used.
You could do a search that involves 63 sector jumps (63 sectors per head), around the location(s) you suspect a partition may be, using the "dd" program ...
That will start at the start of your drive, jumping a number of 512byte blocks and copying the next one to that file. Viewable with a hexeditor.
From there you will be looking for the intell/dos styled boot-sector magic writen to the last two bytes. 0x55aa
If you find the right sector it should also have stuff that shows it to be a windows boot-sector. A very long and drawn out method, but hopefully the program your using will do all that anyway. And it wont be neccessary. Be carefull if your going to do anything with dd, it can and will wipe your drive if used accidently. Just recently i managed to zero out my mbr, along with a boot partition (grin), managed to kill it just be fore it found my root partition :roll: Luckily i had backups, almost that is.
But, in the future --- doing ...
]# dd if=/dev/zero of=/dev/fd0 bs=1024 count=1440
]# dd if=/dev/hda of=/dev/fd0 bs=512 count=1
Will give you a copy of your boot-strap and master table.
]# cfdisk -Ps /dev/hda
Will give you a dump of the starting sector for head 0, for all your partitions, including the logicals.
Handy if you want to make floppy copies of your logical boot-sectors for any reason.
Lost or deleted partition can be saved using Partition Table Doctor Recovery tool.
It can easily restore lost partition, as it did for me before.
Really great tool, with awesome restore algorithms. Give it a try. Recommended!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.