How to move a swap file between different pools in SynetoOS 4

Written By Christian Castagna (Administrator)

Updated at December 3rd, 2024

→ Applies to: SynetoOS 4.x

This process is about managing space on a ZFS pool (in this case, rpool) that is full.

A possible solution is to move a large swap file (over 8 GB) to another pool, thus freeing up space on rpool.

 

Step 1. Connect to SynetoOS appliance via SSH as admin

ssh admin@<your_ip_address_or_hostname>

 

Step 2 (optional). Change into Solaris shell (in case you're directed to an unsupported shell)

un sh

 

Step 3. Get root privileges

sudo su -

 

Step 4. Create a new ZFS volume for the swap file (replace <pool_name> with the correct pool name)

zfs create -V 8G <pool_name>/swap

 

Step 5. Add the new swap (replace <pool_name> with the correct pool name)

swap -a /dev/zvol/dsk/<pool_name>/swap

 

Step 6. Check the path of the new swap

swap -l -h

 

Step 7. Open configuration file for the new swap

vi /etc/vfstab

 

Step 8. Replace the entry for the old swap file with the new

/dev/zvol/dsk/<pool_name>/swap

Replace the entry for the old swap file (/dev/zvol/dsk/rpool/swap) with the path to the new swap (/dev/zvol/dsk/<pool_name>/swap)

 

Step 9. Remove the old swap

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

 

Step 10. Delete the old swap volume

zfs destroy rpool/swap