Page 1 of 1

How to use Puppy to repair Ubuntu grub2 MBR of your hd

Posted: Thu 02 May 2013, 12:40
by watchdog
It can happen that your pc with ubuntu and grub2 (grub-pc) even in dual-boot with windows gets its mbr damaged. There are several tutorials on the internet how to repair mbr by a ubuntu live cd/dvd. I use puppy linux. You can use puppy in ram mode or you can boot a pupsave on your hd. Assuming that sdax contains the ubuntu install you have to type the following commands in puppy console:

Code: Select all

mkdir /mnt/dir
mount /dev/sdax /mnt/dir
mount --bind /dev /mnt/dir/dev
mount --bind /proc /mnt/dir/proc
mount --bind /sys /mnt/dir/sys
chroot /mnt/dir
grub-install /dev/sda
exit
umount /mnt/dir/dev
umount /mnt/dir/proc
umount /mnt/dir/sys
umount /mnt/dir
Restart your system.

Posted: Sun 07 Jul 2013, 05:26
by greengeek
Hi watchdog, you mention a dualboot ubuntu / windows scenario - would this code allow me to rebuild the mbr on a "windows only" PC?

My Windows machine is dead, and has not come back to life despite me running the recovery CDs, so I can afford to try a few things like this. Just looking for ways to rewrite the mbr in case that is why it wont boot.

Posted: Sun 07 Jul 2013, 07:44
by watchdog
No. This procedure will work if you already installed grub and it gets damaged. I don't know if it is possible to install grub without any linux distribution and chainload windows. Now I am experimenting with Plop boot manager. I'll post some interesting things. I suggest you this software:

http://www.plop.at/en/ploplinux/download.html

Download Plop boot manager cd and try to boot your windows with it. You can install it to hd as boot manager if it works.

Edit. As second choice I suggest you ubcd. Do you know "Ultimate Boot Cd"?

http://www.ultimatebootcd.com/download.html

It is a selection of tools open source to repair disks. I used it to delete hidden encrypted partitions in usb sticks where gparted fails. Ubcd can contain some tools that can help you to repair your windows installation.