Increase swap size on Solaris 11 without rebooting.

Increase swap size on Solaris 11 without rebooting.


# swap -l
swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap 124,2         8  2097144  2097144

# zfs get volsize rpool/swap 
NAME        PROPERTY  VALUE    SOURCE
rpool/swap  volsize   1G       local

# swap -d /dev/zvol/dsk/rpool/swap

# swap -l
No swap devices configured

# zfs set volsize=8G rpool/swap

# swap -a /dev/zvol/dsk/rpool/swap

# swap -l
swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap 124,2         8 16777208 16777208

# zfs get volsize rpool/swap  
NAME        PROPERTY  VALUE    SOURCE
rpool/swap  volsize   8G       local