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

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

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

#1 Post 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.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#2 Post 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.

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#3 Post 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.

Post Reply