Accidently deleted your partition table? /--evilbitz
In this post you can get some hints on what to do in case you accidently ruined your partition table, for example, you deleted one of your volumes (drive letters) and you cannot see it.
First of all, I want to start with a warning… doing this stuff to your hard disk may gets you to a point of frustration, losing all your data and getting the middle finger from the kind and beloved mr. samsung/WD/whatever/(made in China). I’m not gonna describe how to backup your hard drive, I assume you know that
The number one rule is to never try to edit or change anything from the Windows Disk Management tool, it’s crap. Most chances it is the reason for you ending up on this page
Here are some information about the data structures that are used to manage your boot partitions, I’m not going in-depth here but rather just describing some basic things that are good to know. If you want, you can skip this section. Lets start with the MBR (Master Boot Record). The MBR contains a small piece of code at its begining, your BIOS loads it into memory and then exeute it in real mode. Anyways, the MBR basically just manages the entries in the partition table. Part of the MBR (at offset 0×1BE) is the partition table itself, there you have 4 entries to 4 Primary partitions on your disk, where each one can be defined at Extended and point to a number of Logical partitions (which used to be non-bootable, but today boot loaders handles them fine).
- Primary – bootable partition
- Extended – Pointer to a number of logical partitions
- Logical – data partitions, intended to be non bootable
I would recommend reading more about this right here.
Here are some tools that you want to know:
- TestDisk – this is a really good tool that can analyze every sector of your hard drive and find lost volumes, then it lets you edit the partition table and write it to disk.
- Acronis Disk Director – good partition manager with disk editing capabilities, this is good if you want to investigate your sectors closely and see the data structures.
There are tons of other tools, I’m using these ones and they are great! I wouldn’t recommend hiren boot cd which has all these tools and more preinstalled and configured.
Ok, so here is the flow for reconstructing the partition table with TestDisk, and maybe add fixups using Windows bootrec.exe if you are running Vista.
- Execute TestDisk and let it analyze your disk, if it didn’t found exactly the partitions you are looking for, perform a deeper search. When you get the results all of the partitions are marked DELETED, you should turn the wanted partitions to Primary and Logical, the partition you used to boot into should be set to Primary Bootable.
- When you are ready, the partition table appears in a neat green color, telling you everything is ok. Write the partition table to disk.
- Try to boot the hard drive, if it fails, you may want to look at Super Grub and maybe later on, install to disk. Super Grub is a really handy boot loader that you can execute without installing to disk. It lets you boot from any partition. I’m not going to cover how to use Grub, try looking for info if you need this.
- If you are a windows user, insert the installation disk of windows vista, or download the neosmart recovery custom Vista disc, when the disc loads go to ‘Recovery’, and open a command prompt. Execute these commands:bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcdSee the output and confirm
- Load your operating system.
In case you want to hide some partitions, like the recovery partition of your laptop, you can user Acronis boot director.
Well that’s about it… even if this post doesn’t speak to you, just remember, never use the Windows Disk Management console
Thanks,
Guy.
Posted in random | Be The First To Comment!
