Gnuru.org
Adventures in Linux


Fix for Vista Clobbering Linux
27 July 2007 @ 19:59 BST
by Paul


Recently, I installed Debian on a new system. It came pre-loaded with Vista. I used the gparted to shrink the Vista partition and create some new partitions. Thusly:

/dev/sda1              49G   NTFS /mnt/windoze
/dev/sda2             981M   ext3 /
/dev/sda6             5.8G   ext3 /var
/dev/sda7             587M   ext3 /tmp
/dev/sda8             229G   ext3 /home
/dev/sda9             4GB    swap

After partitioning I installed Debian using the Netinst CD.

Unfortunately, Vista wouldn't boot after the partition resize. So I had to reinstall it from the install DVD. But then I couldn't boot Linux, because Vista had clobbered my master boot record. Grr...

I hoped that Debian was still on the disk. I booted using the Knoppix live CD and went to the terminal.

First, get the grub shell.

grub

Type:

find /boot/grub/stage1

This returns the location, in my case (hd0,1). Now type:

root (hd0,1)

Or whatever your location was. Then setup the MBR:

setup (hd0)

Now type 'quit' to quit grub. This restored my MBR. It allowed booting of both Windows and Linux. Luckily, Vista hadn't zapped my entire Linux installation.



Leave a comment:

Are you human?