#title How To Repair The Bootsector Of A Partition ||<
><>|| Discussion of this wiki can be found [[ http://ubuntuforums.org/showthread.php?t=2030238 |here ]] = Introduction = If you have damaged the boot sector of one of your partitions (e.g. by installing GRUB in it by mistake), you may have troubles. For example, if it is a Windows partition, you will not be able to boot into Windows any more. Remark: if you have this problem, [[Boot-Repair]] should automatically warn and tell you the name (eg '''sda2''') of the broken partition. Here is how to repair it: = Via an Ubuntu disc = == Step 1 - Boot on a liveCD or liveUSB == Boot your computer on a Ubuntu live-CD or live-USB, then choose "Try Ubuntu". == Step 2 - Install TestDisk in the live-session == Once in the Ubuntu live session, install [[TestDisk]] this way: * Connect internet * Open the Software Center, in the top bar click Edit -> Software Sources -> enable the Universe repository * Open a terminal (Ctrl+Alt+T) and type : {{{ sudo apt-get update }}} {{{ sudo apt-get install -y testdisk && sudo testdisk }}} == Step 3 - Use TestDisk == * Via the arrows and the Enter key, go to the [No log] menu, * then select the disk where the broken partition is, * then select [Proceed], * then choose the type of partition (generally [Intel]), * then[Advanced], * then select the broken partition with [Boot], it will display something like : {{{ Boot sector Status: Bad Backup boot sector Status: OK Sectors are not identical. A valid NTFS Boot sector must be present in order to access any data; even if the partition is not bootable. [ List ] [Backup BS] [Rebuild BS] [ Dump ] }}} 7. Check that you have "Status ok" below "Backup boot sector" 8. select [Backup BS]. Done = Via a Windows disc = This method is only able to fix the bootsector of a Windows partition. 1. Get a Windows recovery disk, as explained on [[RestoreUbuntu/XP/Vista/7Bootloader|this page]] 2. Boot on it, and use the 'fixboot' command (not the 'fixmbr' one). This should fix the bootsector of Windows. = External Links = * [[http://www.cgsecurity.org/wiki/TestDisk|Official website of TestDisk]] * [[http://ubuntuforums.org/showthread.php?t=2030238|Discussion thread on ubuntuforums for any question/comment about this tutorial]]. (this is not a thread for support, '''if you need help''' please create your new own thread [[http://ubuntuforums.org/newthread.php?do=newthread&f=333|here]])