windows overwrote boot record

Karl Klinger karlok at fastmail.fm
Thu Aug 21 22:32:40 UTC 2008


Juan Kawada wrote:
> would hd0 be my boot partition?  sorry I have no idea what i'm doing
> really. How do I know what my boot/root partitions are?
> 
> 
> On 8/21/08, Willy K. Hamra <w.hamra1987 at gmail.com> wrote:
>> Juan Kawada wrote:
>>> I just had to reinstall windows, and it overwrote the boot record, I
>>> now boot to a screen that says
>>>
>>> windows xp home edition
>>> windows xp professional
>>>
>>> I got into a live cd and tried this:
>>> sudo grub
>>> find /boot/grub/stage1
>>> root (hd0,5)
>>> setup (hd0)
>>>
>>> and got:
>>> grub> find /boot/grub/stage1
>>>  (hd0,5)
>>>
>>> grub> root (hd0,5)
>>>
>>> grub> setup (hd0)
>>>  Checking if "/boot/grub/stage1" exists... yes
>>>  Checking if "/boot/grub/stage2" exists... yes
>>>  Checking if "/boot/grub/e2fs_stage1_5" exists... yes
>>>  Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are
>>> embedded.
>>> succeeded
>>>  Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p
>>> (hd0,5)/boot/grub/stage2
>>> /boot/grub/menu.lst"... failed
>>>
>>> Error 22: No such partition
>>>
>>>
>>> What's wrong?  I've also tried setup (hd0,5) with similar results.
>>>
>>> Is this because I'm using i'm using the 7.10 live cd on an 8.04
>>> install? I'm not sure where my 8.04 disc went.
>>>
>> i don't think it matters, grub is the same for all versions and distros
>> AFAIK.
>> i'm sorry i can't be of much help, since i never used that command, when
>> i do any reinstall/repair of windows, and the MBR gets overwritten, i
>> boot the LiveCD-any *buntu LiveCD-and do the following
>> mount my partition, if you have more than 1 partition, you need to mount
>> the root partition and the boot partition, keeping their original
>> directory tree, for example, if you mounted the root partition under
>> /media , you should mount the boot partition under /media/boot .
>> and then i issue the following command:
>>
>> sudo grub-install --root-directory={mount directory} /dev/{the device}
>>
>> mount directory=the directory you mounted your root partition at
>> the device=the hard disk device you want to install grub on
>>
>> hope this works
>>
>> --
>> Willy K. Hamra
>> Manager of Hamra Information Systems
>> Co. Manager of Zeina Computer & Billy Net
>>
> 
> 
 From your grub output it looks like your root partition is sda6 and you 
don't have a separate boot partition.  Thus you could:

sudo mount /dev/sda6 /media

At this point you could do an 'ls /media' to make sure that it contains 
the linux directory tree.  If all is well, do:

sudo grub-install --root-directory=/media /dev/sda6

Karl

p.s. I noticed on another thread that you had recently installed a 
second dvd drive.  I wonder if this could have confused grub and caused 
it to fail.




More information about the kubuntu-users mailing list