• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

how to rebuild the ubuntu boot loader

Nov 12, 2011
355 (0.16/day)
System Name Asrock 2013
Processor AMD Phenom II X4 965 Black Edition Deneb 3.4GHz
Motherboard ASRock 970 PRO3 AM3+
Cooling Corsair H70 for CPU
Memory G.SKILL Ripjaws X Series 8GB DDR3 1333
Video Card(s) Ati HD5770 1GB DDR5 with Massive Heatsink and 120mm fan
Storage Samsung SSD Evo 850 250GB sata3 + Seagate 300GB HD sata1
Display(s) HNC AG191D
Case Big Black Tower
Audio Device(s) Audigy 2 ZS Platinum
Power Supply EVGA 500W
Mouse Logitech Mx 310
Keyboard Microsoft Internet Keyboard
Software Windows 10
I was using the boot loader that ubuntu installed to load linux and windows xp individually, but after I tried to reinstall xp using a bootable usb drive it erased my boot loader information leaving xp as the only os to boot.

I want to know what are the commands that I need to input maybe inside a live ubuntu so I can use my existing ubuntu instalation as well as xp like it was before this accident.
Nov 29, 2011
5,975 (2.66/day)
Hi! I'm from the Internet
System Name Selene / Yoda
Processor Fx 8350 @ 4.4 / Phenom II x6 1090t @ 3.6
Motherboard Gigabyte 990FXA-UD3 r4.0 / Gigabyte 890XA-UD3
Cooling H100i / Xig Dark Knight
Memory 4x 8gb G.Skill Snipers / 4x 4gb G.Skill Ares
Video Card(s) Gigabyte R9 290x / XfX DD & VisionTek HD6850's C'fired
Storage 256gb ssd, 2x 2tb Wd Blacks & 1x 1tb Wd black / 1x 1tb
Display(s) Dell Ultra Sharp 2408 WFp / Hp w2207
Case Raidmax Vampire / Chieftec Alum. Dragon Blue
Audio Device(s) Onboard Hd Audio / Onboard Hd Audio
Power Supply Corsair TX 850 watt / Corsair TX 750 watt
Mouse Logitech G500s
Keyboard Corsair Strafe
Software Win 10 pro / Win Vista Home prem. 64 bit
Benchmark Scores What are benchmarks anyway?
Yes grub will work.
Sep 1, 2010
5,936 (2.20/day)
If you have problems with grub here's a straightforward guide from ubuntu forums:

Open terminal and type

sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter this

find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files. THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)

root (hd?,?)

Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1). Next enter the command to install grub to the mbr

setup (hd0)

Finally exit the grub shell


That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Dec 13, 2011
392 (0.18/day)
Processor Intel C2Q Q9550 (2.83 GHZ)
Cooling Intel OC27vv
Memory 12 GB DDR3 667mhz
Video Card(s) XFX Radeon HD 5670
Storage Seagate - 500GB | 7200RPM | 32MB Cache | Sata-3G
Display(s) BenQ RL2455
Case Dell Tower
Audio Device(s) On-board
Power Supply Corsair 600w
For simplicity, sake I use a CD called Boot-Repair-disk.
Mar 31, 2012
546 (0.26/day)
System Name SIGSEGV
Processor Intel | AMD
Motherboard INVALID| X399
Cooling 2 Heatpipes | EK
Memory 16 Gb DDR4 2400 | 32 GB DDR4
Video Card(s) 1060 | MI25 / Vega Frontier | Tesla K
Storage 1TB 7200/256 SSD PCIE | ~ TB
Display(s) 15,5" / 27" LEDTV | No Display
Case Black & Grey
Audio Device(s) Realtek
Power Supply Silverstone 850W | Unrated PSU
Software LinuxMint KDE | XFCE
Benchmark Scores i dont care about scores
boot with the ubuntu installation cd, open terminal, find root hdd for linux booting and mbr hdd partition then mounting and re-mapping it to grub, finally re-installing grub by typing #grub-install /mount-dir/mapped-mbr-partition /dev/orig-mbr-partition.

note : if you have 2 different disk locations for linux partition and windows mbr partition, while on successfully grub booting you should edit grub parameter by pressing 'e' then do manual re-map linux root partition