ZFS Volume as swap device Print E-mail
(0 votes, average: 0 out of 5)
Written by geekyS   
Saturday, 20 December 2008 17:00

This Geekyfacts article explains the procedure to use zfs volume as swap device                                                  

 

Creating a ZFS volume of size 1gb

[root@geekyfacts]# zfs create -V 1gb testpool/swapvol

[root@geekyfacts]# zfs list
NAME               USED  AVAIL  REFER  MOUNTPOINT
testpool          1.00G   880M    18K  /testpool
testpool/swapvol     1G  1.86G    16K  -

 

You should be seeing the block and raw device file now for the volume created

 

[root@geekyfacts]# ls /dev/zvol/{dsk,rdsk}/testpool/swapvol
/dev/zvol/dsk/testpool/swapvol   /dev/zvol/rdsk/testpool/swapvol
[root@geekyfacts]#


Enable ZFS volume as swap device

 

[root@geekyfacts]# swap -a /dev/zvol/dsk/testpool/swapvol

[root@geekyfacts]# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0t0d0s0   30,129      8 8418048 8418048
/dev/zvol/dsk/testpool/swapvol 181,1       8 2097144 2097144
[root@geekyfacts]#

 

 

 

 

Last Updated on Thursday, 01 January 2009 09:27