ZFS boot disk mirror

Last modified by Quentin Conner on 2011/06/20 20:39

Jun 20 2011

After installing Solaris 11 Express, mirroring the "rpool" created by the installer is a Good Idea.  To do this we assume our second hard disk is the same geometry as the first, and we assume the following device names:

  • /dev/dsk/c7t0d0s0
  • /dev/dsk/c7t1d0s0

verify device names
View available block storage devices.  Check to be sure the device for current rpool is c7t0d0s0
cfgadm -s "select=type(disk)"
zpool status

configure fdisk partition
Use the -B option to create a default, single partition spanning the entire drive.  The first drive should be partitioned this way.
fdisk -B c7t1d0p0
View the partition table
fdisk -W - c7t1d0p0

configure vtoc slices
We cheat here and just copy the VTOC table (slices) from the first hard disk.  There is one for boot and one for ZFS "rpool".
prtvtoc /dev/rdsk/c7t0d0s0 | fmthard -s - /dev/rdsk/c7t1d0s0

Run format and verify two drives with same geometry show up
format

attach mirror slice
If everything looks good, attach the new slice to the existing zpool to form a mirror.  Use "zpool status" to monitor the resilvering.
zpool attach -f rpool c7t0d0s0 c7t1d0s0

grub
We need to install a grub MBR.  In case the first disk fails, we can boot from the second.
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c7t1d0s0

Tags:
Created by Quentin Conner on 2011/06/20 19:52

This website content is not licensed to you. All rights reserved.
Delphinus Wiki - XWiki Enterprise 2.7.33656 - Documentation