How can I create a new swap location in ZFS?

I am running OpenSolaris v5.11

During installation, the installation created default ZFS filesystems, like the dump and swap locations.

I want to change the blocksize of the /dump and /swap locations and make them ZFS volumes.

The ZFS system is on a zpool called rpool

I was able to do a zfs destroy on /rpool/dump and then create another dump location with the proper options:
zfs create -b 131072 -V 1024m rpool/dump

I cannot destroy /rpool/swap though. It tells me that the ...dataset is busy. I did some investigating and found that I have to do a dumpadm but that doesn't work either:

>dumpadm -d swap
dumpadm: no swap devices could be configured as the dump device

>swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 182,1 8 16775160 16775160

How can I destroy the /rpool/swap directory and then create another swap directory and make it a volume with a particular blocksize? Do I rename the swap location to something else?

Thanx.

Why ? What do you expect with changing the dump and swap blocksizes ?

They are already ZFS volumes, not filesystems.

I bet it was initially created with the same options. What says
"zpool history -il | grep dump" ?

Your investigation failed, dumpadm has no relationship with the swap, especially when on ZFS.

You don't remove swap with the dumpadm command but with the swap one:

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

I want to change the volume size so I can recreate a customer environment.

zpool history -il | grep dump
2009-01-07.01:20:03 zfs create -b 131072 -V 8191m rpool/dump [user root on opensolaris:global]
2009-01-15.17:00:19 zfs destroy rpool/dump [user root on opensolaris:global]
2009-01-15.17:00:36 zfs create -b 131072 -V 1024m rpool/dump [user root on opensolaris:global]

The original dump location was a bit bigger than what I set it to.

Sorry about my bad investigation, I was going by this info:

ZFS Troubleshooting Guide - Siwiki

Thanx, I'll try it.

Jilliagre,

I tried the swap -d command above and it didn't work:

swap -d /dev/zvol/dsk/rpool/swap
/dev/zvol/dsk/rpool/swap was dump device --
invoking dumpadm(1M) -d swap to select new dump device
dumpadm: no swap devices are available

Do I have to set up another swap device before deleting the original one?

You cannot use a swap device as a dump device on ZFS. Is "/dev/zvol/dsk/rpool/swap was dump device --" really a message you got from running the swap command ?

How much RAM is installed ? Reducing the dump device size from 8 to 1 GB might prevent a crash dump to complete.

If your swap is in use and no other swap area can pick the stored pages, you cannot remove a swap area.

What exactly are you trying to reproduce with your settings ? kernel panics ?