Thứ Sáu, 13 tháng 2, 2009

[Open Solaris] How to reinstall GRUB

Sometimes, your GRUB is damaged. It may happen because you reinstall an Windows and Windows MRB overrides your GRUB.

To recover GRUB , follow these instruction.

You need to have an OpenSolaris Live CD. Insert an OpenSolaris Live CD and boot it.
Open terminal and begin to recover your GRUB

Firstly, list all items in /dev/rdsk/
to find an appropriate OpenSolaris partition.

$ ls /dev/rdsk/

The item you are looking for usually has the same pattern like cXd0s2. In this example, i discover the partition c5d0s2

Secondly, as follow:

$ pfexec prtvtoc /dev/rdsk/c5d0s2


* /dev/rdsk/c5d0s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 63 sectors/track
* 255 tracks/cylinder
* 16065 sectors/cylinder
* 9297 cylinders
* 9295 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 4209030 145115145 149324174
1 3 01 16065 4192965 4209029
2 5 01 0 149324175 149324174
8 1 01 0 16065 16064


By convention s2 means the "entire disk."
The Tag value for slice 0 is 2, indicating slice 0 is the root slice
Thirdly, reinstall GRUB using :

$ pfexec installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c5d0s0

By default installgrub does not modify the MBR

If, however, you do want the OpenSolaris GRUB installed to the MBR, specify the -m flag on the installgrub command line:

$ pfexec installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c5d0s0

For more information, please visit SUN blog and
"How Solaris disk device names work"

Không có nhận xét nào:

Đăng nhận xét