Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

installgrub fails after replacing failed disk in zfs root mirror

Frustrated_with_the_Display_NameJun 7 2013 — edited Jun 10 2013
This is on Solaris 10 10/08, which was the first (I believe) to support installation onto mirrored zfs root.


I'm getting an installgrub error after replacing one of the two drives in a ZFS root mirror. The pool name is "rpool" (chosen by the installer I
believe) and the failed device is c2t1d0s0. The still-functioning drive is c2t0d0s0.

Here's what I've done so far

$ sudo zpool detach rpool c2t1d0s0
$ sudo zpool status
zpool status
pool: rpool
state: ONLINE
scrub: scrub in progress for 0h13m, 14.37% done, 1h20m to go
config:

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


I shut down the system (shutdown -i0 -g0 -y), removed the failed hard drive, and installed the replacement. It's a slightly different
model # and is apparently just slightly bigger.

I was able to boot the system off the single remaining drive in the rpool, so it clearly had both stages of the grub boot loader installed.

Next I formatted the replacement drive to match the other drive:

$ sudo prtvtoc /dev/rdsk/c2t0d0s2 | sudo fmthard -s - /dev/rdsk/c2t1d0s2
fmthard: Partition 2 specifies the full disk and is not equal
full size of disk. The full disk capacity is 976735935 sectors.
fmthard: New volume table of contents now in place.

After formatting, I attached slice 0 to the rpool, which required the "-f" option to attach:

$ sudo zpool attach rpool c2t0d0s0 c2t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c2t1d0s0 overlaps with /dev/dsk/c2t1d0s2

$ sudo zpool attach -f rpool c2t0d0s0 c2t1d0s0

That succeeded, and it's now resilvering:

$sudo zpool status
pool: rpool
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h4m, 0.98% done, 7h37m to go
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror ONLINE 0 0 0
c2t0d0s0 ONLINE 0 0 0
c2t1d0s0 ONLINE 0 0 0 2.38G resilvered

errors: No known data errors

Now I want to install the grub stage1 & stage2 boot blocks on the new device, and I'm running into a problem:

$ sudo installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c2t1d0s0
Partition 0 of the disk has an incorrect offset

It seems to be complaining that slice 0 doesn't start at offset 0 on disk. That's correct, but it's exactly the same as for the existing disk
that the installer formatted and I've been using for several years.

The disk I booted from:

$ sudo prtvtoc -h /dev/rdsk/c2t0d0s2
0 2 00 16065 976703805 976719869
2 5 01 0 976719870 976719869
8 1 01 0 16065 16064

The disk I replaced, that I'm trying to install the boot blocks onto:

$ sudo prtvtoc -h /dev/rdsk/c2t1d0s2
0 2 00 16065 976703805 976719869
2 5 01 0 976719870 976719869
8 1 01 0 16065 16064

The reading I've done (and it's been a bunch, including all the forum posts I could find that mention "installgrub") all seems to indicate that
grub boot blocks should be installed into the root slice, which the installer made s0. That doesn't begin at the start of the disk, though.

I'm wondering if the boot block is instead supposed to go onto slice 8, which the installer created and which does begin at the start of the disk. I'm hesitant to just blindly do that, though, since I'm not certain what slice 8 actually contains.

Any suggestions for how to proceed? Any additional information I can provide that would be useful?
This post has been answered by bobthesungeek76036 on Jun 7 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2013
Added on Jun 7 2013
2 comments
1,911 views