Tuesday 26 February 2013

Mirroring rpool and creating a swap pool

When I order machines, I want a minimum of 4 internal disks. Two for the OS and two for swap. You can get small disks anymore so you end up with huge amounts of swap space but that's how I roll.

The steps are the same as Solaris 10.

zpool status to see your current pools and the disks in them.

First use "format" to make sure all your disks are present. Check the partition table of your current root disk and format another disk in the same manner (i.e. all the space into one slice)

partition> p
Volume:  solaris
Current partition table (original):
Total disk cylinders available: 46873 + 2 (reserved cylinders)
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       1 - 46872  279.38GB    (46872/0/0) 585900000
  1 unassigned    wm       0            0         (0/0/0)             0
  2     backup    wu       0 - 46872  279.38GB    (46873/0/0) 585912500
  3 unassigned    wm       0            0         (0/0/0)             0
  4 unassigned    wm       0            0         (0/0/0)             0
  5 unassigned    wm       0            0         (0/0/0)             0
  6 unassigned    wm       0            0         (0/0/0)             0
  7 unassigned    wm       0            0         (0/0/0)             0



Setting up rpool to be mirrored:
zpool attach -f rpool <disk1s0> <disk3s0>
Wait for resilvering to finish (check zpool status) then run:
installboot -f -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/<disk3s0>
 

Adding swap:
zpool create swappool mirror <disk2> <disk4>
zfs create -V 250G swappool/swap1
swap -a /dev/zvol/dsk/swappool/swap1

echo "/dev/zvol/dsk/swappool/swap1    -    -    swap   - no  -" >>/etc/vfstab

At this point you should really reboot and make sure all your changes are still there. Booting off the mirrored root disk as a test is also good practice.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.