1. Bicom Systems
  2. Solution home
  3. SERVERware
  4. HOWTOs SERVERware 5

HOWTO :: TRIM ZFS - SERVERWARE 3.1.2

In case you need to trim zfs for a customer before serverware has this implemented as a button here is the guide,


sw vps-stop -n VPS_NAME


Clone VPS


Exclude cloned VPS from backup


cat /home/lxc/VPS_NAME/vps.conf

Under [VOLUME]

[VOLUME]
volume.uuid = vol-68e95a3c95ef46e1be6c6f44aaea2031
volume.domain = domain-836d3d0a0b7e48248bd46833beead689


Copy domain and volume value


sw vps-detach -n VPS_NAME


Now the above procedure is applied on processing host if VPS is running on the processing host, after that, ssh to the storage host and continue with the procedure, in case VPS is already on the storage host, all of the procedures should be done on storage host


zfs get all NETSTOR/domain-value/vol-value


This provides information for this VPS, to show you how much storage you will free up after trim, domain-value, and volume-value are the numbers you previously copied from vps.conf


mkdir temporary


This is the folder where we will temporarily mount the volume to run trim on it


mount /dev/zvol/NETSTOR/domain-value/volume-value temporary


cat temporary/vps.conf


This is to check you are working on the correct VPS


fstrim -v /root/temporary


Path to where you mounted temporary folder ( volume )


umount MNT_POINT


Unmount temporary mount point after trim has been completed


fsck -fy /dev/zvol/NETSTOR/domain-value/vol-value


Check file system after the procedure is completed


zfs get all NETSTOR/domain-value/vol-value


Check information again for the VPS you ran trim for, see usage after trim


In case VPS was running on processing host, after above is completed, you need to ssh back to processing host, and continue with below, if it was on storage host, you execute all commands on storage host


sw vps-attach -n VPS_NAME

sw vps-start -n VPS_NAME


Check VPS if all is working fine.


Please when doing this procedure do not simply copy/paste everything, double-check everything before executing.