Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a working Solaris 10 box whose boot / disk is using ZFS.

I'd like to add another hard drive and mirror this boot drive.

When I run the command I believe is correct (below) I get an error:

-bash-3.2# zpool add -f rpool mirror c1t0d0 c1t1d0
invalid vdev specification
the following errors must be manually repaired:
/dev/dsk/c1t0d0s0 is part of active ZFS pool rpool. Please see zpool(1M). 

Any suggestions on how to fix this?

Many thanks, Doug

share|improve this question
1  
I don't suppose you actually did what it said and read man zpool? –  Chris S Feb 29 '12 at 20:45

1 Answer 1

First, you need to make sure the new disk size is equal or larger than the original one.

Duplicate the disk partition (x86 only):

fdisk -W /var/tmp/rpool-fdisk /dev/rdsk/c1t0d0p0
fdisk -F /var/tmp/rpool-fdisk /dev/rdsk/c1t1d0p0

Duplicate the label (both x86 and SPARC)

prtvtoc /dev/rdsk/c1t0d0s0 | fmthard -s - /dev/rdsk/c1t1d0s0

Mirror the root pool (both x86 and SPARC):

zpool attach -f rpool c1t1d0s0

Install the GRUB boot loader (x86 only):

installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0

Install the boot loader (SPARC only):

installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0

Set the BIOS (x86) or the OpenBOOT prom (SPARC) to have the new disk bootable.

In the latter case (SPARC), that should be something like:

eeprom "boot-device=disk1 disk2" 

Make sure the ZFS resilvering is completed before rebooting. Use the zpool status rpool command to monitor resilvering.

share|improve this answer
    
This is starting to look like a rabbit hole... but: 1) how does one duplicate the disk partitioning/label information on the target disk, and 2) how does one install the boot loader on the second disk? –  Dan Feb 29 '12 at 21:01
    
Are you using x86 or SPARC hardware ? –  jlliagre Feb 29 '12 at 21:18
    
x86 is what I have! –  Dan Feb 29 '12 at 21:26
    
ok, reply updated with both x86 and SPARC instructions. –  jlliagre Mar 1 '12 at 0:59
    
Wow, thanks a bunch. I'll give it a spin! –  Dan Mar 1 '12 at 17:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.