Möchte man nach einer frischen OS Installation die zweite Festplatte als Mirror Device verwenden, geht man wie folgt vor:
Punkt 1: Auflistung der Device Links
echo | format
echo | format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c4t0d0 <HITACHI-H101414SCSUN146G-SA25 cyl 17845 alt 2 hd 255 sec 63> /pci@0,0/pci1022,7450@2/pci1000,3060@3/sd@0,0 1. c4t1d0 <HITACHI-H101414SCSUN146G-SA25 cyl 17845 alt 2 hd 255 sec 63> /pci@0,0/pci1022,7450@2/pci1000,3060@3/sd@1,0 Specify disk (enter its number): Specify disk (enter its number): root@server:~#
Punkt 2: Duplizierung der Disk Partition (x86 only):
fdisk -W /var/tmp/rpool-fdisk /dev/rdsk/c4t0d0p0 fdisk -F /var/tmp/rpool-fdisk /dev/rdsk/c4t1d0p0
Punkt 3: Dublizierung des Label (x86 & SPARC):
prtvtoc /dev/rdsk/c4t0d0s0 | fmthard -s - /dev/rdsk/c4t1d0s0 fmthard: New volume table of contents now in place.
Punkt 4: Mirror für den root pool erstellen (x86 & SPARC):
zpool attach -f rpool c4t0d0s0 c4t1d0s0 Make sure to wait until resilver is done before rebooting.
Punkt 5: Installation des GRUB boot loader (x86 only):
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c4t1d0s0 stage2 written to partition 0, 277 sectors starting at 50 (abs 16115) stage1 written to partition 0 sector 0 (abs 16065)
Punkt 6: Installation des boot loader (SPARC only):
# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c4t1d0s0
Punkt 7: Wahlweise kann man jetzt im BIOS (x86) oder OpenBOOT PROM (SPARC) das booten von der zweiten Festplatte erlauben:
eeprom "boot-device=disk1 disk2"
Punkt 8: Zpool Status Überprüfen & das System erst nach einem vollständigen Resilvering neustarten:
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. scan: resilver in progress since Mon Apr 1 00:26:18 2013 1,55G scanned out of 7,85G at 13,5M/s, 0h7m to go 1,55G resilvered, 19,76% done config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c4t0d0s0 ONLINE 0 0 0 c4t1d0s0 ONLINE 0 0 0 (resilvering) errors: No known data errors root@server:~#
zpool status pool: rpool state: ONLINE scan: resilvered 7,85G in 0h3m with 0 errors on Mon Apr 1 00:29:56 2013 config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c4t0d0s0 ONLINE 0 0 0 c4t1d0s0 ONLINE 0 0 0 errors: No known data errors root@server:~#