POUWIEL|COM

JeroenPouwiel

Mirroring the rpool

As you may notice below, this is a VM with plenty of disks, the intention is to have a mirrored rpool with a ZFS ZIL. There are two 16Gb disks for the rpool, one 10Gb disk for the ZIL and ten (10) 5Gb disks for a RAIDZ2 zpool. This post will show how to mirror the rpool on Solaris Express 11, it is a shameless ctrl-c/ctrl-v of this blogpost. But it works none-the-less…

jeroen@tartarus:~# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c7t0d0 
          /pci@0,0/pci8086,2829@d/disk@0,0
       1. c7t2d0 
          /pci@0,0/pci8086,2829@d/disk@2,0
       2. c7t3d0 
          /pci@0,0/pci8086,2829@d/disk@3,0
       3. c7t4d0 
          /pci@0,0/pci8086,2829@d/disk@4,0
       4. c7t5d0 
          /pci@0,0/pci8086,2829@d/disk@5,0
       5. c7t6d0 
          /pci@0,0/pci8086,2829@d/disk@6,0
       6. c7t7d0 
          /pci@0,0/pci8086,2829@d/disk@7,0
       7. c7t8d0 
          /pci@0,0/pci8086,2829@d/disk@8,0
       8. c7t9d0 
          /pci@0,0/pci8086,2829@d/disk@9,0
       9. c7t10d0 
          /pci@0,0/pci8086,2829@d/disk@a,0
      10. c7t11d0 
          /pci@0,0/pci8086,2829@d/disk@b,0
      11. c7t12d0 
          /pci@0,0/pci8086,2829@d/disk@c,0
      12. c7t13d0 
          /pci@0,0/pci8086,2829@d/disk@d,0
Specify disk (enter its number)[0]: 11
selecting c7t12d0
[disk formatted]
No Solaris fdisk partition found.
format> fdisk
No fdisk table exists. The default partition for the disk is:

  a 100% "SOLARIS System" partition

Type "y" to accept the default partition,  otherwise type "n" to edit the
 partition table.
y
format> quit
jeroen@tartarus:~# prtvtoc /dev/rdsk/c7t0d0s2 | fmthard -s - /dev/rdsk/c7t12d0s2
fmthard:  New volume table of contents now in place.
jeroen@tartarus:~# prtvtoc /dev/rdsk/c7t12d0s2
* /dev/rdsk/c7t12d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*    2087 cylinders
*    2085 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*	First     Sector    Last
*	Sector     Count    Sector
*           0     16065     16064
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00      16065  33479460  33495524
       2      5    01          0  33495525  33495524
       8      1    01          0     16065     16064
jeroen@tartarus:~# prtvtoc /dev/rdsk/c7t0d0s2
* /dev/rdsk/c7t0d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*    2087 cylinders
*    2085 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*	First     Sector    Last
*	Sector     Count    Sector
*           0     16065     16064
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00      16065  33479460  33495524
       2      5    01          0  33495525  33495524
       8      1    01          0     16065     16064
jeroen@tartarus:~# zpool status
  pool: rpool
 state: ONLINE
 scan: none requested
config:

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

errors: No known data errors
jeroen@tartarus:~# zpool attach rpool c7t0d0s0 c7t12d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c7t12d0s0 overlaps with /dev/dsk/c7t12d0s2
jeroen@tartarus:~# zpool attach -f rpool c7t0d0s0 c7t12d0s0
Make sure to wait until resilver is done before rebooting.
jeroen@tartarus:~# 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 Sat Oct  8 16:11:06 2011
    122M scanned out of 5.69G at 5.55M/s, 0h17m to go
    122M resilvered, 2.10% done
config:

	NAME           STATE     READ WRITE CKSUM
	rpool          ONLINE       0     0     0
	  mirror-0     ONLINE       0     0     0
	    c7t0d0s0   ONLINE       0     0     0
	    c7t12d0s0  ONLINE       0     0     0  (resilvering)

errors: No known data errors
jeroen@tartarus:~# prtvtoc /dev/rdsk/c7t0d0s0
* /dev/rdsk/c7t0d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*    2087 cylinders
*    2085 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*	First     Sector    Last
*	Sector     Count    Sector
*           0     16065     16064
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00      16065  33479460  33495524
       2      5    01          0  33495525  33495524
       8      1    01          0     16065     16064
jeroen@tartarus:~# prtvtoc /dev/rdsk/c7t12d0s0
* /dev/rdsk/c7t12d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*    2087 cylinders
*    2085 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*	First     Sector    Last
*	Sector     Count    Sector
*           0     16065     16064
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00      16065  33479460  33495524
       2      5    01          0  33495525  33495524
       8      1    01          0     16065     16064
jeroen@tartarus:~# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c7t12d0s0
stage2 written to partition 0, 277 sectors starting at 50 (abs 16115)
stage1 written to partition 0 sector 0 (abs 16065)

Comments are closed.

Categories