words on sand

from shri at drone-ah.com

12 Apr 2018

ZFS Deleting files doesn't free up space

So I have a proxmox server on which I run a few VMs and the other day it completely ran out of space. This was because of overprovisioning through thin volumes.

After much head scratching and metaphorically banging my head against a wall, here are the things I learnt.

Empty Trash

Local Trash

Make sure that have emptied the trash on the VMs .Ubuntu has this issue and so might other distributions

Network Trash

If you have SAMBA enabled on your VMs make sure that the Recycle Bin is not enabled. I have openmediavault running on a VM and I had to go through and disable the Recycling Bin. Make sure that the Recycle bin is emptied. They are hidden folders in the root of your shares.

Correct Driver & Settings

TRIM

Configure the OS to send TRIM commands to the drive

Linux

On Mount

You can pass the parameter discard to any mountpoint and the correct TRIM commands will be sent to the disk. HOWEVER, this is apparently a big performance hit.

To do the actual trim, run

1
$ fstrim

OR to run fstrim on all supported drives

1
$ fstrim -a

Digital Ocean has a detailed post about setting TRIM and setting up a schedule etc.

Windows

My condolences! Also, I don’t run Windows on any of my VM’s so I have no experience with it.