[YLUG] What''s the command to reinstall grub menu?

Stuart Priest stuart.priest at york.ac.uk
Tue Sep 13 10:16:02 UTC 2011


Dear Alex

These are the commands I use when I do a Fedora rescue boot and forget 
to mount the disk...

mount     /dev/sda6 /mnt/sysimage
mount --bind /proc /mnt/sysimage/proc
mount --bind /dev /mnt/sysimage/dev
mount --bind /sys /mnt/sysimage/sys
/mnt/sysimage/sbin/grub-install --root-directory=/mnt/sysimage /dev/sda

Regards

Stuart Priest, room B102B (within room B102A)
Bioscience Computing Manager, Department of Biology (Area 15)
University of York, Wentworth Way, Heslington, YORK, YO10 5DD, UK
Tel: +44 (0)1904 328744
Mob: +44 (0)7876 577900
Fax: +44 (0)1904 328804

Please note I am regularly out of my office and so may not be able to 
respond to emails immediately

EMAIL DISCLAIMER http://www.york.ac.uk/docs/disclaimer/email.htm

On 13/09/2011 09:36, mike cloaked wrote:
> On Tue, Sep 13, 2011 at 9:32 AM, mike cloaked<mike.cloaked at gmail.com>  wrote:
>> On Tue, Sep 13, 2011 at 8:34 AM, ALEX ARMANI<alex.armani at live.co.uk>  wrote:
>>>   What''s the command to reinstall grub menu?
>>>
>>> Hi all. I need to reinstall my grub menu cos it's coming up with an error at
>>> boot. What's the command to use from a live disk to scan the hard drive for
>>> OS's and reinstall the Grub menu? You know what I mean! Tia from Alex&
>>> Genipher.xx
>>
>> Usually (certainly in Fedora which I use) when you boot to a live or
>> rescue image, you need two commands:
>> chroot /mnt/sysimage
>> grub-install /dev/sda
>>
>> (or whichever drive you want grub to be installed on)
>>
>> For the next generation Fedoras, and presumably some other distros, if
>> you are using grub2, then grub2-install /dev/sda or equivalent should
>> do it.
>>
>> This presumes that it is only that the mbr has been overwritten and
>> needs restoring.
>>
>
> If you have grub in the mbr but you had gotten your grub.conf
> corrupted then you will need to re-write that file either from a
> backup that you took (and you always keep backups for this
> eventuality?) - or write grub stanzas as necessary to pull in the
> necessary OS'es you have on your system with their initial ramdisk
> files under /boot/
>
> If you are a grub2 user then you will need to look at the grub2 documentation.
>
> Hopefully you only needed to re-install grub into the mbr on the drive!
>



More information about the York mailing list