Original post : Fix the MBR - Guide for Windows 10, 11, XP, Vista, 7, 8.
dd if=/dev/sda of=/path-to-save/mbr-backup bs=512 count=1
/path-to-save/mbr-backup
mbr-backup
Important: Restoring your Master boot record with the wrong partition table will make your data unreadable and will make it very hard to recover your data later.
dd if=/path-to-get/mbr-backup of=/dev/sda bs=512 count=1
/path-to-get/mbr-backup
C:\
fixmbr
If you don't have the Windows XP installation CD to run Recovery Console, go to Fix MBR with Easy Recovery Essentials.
1
exit
map
C: NTFS 1024MB \Device\Harddisk0\Partition1 E: \Device\CdRom0
Harddisk0
bootrec
If you don't have the Windows Vista installation CD/DVD to run Command Prompt, go to Fix MBR with Easy Recovery Essentials.
bootrec /FixMbr bootrec /FixBoot bootrec /RebuildBcd
bootrec.exe
bcdedit /export C:\bcdbackup c: cd boot attrib bcd -s -h -r ren c:\boot\bcd bcd.backup bootrec /rebuildbcd
If you don't have the Windows 7 installation CD/DVD to run Command Prompt, go to Fix MBR with Easy Recovery Essentials.
bootrec /rebuildbcd
bootrec /fixmbr
bootrec /fixboot
diskpart select disk 0 list volume
D:\
exit D: cd boot dir
bootsect /nt60 SYS /mbr
If you don't have the Windows 8/8.1 installation CD/DVD to run Command Prompt, go to Fix MBR with Easy Recovery Essentials.
bootrec /FixMbr bootrec /FixBoot bootrec /ScanOs bootrec /RebuildBcd
diskpart sel disk 0 list vol
sel vol 2
x:\
assign letter=x:
DiskPart successfully assigned the drive letter or mount point.
cd /d x:\EFI\Microsoft\Boot\
ren BCD BCD.backup
bcdboot c:\Windows /l en-us /s x: /f ALL
c:\
If you don't have the Windows 10 installation DVD to run Command Prompt, go to Fix MBR with Easy Recovery Essentials.