Question:how to Resize ZFS Swap?


resize your ZFS based Swap you need to know on which pool your Swap resides:
# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
rpool                      9,70G  5,92G  32,5K  /rpool
rpool/ROOT                 8,42G  5,92G    21K  legacy
rpool/ROOT/s10x_u9wos_14a  8,42G  5,92G  8,42G  /
rpool/dump                  768M  5,92G   768M  -
rpool/export                763K  5,92G    23K  /export
rpool/export/home           740K  5,92G   740K  /export/home
rpool/swap                  544M  5,95G   516M  -
The easy way:
# zfs list | grep swap
rpool/swap                  544M  5,95G   516M  -
In this case the Swap lays on the ZFS pool rpool. Next get the current Swap size:
# zfs get volsize rpool/swap
rpool/swap  volsize   512M     local
The ouptu above shows that Swap area has a size of 512MB. To resize the Swap area to 2GB use:
# zfs set volsize=2048M rpool/swap
And check again:
# zfs get volsize rpool/swap
rpool/swap  volsize   2G       local

asked Sep 13, 2013 in LINUX by rajesh
edited Sep 12, 2013
0 votes

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.