If you accidentally delete a Linux partition on your hard drive, it is possible that you will also end up with a grub misconfiguration. If you have a Windows Recovery CD, that is no problem. Because you can simply use that CD to recover your boot sector.
If you don't, then this guide may help you to rescue your boot record (MBR) using Linux USB drive. Of course, this recovery option requires that you have a bootable Linux USB already.
Recovering MBR (master boot record) using Linux LiveCD or LiveUSB
To recover MBR of your computer we are going to use TestDisk utility which comes included in most of the LiveCD or LiveUSB installations. If you don't have test disk utility, you can get it from their download page.
Here are the steps for recovering MBR using TestDisk:
- Open up a terminal window and type
- On the following screen select your primary drive and select
[Proceed]. If you have multiple drives, you can identify your primary drive by it's size. In most cases it should be
- Next screen will display partition types. If it is a Windows drive it's partition is
- On the next screen, you will see partition rescue options. Since we want to rescue master boot record, you should select
[MBR Code]on this screen.
- After you confirm the action, testdisk will write MBR to the selected drive.
- After the action is completed, restart your PC, and your computer should boot normally.
If you like this guide, please spread the word! Leave a comment if you have any other tips ;)