Solved Additional swap

Eventually I used a swap-file, created on the fly and removed once finished the task

Hi guys,

I have a small utilities that is literally sucking all my memories, I'd like to add more swap to see if it is able to finish its task.

I read that using a swap file with ZFS is not a good idea even though is quite easy to create (Handbook 12.12), however I have already a physical swap and perhaps it would not constitute an a threat for the system:

Code:
swapinfo                                                                              23:59
Device          1K-blocks     Used    Avail Capacity
/dev/ada0p5       6292644        0  6292644     0%

Anyway I found this documentation about Solaris:


Where are given the following instructions to add more swap and I wonder if can follow the same procedure with FreeBSD 13.0:

If the system cannot be rebooted, add another swap volume to increase your total swap space.
For example:
Code:
# zfs create -V 2G rpool/swap2

Then, activate the second swap volume.
Code:
# swap -a /dev/zvol/dsk/rpool/swap2
# swap -l
swapfile                  dev  swaplo   blocks   free
/dev/zvol/dsk/rpool/swap  256,1      16 1058800 1058800
/dev/zvol/dsk/rpool/swap2 256,3      16 4194288 4194288

If necessary, add an entry for the second swap volume in the /etc/vfstab file.
For example:
Code:
/dev/zvol/dsk/rpool/swap2    -    -    swap    -    no    -

What would be the better way to add the swap? With a swap file or with zfs?

Thanks,

freezr

#swap #zfs
 
zfs-create(8) says:
Code:
   ZFS Volumes as Swap
     ZFS volumes may be used as swap devices. After creating the volume with
     the zfs create -V command set up and enable the swap area using the
     mkswap(8) and swapon(8) commands. Do not swap to a file on a ZFS file
     system. A ZFS swap file configuration is not supported.
 
Back
Top