I have a machine with two harddrives. I have installed OpenSolaris on one of them and now I want to add the other one as a mirror-drive in my zpool rpool. I guess I have to format the second disk first and then add it to the pool. How can I do this?
I have tried to follow OpenSolaris ZFS rpool mirror, but when I come to prtvtoc /dev/rdsk/c7t0d0s0 | fmthard -s - /dev/rdsk/c7t1d0s0 then I get this message: fmthard: Cannot stat device /dev/rdsk/c7t1d0s0 and prtvtoc: /dev/rdsk/c7t0d0s0: No such file or directory
Here is some commands and my output (I have removed parts of the output that I don't think is needed:
pfexec format
AVAILABLE DISK SELECTIONS:
0. c7d0
1. c7d1
and
zpool status
pool: rpool
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c7d0s0 ONLINE 0 0 0
EDIT: After running devfsadm -v the following comman works fine:
pfexec fdisk /dev/rdsk/c7d1s2
prtvtoc /dev/rdsk/c7d0s2 | fmthard -s - /dev/rdsk/c7d1s2
zpool attach -f rpool c7d0s0 c7d1s0
and
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 completed after 0h10m with 0 errors
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c7d0s0 ONLINE 0 0 0
c7d1s0 ONLINE 0 0 0 3,77G resilvered
errors: No known data errors
but I fail with installgrub
pfexec installgrub /boot/grub/stage1 /boot/grub/stage2 c7d1s0
cannot open/stat device c7d1s0