Saturday, November 8, 2008

Tips for GRUB installation.

Whenever you reinstall Windows with an existing Linux installation already present on the hard drive, the MBR gets an overwrite. You can restore GRUB to the previous settings by booting a Linux Live CD or you can download it from http://bosslinux.in/downloads/downloads/iso-images/ and following the steps below:

1. Insert the Live CD and reboot your computer;

2. After reaching the desktop, open up a Terminal and do a su - to access the root account. In BOSS default root password is root.In Ubuntu you’ll have to previously give a password to the root account with sudo passwd root;

3. Type grub in the root prompt;

#grub

4. The Grub prompt has appeared and you should type find /boot/grub/stage1 in it then hit Enter. You’ll get an output which tells where the grub is available in your system.

grub>find /boot/grub/stage2

(hd0,5)
(hd0,6)
(hd0,7)

5. Type #root(hd0,x) where x is number from last command output then hit Enter;

6. Type #setup(hd0,x) and hit Enter;

7. Type #quit and hit Enter;

8. Reboot the system and remove the Live CD from the tray.


another way to do same grub installation.

#grub-install --recheck --no-floppy --root-directory=DIR device_name

grub-install copies GRUB images into the DIR/boot directory specfied by
--root-directory.

--recheck
probe a device map even if it already exists

--recheck
probe a device map even if it already exists

example

#grub-install --no-floppy --recheck root-directory=/mnt/disk[sda6] /dev/sda6

No comments: