Adding swap with zfs

Adding swap with zfs

To add swap from the rpool:

# zfs get volsize rpool/dump
rpool/dump volsize 1.50G local

to increase boot into single user mode and do:

# zfs set volsize=40G rpool/dump

if you can’t bring the system to single user mode
for sparc
# zfs create -V 2G -b 8k rpool/swap2

for x86
# zfs create -V 2G -b 4k rpool/swap2

then just add it

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

You can also add swap from other that the rpool

# zfs create -V 40G -b 4k db1/swap
# swap -a /dev/zvol/dsk/db1/swap
# swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 181,1 8 4194296 4194296
/dev/zvol/dsk/db1/swap 181,3 8 83886072 83886072

Leave a Reply

Your email address will not be published. Required fields are marked *