Re: [Hampshire] windows grub repair suse 10.2

Top Page

Reply to this message
Author: John Cooper
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] windows grub repair suse 10.2
David Ramsden wrote:
> m.nuttall@??? wrote:
> [big snip]
>>
>> right the terminal output is this:
>>
>> "ubuntu@ubuntu:~$ sudo mkdir /mnt/newroot
>> ubuntu@ubuntu:~$ sudo mount /dev/hda7 /mnt/newroot
>> ubuntu@ubuntu:~$ sudo chroot /mnt/newroot
>> ubuntu:/# grub-install /dev/hda
>> /dev/hda: Not found or not a block device.
>> ubuntu:/# fdik -l
>> bash: fdik: command not found
>> ubuntu:/# fdisk -l
>> cannot open /proc/partitions
>> ubuntu:/# "
>>
>
> Have you looked at the HantsLUG wiki? There's a note on there about
> how to restore LILO. The same applies when using GRUB. Ignore step 9
> and at step 10 you want to run your "grub-install" command instead of
> running "lilo".
>
> http://www.hants.lug.org.uk/cgi-bin/wiki.pl?LinuxHints/LostLILO
>
> You'll probably find your grub-install and fdisk commands failed
> because /proc and /dev aren't mounted inside the chroot, so /dev/hda
> et al dosen't exist. Step 6 brings /dev from the LiveCD you're using
> in to your chroot. This is what you're missing.
>
> Nearly there!
>
> Regards,
> David.

Fedora/Red Hat automatically detects the partitions and mounts them so
the chroot and grub-install will just work.
To manually do this :-

(missing step)

mount -o bind /dev /mnt/dev

chroot /mnt/newroot
mount -a
fdisk -l

NOTE: My /etc/fstab has my /boot as a LABEL=/boot and this didn't get mounted, so had to mount it manually
mount /dev/sda2 /boot.

Check your grub.conf is viewable

less /etc/grub.conf ( or less /boot/grub/grub.conf or /boot/grub/menu.lst)

grub-install /dev/hda

Easy! :-(

--
--------------------------------------------------------------
Discover Linux - Open Source Solutions to Business and Schools
http://discoverlinux.co.uk
--------------------------------------------------------------