OpenSolaris

Discussions Communities Projects Download Source Browser

Home » OpenSolaris Forums » OpenSolaris » help

Thread: How to restore the grub bootloader from live cd?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 4 - Last Post: Sep 27, 2009 12:52 AM by: jerry40
eddyt

Posts: 2
From: US

Registered: 9/11/09
How to restore the grub bootloader from live cd?
Posted: Sep 11, 2009 2:36 PM
To: OpenSolaris » help
  Click to reply to this thread Reply

I installed ubuntu on a second drive and it didn't detect opensolaris and overwrote the MBR on the first drive (that has opensolaris). I fixed ubuntu simple enough so it's now installed into the MBR on second drive. So if I choose the second drive in bios it boots fine. But I still can't get the mbr reinstalled into the MBR on first drive.

The method I see a lot of people mention is this:

pfexec zpool import -f rpool
mkdir /tmp/a
pfexec zfs set mountpoint=/tmp/a rpool/ROOT/opensolaris
pfexec /sbin/installgrub /tmp/a/boot/grub/stage1 /tmp/a/boot/grub/stage2 /dev/rdsk/c7t0d0s0

My problem is with the mountpoint. Doing a directory listing of /tmp/a shows it's blank. Other mounts like /export and /rpool are allready mounted. In an effort to get around this I tried using the stage1 and stage2 from the cd (/boot/grub/stage1 and stage2) but when I try to boot it just shows a blank screen.

This is with opensolaris 2009.08

Some hopefully useful information:
jack@opensolaris:~$ zpool status
pool: rpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c7t0d0s0 ONLINE 0 0 0

errors: No known data errors

jack@opensolaris:~$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 25.8G 431G 81.5K /rpool
rpool/ROOT 10.2G 431G 19K legacy
rpool/ROOT/opensolaris 6.30G 431G 6.13G /tmp/a
rpool/ROOT/opensolaris-1 654K 431G 6.07G /
rpool/ROOT/opensolaris-2 3.90G 431G 7.01G /
rpool/dump 6.00G 431G 6.00G -
rpool/export 3.61G 431G 21K /export
rpool/export/home 3.61G 431G 21K /export/home
rpool/export/home/sbadmin 3.61G 431G 3.61G /export/home/sbadmin
rpool/swap 6.00G 437G 101M -

jerry40

Posts: 16
From:

Registered: 3/3/07
Re: How to restore the grub bootloader from live cd?
Posted: Sep 12, 2009 12:02 AM   in response to: eddyt
To: OpenSolaris » help
  Click to reply to this thread Reply

Hi.

installgrub has a parameter "-m" which says grub to install itself to MBR.
Also you can try to update a boot archive:
----
pfexec touch /tmp/a/system
pfexec bootadm update-archive -R /tmp/a
----
After the whole process I would execute next commands:
pfexec zfs set mountpoint=/ rpool/ROOT/opensolaris
pfexec umount /tmp/a
pfexec export rpool
----
I have not any idea why mounting is not working in your case, it worked fine for me.
Besides, why are you trying to mount rpool/ROOT/opensolaris? It seems that you may want to mount /rpool/ROOT/opensolaris-2 as most late version?

eddyt

Posts: 2
From: US

Registered: 9/11/09
Re: How to restore the grub bootloader from live cd?
Posted: Sep 14, 2009 8:30 AM   in response to: jerry40
To: OpenSolaris » help
  Click to reply to this thread Reply

The -m option worked beautifully. I still used stage1 and stage2 from the live cd (/boot/grub/stage1 and stage2) and it worked just fine although I did run installgrub again once the machine was running just in case.

In regards to using opensolaris-2, I was just guessing since have three opensolaris mounts was confusing for me. Sure enough when it boots it uses opensolaris and not -1 or -2.

Thanks for your help.

hazzino

Posts: 116
From: IT

Registered: 2/2/08
Re: How to restore the grub bootloader from live cd?
Posted: Sep 26, 2009 11:45 AM   in response to: eddyt
To: OpenSolaris » help
  Click to reply to this thread Reply

hi there i tried many times to restore the grub,i did the job,grub is back but unfortunatly,is not working.There's one thing that i do not understand how can grub from the live cd read my old menu.lst,how can that happen????
Is there any good fellowers who can help me to restore my system???
Thanks a lot

jerry40

Posts: 16
From:

Registered: 3/3/07
Re: How to restore the grub bootloader from live cd?
Posted: Sep 27, 2009 12:52 AM   in response to: hazzino
To: OpenSolaris » help
  Click to reply to this thread Reply

Hi.

>grub is back but unfortunatly,is not working

Can you explain what do you mean?
I see two possibilities (after you restart from your hard disk, not live CD):
If grub is not able to load menu.lst you need to create the one in "/rpool/boot/grub/"
If you see the grub menu but menu points do not work, you need to edit menu.lst to set "findroot" and "bootfs" to proper values.
--------
title Solaris Development snv_121 X86
findroot (pool_rpool,0,a)
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
--------
grub and menu.lst are not hard linked, You can update grub and left old menu.lst and vice versa, this is ok.




Terms of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
Copyright © 1995-2005 Sun Microsystems, Inc.