Go to main content

Managing ZFS File Systems in Oracle® Solaris 11.3

Exit Print View

Updated: May 2019
 
 

Adjusting the Sizes of ZFS Swap and Dump Devices

After installation, you might need to adjust the size of swap and dump devices after installation. Or you might need to recreate the swap and dump volumes.

By default, when you specify n blocks for the swap size, the first page of the swap file is automatically skipped. Thus, the actual size that is assigned is n-1 blocks. To configure the swap file size differently, use the –swaplow option with the swap command. For more information about the options for the swap command, see the swap(1M) man page.

The following examples show how to adjust existing swap and dump devices under different circumstances.

Example 24  Resetting the Dump Device volsize Property

Note that resizing a large dump device can be a time-consuming process.

# zfs set volsize=2G rpool/dump
# zfs get volsize rpool/dump
NAME        PROPERTY  VALUE       SOURCE
rpool/dump  volsize   2G          -
Example 25  Resizing the Swap Volume for Immediate Use

This example shows two ways of adjusting the swap size.

The first method enables you to adjust the swap volume without having to reboot the system.

# swap -l
swapfile                     dev    swaplo    blocks     free
/dev/zvol/dsk/rpool/swap   303,1         8   2097144  2097144
# zfs get volsize rpool/swap
NAME         PROPERTY   VALUE    SOURCE
rpool/swap   volsize       1G     local
# zfs set volsize=2g rpool/swap
# swap -l
swapfile                     dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap   303,1         8  2097144  2097144
/dev/zvol/dsk/rpool/swap   303,1   2097160  2097144  2097144

This second method to adjust swap size requires you to reboot the system for the new size to be displayed.

# swap -d /dev/zvol/dsk/rpool/swap
# zfs set volsize=2G rpool/swap
# swap -a /dev/zvol/dsk/rpool/swap
# init 6